The internal context is meant as center piece providing (and keeping) all
information that is required by Marshaller, Unmarshaller, SourceGenerator,
MappingTool, SchemaReader and SchemaWriter. It is created, filled with
initial data and put into all other parts of Castor by
.
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.
Method from org.castor.xml.InternalContext Detail: |
abstract public void addClass(Class clazz) throws ResolverException
Loads the class descriptor for the class instance specified. The use of this method is useful
when no mapping is used, as happens when the domain classes has been generated
using the XML code generator (in which case instead of a mapping file class
descriptor files will be generated). |
abstract public void addClasses(Class[] clazzes) throws ResolverException
Loads the class descriptor for the class instance specified. The use of this method is useful
when no mapping is used, as happens when the domain classes hase been generated
using the XML code generator (in which case instead of a mapping file class
descriptor files will be generated). |
abstract public void addMapping(Mapping mapping) throws MappingException
Instructs Castor to load class descriptors from the mapping given. |
abstract public void addPackage(String packageName) throws ResolverException
Loads class descriptors from the package specified. The use of this method is useful
when no mapping is used, as happens when the domain classes hase been generated
using the XML code generator (in which case instead of a mapping file class
descriptor files will be generated).
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).
|
abstract public void addPackages(String[] packageNames) throws ResolverException
Loads class descriptors from the packages specified. The use of this method is useful
when no mapping is used, as happens when the domain classes hase been generated
using the XML code generator (in which case instead of a mapping file class
descriptor files will be generated).
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).
|
abstract public Boolean getBooleanProperty(String propertyName)
Providing access to Boolean properties of the configuration. |
abstract public ClassLoader getClassLoader()
To get the ClassLoader to use for loading resources. |
abstract public Introspector getIntrospector()
To get the Introspector assigned to this XMLContext. |
abstract public JavaNaming getJavaNaming()
|
abstract public boolean getLenientIdValidation()
Get lenient id validation flag. |
abstract public boolean getLenientSequenceOrder()
Get lenient sequence order flag. |
abstract public Boolean getLoadPackageMapping()
Get load package mapping flag. |
abstract public MappingLoader getMappingLoader()
To get the MappingLoader specified to be used in this Castor session. |
abstract public OutputFormat getOutputFormat()
Returns the default OutputFormat for use with a Serializer. |
abstract public Parser getParser()
Return an XML document parser implementing the feature list
specified in the configuration file. |
abstract public Parser getParser(String features)
Returns an XML document parser implementing the requested
set of features. The feature list is a comma separated list
of features that parser may or may not support. No errors are
generated for unsupported features. If the feature list is not
null, it overrides the default feature list specified in the
configuration file, including validation and Namespaces. |
abstract public NodeType getPrimitiveNodeType()
Returns the NodeType to use for Java primitives.
A null value will be returned if no NodeType was specified,
indicating the default NodeType should be used. |
abstract public Object getProperty(String propertyName)
To get the value of a specific property. |
abstract public RegExpEvaluator getRegExpEvaluator()
Returns a new instance of the specified Regular Expression
Evaluator, or null if no validator was specified. |
abstract public ResolverStrategy getResolverStrategy()
To get the XMLClassDescriptor resolver strategy to be used when
resolving classes into class descriptors. |
abstract public Serializer getSerializer()
Returns a default serializer for producing an XML document. The caller
can specify an alternative output format, may reuse this serializer
across several streams, and may serialize both DOM and SAX events. If
such control is not required, it is recommended to call one of the other
two methods. |
abstract public DocumentHandler getSerializer(OutputStream output) throws IOException
Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format. |
abstract public DocumentHandler getSerializer(Writer output) throws IOException
Returns a default serializer for producing an XML document to the
designated output stream using the default serialization format. |
abstract public String getStringProperty(String propertyName)
Providing access to String properties of the configuration. |
abstract public Boolean getUseIntrospector()
To get use-introspection flag. |
abstract public XMLClassDescriptorResolver getXMLClassDescriptorResolver()
To get the XMLClassdescriptorResolver instance hold in the context. |
abstract public XMLNaming getXMLNaming()
Returns the naming conventions to use for the XML framework. |
abstract public XMLNaming getXMLNaming(ClassLoader classLoader)
Returns the naming conventions to use for the XML framework. |
abstract public XMLReader getXMLReader()
Returns an XML document parser implementing the requested set of
features. The feature list is a comma separated list of features that
parser may or may not support. No errors are generated for unsupported
features. If the feature list is not null, it overrides the default
feature list specified in the configuration file, including validation
and Namespaces. |
abstract public XMLReader getXMLReader(String features)
Returns an XML document parser implementing the requested
set of features. The feature list is a comma separated list
of features that parser may or may not support. No errors are
generated for unsupported features. If the feature list is not
null, it overrides the default feature list specified in the
configuration file, including validation and Namespaces. |
abstract public boolean marshallingValidation()
To get marshalling-validation flag. |
abstract public void setClassLoader(ClassLoader classLoader)
To set the class loader to be used in all further marshalling, unmarshalling
and other actions. |
abstract public void setIntrospector(Introspector introspector)
|
abstract public void setJavaNaming(JavaNaming javaNaming)
|
abstract public void setLoadPackageMapping(Boolean loadPackageMapping)
To set the load package mapping flag. |
abstract public void setMappingLoader(MappingLoader mappingLoader)
|
abstract public void setProperty(String propertyName,
Object value)
To set properties for marshalling and unmarshalling behavior. |
abstract public void setProperty(String propertyName,
boolean value)
To set any boolean property. |
abstract public void setResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
|
abstract public void setResolverStrategy(ResolverStrategy resolverStrategy)
To set the XMLClassDescriptor resolver strategy to be used. |
abstract public void setUseIntrospector(Boolean useIntrospector)
To set use-introspection flag. |
abstract public void setXMLClassDescriptorResolver(XMLClassDescriptorResolver xmlClassDescriptorResolver)
To set the 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? |
abstract public void setXMLNaming(XMLNaming xmlNaming)
|
abstract public boolean strictElements()
To get strict-element flag. |