public interface InternalContext extends PropertyChangeProvider
XMLContext. It is NOT meant to be directly instantiated by user implementations! For all
other objects it provides access to Castor state information (e.g. known descriptors) and
configuration values.| Modifier and Type | Method and Description |
|---|---|
void |
addClass(Class<?> clazz)
Loads the class descriptor for the class instance specified.
|
void |
addClasses(Class<?>[] clazzes)
Loads the class descriptor for the class instance specified.
|
void |
addMapping(Mapping mapping)
Instructs Castor to load class descriptors from the mapping given.
|
void |
addPackage(String packageName)
Loads class descriptors from the package specified.
|
void |
addPackages(String[] packageNames)
Loads class descriptors from the packages specified.
|
Boolean |
getBooleanProperty(String propertyName)
Providing access to Boolean properties of the configuration.
|
ClassLoader |
getClassLoader()
To get the ClassLoader to use for loading resources.
|
Introspector |
getIntrospector()
To get the Introspector assigned to this XMLContext.
|
JavaNaming |
getJavaNaming()
The
JavaNaming instance to be used. |
boolean |
getLenientIdValidation()
Get lenient id validation flag.
|
boolean |
getLenientSequenceOrder()
Get lenient sequence order flag.
|
Boolean |
getLoadPackageMapping()
Get load package mapping flag.
|
MappingLoader |
getMappingLoader()
To get the
MappingLoader specified to be used in this Castor session. |
OutputFormat |
getOutputFormat()
Returns the default OutputFormat for use with a Serializer.
|
Parser |
getParser()
Return an XML document parser implementing the feature list specified in the configuration
file.
|
Parser |
getParser(String features)
Returns an XML document parser implementing the requested set of features.
|
NodeType |
getPrimitiveNodeType()
Returns the NodeType to use for Java primitives.
|
Object |
getProperty(String propertyName)
To get the value of a specific property.
|
RegExpEvaluator |
getRegExpEvaluator()
Returns a new instance of the specified Regular Expression Evaluator, or null if no validator
was specified.
|
ResolverStrategy |
getResolverStrategy()
To get the XMLClassDescriptor resolver strategy to be used when resolving classes into class
descriptors.
|
Serializer |
getSerializer()
Returns a default serializer for producing an XML document.
|
DocumentHandler |
getSerializer(OutputStream output)
Returns a default serializer for producing an XML document to the designated output stream
using the default serialization format.
|
DocumentHandler |
getSerializer(Writer output)
Returns a default serializer for producing an XML document to the designated output stream
using the default serialization format.
|
String |
getStringProperty(String propertyName)
Providing access to String properties of the configuration.
|
Boolean |
getUseIntrospector()
To get use-introspection flag.
|
XMLClassDescriptorResolver |
getXMLClassDescriptorResolver()
To get the XMLClassdescriptorResolver instance hold in the context.
|
XMLNaming |
getXMLNaming()
Returns the naming conventions to use for the XML framework.
|
XMLNaming |
getXMLNaming(ClassLoader classLoader)
Returns the naming conventions to use for the XML framework.
|
XMLReader |
getXMLReader()
Returns an XML document parser implementing the requested set of features.
|
XMLReader |
getXMLReader(String features)
Returns an XML document parser implementing the requested set of features.
|
boolean |
marshallingValidation()
To get marshalling-validation flag.
|
void |
setClassLoader(ClassLoader classLoader)
To set the class loader to be used in all further marshalling, unmarshalling and other actions.
|
void |
setIntrospector(Introspector introspector)
To specify which
Introspector?is to be used. |
void |
setJavaNaming(JavaNaming javaNaming)
To set the
JavaNaming?property. |
void |
setLoadPackageMapping(Boolean loadPackageMapping)
To set the load package mapping flag.
|
void |
setMappingLoader(MappingLoader mappingLoader)
To set the
MappingLoader to be used in this Castor session. |
void |
setProperty(String propertyName,
boolean value)
To set any boolean property.
|
void |
setProperty(String propertyName,
Object value)
To set properties for marshalling and unmarshalling behavior.
|
void |
setResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
Sets an application-specific
XMLClassDescriptorResolver instance. |
void |
setResolverStrategy(ResolverStrategy resolverStrategy)
To set the XMLClassDescriptor resolver strategy to be used.
|
void |
setUseIntrospector(Boolean useIntrospector)
To set use-introspection flag.
|
void |
setXMLClassDescriptorResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
To set the
XMLClassDescriptorResolver to be used. |
void |
setXMLNaming(XMLNaming xmlNaming)
To set the
XMLNaming property. |
boolean |
strictElements()
To get strict-element flag.
|
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListenervoid addMapping(Mapping mapping) throws MappingException
mapping - Castor XML mapping (file), from which the required class descriptors will be
derived.MappingException - If the Mapping cannot be loaded and analyzed successfully.void addClass(Class<?> clazz) throws ResolverException
clazz - the class for which the associated descriptor should be loaded.ResolverException - in case that resolving the Class fails fatallyvoid addClasses(Class<?>[] clazzes) throws ResolverException
clazzes - the classes for which the associated descriptor should be loaded.ResolverException - in case that resolving the Class fails fatallyvoid addPackage(String packageName) throws ResolverException
Please note that this functionality will work only if you provide the .castor.cdr file with your generated classes (as generated by the XML code generator).
packageName - The package name for the (descriptor) classesResolverException - If there's a problem loading class descriptors for the given package.void addPackages(String[] packageNames) throws ResolverException
Please note that this functionality will work only if you provide the .castor.cdr files with your generated classes (as generated by the XML code generator).
packageNames - The package names for the (descriptor) classesResolverException - If there's a problem loading class descriptors for the given package.void setResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
XMLClassDescriptorResolver instance.xmlClassDescriptorResolver - the resolver to usevoid setProperty(String propertyName, Object value)
propertyName - name of the property to setvalue - the value to set toObject getProperty(String propertyName)
propertyName - name of the PropertyXMLNaming getXMLNaming()
XMLNaming getXMLNaming(ClassLoader classLoader)
classLoader - the class loader to be used when instantiating a new naming instanceJavaNaming getJavaNaming()
JavaNaming instance to be used.JavaNaming instance to be used.Parser getParser()
Parser getParser(String features)
features - The requested feature list, null for the defaultsXMLReader getXMLReader()
XMLReader getXMLReader(String features)
features - the name of feature to setNodeType getPrimitiveNodeType()
RegExpEvaluator getRegExpEvaluator()
Serializer getSerializer()
OutputFormat getOutputFormat()
DocumentHandler getSerializer(OutputStream output) throws IOException
output - The output streamIOException - if instantiation of the serializer failsDocumentHandler getSerializer(Writer output) throws IOException
output - The output streamIOException - if instantiation of serializer failsXMLClassDescriptorResolver getXMLClassDescriptorResolver()
Introspector getIntrospector()
ResolverStrategy getResolverStrategy()
void setResolverStrategy(ResolverStrategy resolverStrategy)
resolverStrategy - the ResolverStrategy to usevoid setMappingLoader(MappingLoader mappingLoader)
MappingLoader to be used in this Castor session.mappingLoader - the MappingLoader to useMappingLoader getMappingLoader()
MappingLoader specified to be used in this Castor session.MappingLoader to usevoid setJavaNaming(JavaNaming javaNaming)
JavaNaming?property.javaNaming - the JavaNaming to usevoid setXMLNaming(XMLNaming xmlNaming)
XMLNaming property.xmlNaming - the XMLNaming to usevoid setProperty(String propertyName, boolean value)
propertyName - name of the property to setvalue - boolean value to setBoolean getBooleanProperty(String propertyName)
propertyName - name of the propertyString getStringProperty(String propertyName)
propertyName - name of the propertyvoid setClassLoader(ClassLoader classLoader)
classLoader - the ClassLoader instance to usevoid setXMLClassDescriptorResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
XMLClassDescriptorResolver to be used. Be aware, that the
XMLClassDescriptorResolver instance holds a descriptor cache!! Maybe change it to have the
descriptor cache as part of the context?xmlClassDescriptorResolver - the XMLClassDescriptorResolver to usevoid setIntrospector(Introspector introspector)
Introspector?is to be used.introspector - Introspector to be usedClassLoader getClassLoader()
boolean getLenientIdValidation()
boolean getLenientSequenceOrder()
Boolean getLoadPackageMapping()
void setLoadPackageMapping(Boolean loadPackageMapping)
loadPackageMapping - the load package mapping flagBoolean getUseIntrospector()
void setUseIntrospector(Boolean useIntrospector)
useIntrospector - use-introspection flagboolean marshallingValidation()
boolean strictElements()
Copyright © 2016. All rights reserved.