InternalContext
BackwardCompatibilityContext
public abstract class AbstractInternalContext extends java.lang.Object implements InternalContext
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.Constructor | Description |
---|---|
AbstractInternalContext() |
Creates an instance of
AbstractInternalContext . |
Modifier and Type | Method | Description |
---|---|---|
void |
addClass(java.lang.Class clazz) |
Loads the class descriptor for the class instance specified.
|
void |
addClasses(java.lang.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(java.lang.String packageName) |
Loads class descriptors from the package specified.
|
void |
addPackages(java.lang.String[] packageNames) |
Loads class descriptors from the packages specified.
|
java.lang.Boolean |
getBooleanProperty(java.lang.String propertyName) |
Providing access to Boolean properties of the configuration.
|
java.lang.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.
|
java.lang.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.
|
org.xml.sax.Parser |
getParser() |
Return an XML document parser implementing the feature list
specified in the configuration file.
|
org.xml.sax.Parser |
getParser(java.lang.String features) |
Returns an XML document parser implementing the requested
set of features.
|
NodeType |
getPrimitiveNodeType() |
Returns the NodeType to use for Java primitives.
|
java.lang.Object |
getProperty(java.lang.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.
|
org.xml.sax.DocumentHandler |
getSerializer(java.io.OutputStream output) |
Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format.
|
org.xml.sax.DocumentHandler |
getSerializer(java.io.Writer output) |
Returns a default serializer for producing an XML document to the
designated output stream using the default serialization format.
|
protected XMLSerializerFactory |
getSerializerFactory(java.lang.String serializerFactoryName) |
Returns the currently configured XMLSerializerFactory instance.
|
java.lang.String |
getStringProperty(java.lang.String propertyName) |
Providing access to String properties of the configuration.
|
java.lang.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(java.lang.ClassLoader classLoader) |
Deprecated.
Makes no sence!
|
org.xml.sax.XMLReader |
getXMLReader() |
Returns an XML document parser implementing the requested set of
features.
|
org.xml.sax.XMLReader |
getXMLReader(java.lang.String features) |
Returns an XML document parser implementing the requested
set of features.
|
boolean |
marshallingValidation() |
To get marshalling-validation flag.
|
void |
setClassLoader(java.lang.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(java.lang.String javaNamingProperty) |
|
void |
setJavaNaming(JavaNaming javaNaming) |
To set the
JavaNaming ?property. |
void |
setLoadPackageMapping(java.lang.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(java.lang.String propertyName,
boolean value) |
To set any boolean property.
|
void |
setProperty(java.lang.String propertyName,
java.lang.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(java.lang.Boolean useIntrospector) |
To set use-introspection flag.
|
void |
setXMLClassDescriptorResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver) |
To set the
XMLClassDescriptorResolver to be used. |
void |
setXMLNaming(java.lang.String xmlNamingProperty) |
This XMLNaming setter is meant to be used when working in property style
instead of setting an XMLNaming implementation.
|
void |
setXMLNaming(XMLNaming xmlNaming) |
To set the
XMLNaming property. |
boolean |
strictElements() |
To get strict-element flag.
|
public AbstractInternalContext()
AbstractInternalContext
. The internal context is meant to
hold the configuration and state informations, but not necessarily retrieving
those values...public void addMapping(Mapping mapping) throws MappingException
InternalContext
addMapping
in interface InternalContext
mapping
- Castor XML mapping (file), from which the required class
descriptors will be derived.MappingException
- If the Mapping
cannot be loaded and analyzed successfully.InternalContext.addMapping(org.exolab.castor.mapping.Mapping)
public void addClass(java.lang.Class clazz) throws ResolverException
InternalContext
addClass
in interface InternalContext
clazz
- the class for which the associated descriptor should be loaded.ResolverException
- in case that resolving the Class fails fatallyInternalContext.addClass(java.lang.Class)
public void addClasses(java.lang.Class[] clazzes) throws ResolverException
InternalContext
addClasses
in interface InternalContext
clazzes
- the classes for which the associated descriptor should be loaded.ResolverException
- in case that resolving the Class fails fatallyInternalContext.addClasses(java.lang.Class[])
public void addPackage(java.lang.String packageName) throws ResolverException
InternalContext
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).
addPackage
in interface InternalContext
packageName
- The package name for the (descriptor) classesResolverException
- If there's a problem loading class descriptors for the given package.InternalContext.addPackage(java.lang.String)
public void addPackages(java.lang.String[] packageNames) throws ResolverException
InternalContext
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).
addPackages
in interface InternalContext
packageNames
- The package names for the (descriptor) classesResolverException
- If there's a problem loading class descriptors for the given package.InternalContext.addPackages(java.lang.String[])
public void setResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
InternalContext
XMLClassDescriptorResolver
instance.setResolver
in interface InternalContext
xmlClassDescriptorResolver
- the resolver to useInternalContext.setResolver(org.exolab.castor.xml.XMLClassDescriptorResolver)
public void setProperty(java.lang.String propertyName, java.lang.Object value)
setProperty
in interface InternalContext
propertyName
- name of the property to setvalue
- the value to set toInternalContext.setProperty(java.lang.String, java.lang.Object)
public java.lang.Object getProperty(java.lang.String propertyName)
InternalContext
getProperty
in interface InternalContext
propertyName
- name of the PropertyInternalContext.getProperty(java.lang.String)
public XMLNaming getXMLNaming()
getXMLNaming
in interface InternalContext
InternalContext.getXMLNaming()
public XMLNaming getXMLNaming(java.lang.ClassLoader classLoader)
getXMLNaming
in interface InternalContext
classLoader
- the class loader to be used when instantiating a new naming instanceInternalContext.getXMLNaming(java.lang.ClassLoader)
public JavaNaming getJavaNaming()
InternalContext
JavaNaming
instance to be used.getJavaNaming
in interface InternalContext
JavaNaming
instance to be used.InternalContext.getJavaNaming()
public org.xml.sax.Parser getParser()
InternalContext
getParser
in interface InternalContext
InternalContext.getParser()
public org.xml.sax.Parser getParser(java.lang.String features)
InternalContext
getParser
in interface InternalContext
features
- The requested feature list, null for the
defaultsInternalContext.getParser(java.lang.String)
public org.xml.sax.XMLReader getXMLReader()
InternalContext
getXMLReader
in interface InternalContext
InternalContext.getXMLReader()
public org.xml.sax.XMLReader getXMLReader(java.lang.String features)
InternalContext
getXMLReader
in interface InternalContext
features
- the name of feature to setInternalContext.getXMLReader(java.lang.String)
public NodeType getPrimitiveNodeType()
InternalContext
getPrimitiveNodeType
in interface InternalContext
InternalContext.getPrimitiveNodeType()
public RegExpEvaluator getRegExpEvaluator()
getRegExpEvaluator
in interface InternalContext
InternalContext.getRegExpEvaluator()
public Serializer getSerializer()
InternalContext
getSerializer
in interface InternalContext
InternalContext.getSerializer()
public OutputFormat getOutputFormat()
InternalContext
getOutputFormat
in interface InternalContext
InternalContext.getOutputFormat()
protected XMLSerializerFactory getSerializerFactory(java.lang.String serializerFactoryName)
serializerFactoryName
- the class name of the serializer factorypublic org.xml.sax.DocumentHandler getSerializer(java.io.OutputStream output) throws java.io.IOException
InternalContext
getSerializer
in interface InternalContext
output
- The output streamjava.io.IOException
- if instantiation of the serializer failsInternalContext.getSerializer(java.io.OutputStream)
public org.xml.sax.DocumentHandler getSerializer(java.io.Writer output) throws java.io.IOException
InternalContext
getSerializer
in interface InternalContext
output
- The output streamjava.io.IOException
- if instantiation of serializer failsInternalContext.getSerializer(java.io.Writer)
public XMLClassDescriptorResolver getXMLClassDescriptorResolver()
InternalContext
getXMLClassDescriptorResolver
in interface InternalContext
InternalContext.getXMLClassDescriptorResolver()
public Introspector getIntrospector()
InternalContext
getIntrospector
in interface InternalContext
InternalContext.getIntrospector()
public ResolverStrategy getResolverStrategy()
InternalContext
getResolverStrategy
in interface InternalContext
InternalContext.getResolverStrategy()
public void setResolverStrategy(ResolverStrategy resolverStrategy)
InternalContext
setResolverStrategy
in interface InternalContext
resolverStrategy
- the ResolverStrategy to useInternalContext.setResolverStrategy(org.exolab.castor.xml.util.ResolverStrategy)
public void setMappingLoader(MappingLoader mappingLoader)
InternalContext
MappingLoader
to be used in this Castor session.setMappingLoader
in interface InternalContext
mappingLoader
- the MappingLoader
to useInternalContext.setMappingLoader(org.exolab.castor.mapping.MappingLoader)
public MappingLoader getMappingLoader()
InternalContext
MappingLoader
specified to be used in this Castor session.getMappingLoader
in interface InternalContext
MappingLoader
to useInternalContext.getMappingLoader()
public void setJavaNaming(JavaNaming javaNaming)
InternalContext
JavaNaming
?property.setJavaNaming
in interface InternalContext
javaNaming
- the JavaNaming
to useInternalContext.setJavaNaming(org.castor.xml.JavaNaming)
public void setJavaNaming(java.lang.String javaNamingProperty)
public void setXMLNaming(XMLNaming xmlNaming)
InternalContext
XMLNaming
property.setXMLNaming
in interface InternalContext
xmlNaming
- the XMLNaming
to useInternalContext.setXMLNaming(org.castor.xml.XMLNaming)
public void setXMLNaming(java.lang.String xmlNamingProperty)
xmlNamingProperty
- to set the XMLNaming property as read from configurationpublic void setProperty(java.lang.String propertyName, boolean value)
InternalContext
setProperty
in interface InternalContext
propertyName
- name of the property to setvalue
- boolean value to setInternalContext.setProperty(java.lang.String, boolean)
public java.lang.Boolean getBooleanProperty(java.lang.String propertyName)
InternalContext
getBooleanProperty
in interface InternalContext
propertyName
- name of the propertyInternalContext.getBooleanProperty(java.lang.String)
public java.lang.String getStringProperty(java.lang.String propertyName)
InternalContext
getStringProperty
in interface InternalContext
propertyName
- name of the propertyInternalContext.getStringProperty(java.lang.String)
public void setClassLoader(java.lang.ClassLoader classLoader)
InternalContext
setClassLoader
in interface InternalContext
classLoader
- the ClassLoader instance to useInternalContext.setClassLoader(java.lang.ClassLoader)
public void setXMLClassDescriptorResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
InternalContext
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?setXMLClassDescriptorResolver
in interface InternalContext
xmlClassDescriptorResolver
- the XMLClassDescriptorResolver
to useInternalContext.setXMLClassDescriptorResolver(org.exolab.castor.xml.XMLClassDescriptorResolver)
public void setIntrospector(Introspector introspector)
InternalContext
Introspector
?is to be used.setIntrospector
in interface InternalContext
introspector
- Introspector
to be usedInternalContext.setIntrospector(org.exolab.castor.xml.Introspector)
public java.lang.ClassLoader getClassLoader()
InternalContext
getClassLoader
in interface InternalContext
InternalContext.getClassLoader()
public boolean getLenientIdValidation()
InternalContext
getLenientIdValidation
in interface InternalContext
InternalContext.getLenientIdValidation()
public boolean getLenientSequenceOrder()
InternalContext
getLenientSequenceOrder
in interface InternalContext
InternalContext.getLenientSequenceOrder()
public java.lang.Boolean getLoadPackageMapping()
InternalContext
getLoadPackageMapping
in interface InternalContext
InternalContext.getLoadPackageMapping()
public void setLoadPackageMapping(java.lang.Boolean loadPackageMapping)
InternalContext
setLoadPackageMapping
in interface InternalContext
loadPackageMapping
- the load package mapping flagInternalContext.setLoadPackageMapping(java.lang.Boolean)
public java.lang.Boolean getUseIntrospector()
InternalContext
getUseIntrospector
in interface InternalContext
InternalContext.getUseIntrospector()
public void setUseIntrospector(java.lang.Boolean useIntrospector)
InternalContext
setUseIntrospector
in interface InternalContext
useIntrospector
- use-introspection flagInternalContext.setUseIntrospector(java.lang.Boolean)
public boolean marshallingValidation()
InternalContext
marshallingValidation
in interface InternalContext
InternalContext.marshallingValidation()
public boolean strictElements()
InternalContext
strictElements
in interface InternalContext
InternalContext.strictElements()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com