org.apache.commons.betwixt.registry
Class DefaultXMLBeanInfoRegistry

java.lang.Object
  |
  +--org.apache.commons.betwixt.registry.DefaultXMLBeanInfoRegistry
All Implemented Interfaces:
PolymorphicReferenceResolver, XMLBeanInfoRegistry

public class DefaultXMLBeanInfoRegistry
extends java.lang.Object
implements XMLBeanInfoRegistry, PolymorphicReferenceResolver

The default caching implementation. A hashmap is used.

Version:
$Id: DefaultXMLBeanInfoRegistry.java 190515 2005-06-13 21:46:02Z rdonkin $
Author:
Robert Burrell Donkin

Constructor Summary
DefaultXMLBeanInfoRegistry()
           
 
Method Summary
 void flush()
          Flush existing cached XMLBeanInfo's.
 XMLBeanInfo get(java.lang.Class forThisClass)
          Get XMLBeanInfo from cache.
 void put(java.lang.Class forThisClass, XMLBeanInfo beanInfo)
          Put into cache
 java.lang.Class resolveType(ElementMapping mapping, ReadContext context)
          Checks all registered XMLBeanInfo's for the first suitable match.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultXMLBeanInfoRegistry

public DefaultXMLBeanInfoRegistry()
Method Detail

get

public XMLBeanInfo get(java.lang.Class forThisClass)
Get XMLBeanInfo from cache.
Specified by:
get in interface XMLBeanInfoRegistry
Parameters:
forThisClass - the class for which to find a XMLBeanInfo
Returns:
cached XMLBeanInfo associated with given class or null if no XMLBeanInfo has been associated

put

public void put(java.lang.Class forThisClass,
                XMLBeanInfo beanInfo)
Put into cache
Specified by:
put in interface XMLBeanInfoRegistry
Parameters:
forThisClass - the class to cache the XMLBeanInfo for
beanInfo - the XMLBeanInfo to cache

flush

public void flush()
Flush existing cached XMLBeanInfo's.
Specified by:
flush in interface XMLBeanInfoRegistry

resolveType

public java.lang.Class resolveType(ElementMapping mapping,
                                   ReadContext context)
Checks all registered XMLBeanInfo's for the first suitable match. If a suitable one is found, then the class of that info is used.
Specified by:
resolveType in interface PolymorphicReferenceResolver
Since:
0.7
See Also:
PolymorphicReferenceResolver.resolveType(org.apache.commons.betwixt.io.read.ElementMapping, org.apache.commons.betwixt.io.read.ReadContext)


Copyright © 2002-2005 The Apache Software Foundation. All Rights Reserved.