Class CastorXMLStrategy
java.lang.Object
org.exolab.castor.xml.util.resolvers.CastorXMLStrategy
- All Implemented Interfaces:
ResolverStrategy
The Castor XML resolver strategy implements the resolving behaviour as it had
been implmented before this refactoring step. Meaning that:
It uses multiple steps to find a class descriptor for a class.
It uses a cache of class descriptors
A class that couldn't be resolved once is marked as unresolvable and will not be resolved again - even on a second call.
It uses multiple steps to find a class descriptor for a class.
It uses a cache of class descriptors
A class that couldn't be resolved once is marked as unresolvable and will not be resolved again - even on a second call.
- Since:
- 1.2
- Version:
- $Revision$ $Date$
- Author:
- Joachim Grueneis, Steven Dolg
-
Nested Class Summary
Nested classes/interfaces inherited from interface ResolverStrategy
ResolverStrategy.ResolverResultsModifier and TypeInterfaceDescriptionstatic interfaceAs a strategy generate one or more class descriptors it needs a place to put the results to. -
Field Summary
Fields inherited from interface ResolverStrategy
PROPERTY_CLASS_LOADER, PROPERTY_INTROSPECTOR, PROPERTY_LOAD_PACKAGE_MAPPINGS, PROPERTY_MAPPING_LOADER, PROPERTY_USE_INTROSPECTIONModifier and TypeFieldDescriptionstatic final StringTo set the class loader property for resolving.static final StringTo set the introspector property for resolving.static final StringTo set the LoadPackageMappings property for resolving.static final StringTo set the mapping loader property for resolving.static final StringTo set the use introspection property for resolving. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolveClass(ResolverStrategy.ResolverResults resolverResults, String className) Implementes a strategy how a class is resolved into a list of class descriptors.voidresolvePackage(ResolverStrategy.ResolverResults resolverResults, String packageName) Implementes a strategy how a package is resolved into a list of class descriptors.voidsetProperty(String key, Object value) To set properties for strategy and/or commands.
-
Constructor Details
-
CastorXMLStrategy
public CastorXMLStrategy()CastorXMLStrategy requires a configuration to be set. Within the constructor the commands building the strategy are instantiated, a command configuration is created and the descriptor cache.
-
-
Method Details
-
setProperty
To set properties for strategy and/or commands.- Specified by:
setPropertyin interfaceResolverStrategy- Parameters:
key- name of the propertyvalue- value the property is set to
-
resolveClass
public ClassDescriptor resolveClass(ResolverStrategy.ResolverResults resolverResults, String className) throws ResolverException Implementes a strategy how a class is resolved into a list of class descriptors.- Specified by:
resolveClassin interfaceResolverStrategy- Parameters:
resolverResults- to put the resolver reszlts intoclassName- the class to resolve- Returns:
- the ClassDescriptor for the class or null if the class couldn't be resolved
- Throws:
ResolverException- in case that resolving fails fatally
-
resolvePackage
public void resolvePackage(ResolverStrategy.ResolverResults resolverResults, String packageName) throws ResolverException Implementes a strategy how a package is resolved into a list of class descriptors.- Specified by:
resolvePackagein interfaceResolverStrategy- Parameters:
resolverResults- to put the resolver reszlts intopackageName- the package to resolve- Throws:
ResolverException- in case that resolving fails fatally
-