Class SchemaUnmarshaller
- java.lang.Object
-
- org.exolab.castor.xml.schema.reader.ComponentReader
-
- org.exolab.castor.xml.schema.reader.SchemaUnmarshaller
-
public class SchemaUnmarshaller extends ComponentReader
- Version:
- $Revision: 7506 $ $Date: 2006-04-13 06:47:36 -0600 (Thu, 13 Apr 2006) $
- Author:
- Keith Visco
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SchemaUnmarshaller.RemappedPrefixes
This class handles remapping of namespace prefixes for attributes of type QName.
-
Field Summary
Fields Modifier and Type Field Description (package private) Schema
_schema
(package private) boolean
skipAll
static java.lang.String[]
UNSUPPORTED_NAMESPACES
Unsupported namespace definitions, pointing to older XML schema specifications.static java.lang.String
XSD_NAMESPACE
W3C XML schema namespace.
-
Constructor Summary
Constructors Constructor Description SchemaUnmarshaller(SchemaContext schemaContext)
Creates aSchemaUnmarshaller
instance.SchemaUnmarshaller(SchemaContext schemaContext, boolean include, SchemaUnmarshallerState state, URIResolver uriResolver)
Creates aSchemaUnmarshaller
instance.SchemaUnmarshaller(SchemaContext schemaContext, AttributeSet atts)
Creates aSchemaUnmarshaller
instance.SchemaUnmarshaller(SchemaContext schemaContext, SchemaUnmarshallerState state)
Creates aSchemaUnmarshaller
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
Signals to recieve charactesjava.lang.String
elementName()
Returns the name of the element that this ComponentReader handles.void
endElement(java.lang.String name, java.lang.String namespace)
Signals to end of the element with the given name.java.lang.Object
getObject()
Returns the Object created by this ComponentReader.Schema
getSchema()
Returns theSchema
instance representing the XML schema (file) just processed.void
setSchema(Schema schema)
Sets theSchema
instance to be processed.void
startElement(java.lang.String name, java.lang.String namespace, AttributeSet atts, Namespaces nsDecls)
Signals the start of an element with the given name.-
Methods inherited from class org.exolab.castor.xml.schema.reader.ComponentReader
error, error, finish, getDocumentLocator, getResolver, getSchemaContext, getURIResolver, illegalAttribute, illegalElement, isWhiteSpace, outOfOrder, redefinedElement, redefinedElement, setDocumentLocator, setResolver, setSchemaContext, setURIResolver, toInt
-
-
-
-
Field Detail
-
XSD_NAMESPACE
public static final java.lang.String XSD_NAMESPACE
W3C XML schema namespace.- See Also:
- Constant Field Values
-
UNSUPPORTED_NAMESPACES
public static final java.lang.String[] UNSUPPORTED_NAMESPACES
Unsupported namespace definitions, pointing to older XML schema specifications.
-
skipAll
boolean skipAll
-
_schema
Schema _schema
-
-
Constructor Detail
-
SchemaUnmarshaller
public SchemaUnmarshaller(SchemaContext schemaContext) throws XMLException
Creates aSchemaUnmarshaller
instance.- Parameters:
schemaContext
- ASchemaContext
to be used during schema unmarshalling.- Throws:
XMLException
- Indicates that the XML schema cannnot be processed
-
SchemaUnmarshaller
public SchemaUnmarshaller(SchemaContext schemaContext, SchemaUnmarshallerState state) throws XMLException
Creates aSchemaUnmarshaller
instance.- Parameters:
schemaContext
- ASchemaContext
to be used during schema unmarshalling.state
- ASchemaUnmarshallerState
to be used during unmarshalling.- Throws:
XMLException
- Indicates that the XML schema cannnot be processed
-
SchemaUnmarshaller
public SchemaUnmarshaller(SchemaContext schemaContext, boolean include, SchemaUnmarshallerState state, URIResolver uriResolver) throws XMLException
Creates aSchemaUnmarshaller
instance.- Parameters:
schemaContext
- ASchemaContext
to be used during schema unmarshalling.include
- Indicates whether theSchema
to be processed ia an included schema.state
- ASchemaUnmarshallerState
to be used during unmarshalling.uriResolver
-URIResolver
to be used during processing.- Throws:
XMLException
- Signals a problem in processing the XML schema. Called from IncludeUnmarshaller.
-
SchemaUnmarshaller
public SchemaUnmarshaller(SchemaContext schemaContext, AttributeSet atts) throws XMLException
Creates aSchemaUnmarshaller
instance. Exists for backward compatibility- Parameters:
schemaContext
- ASchemaContext
to be used during schema unmarshalling.atts
- Attribute set to be processed.- Throws:
XMLException
- Signals a problem in processing the XML schema.
-
-
Method Detail
-
getSchema
public Schema getSchema()
Returns theSchema
instance representing the XML schema (file) just processed.- Returns:
- the
Schema
instance obtained from processing an XML schema file.
-
setSchema
public void setSchema(Schema schema)
Sets theSchema
instance to be processed.- Parameters:
schema
-Schema
instancetp be processed.
-
getObject
public java.lang.Object getObject()
Returns the Object created by this ComponentReader.- Specified by:
getObject
in classComponentReader
- Returns:
- the Object created by this ComponentReader
-
elementName
public java.lang.String elementName()
Returns the name of the element that this ComponentReader handles.- Specified by:
elementName
in classComponentReader
- Returns:
- the name of the element that this ComponentReader handles
-
startElement
public void startElement(java.lang.String name, java.lang.String namespace, AttributeSet atts, Namespaces nsDecls) throws XMLException
Signals the start of an element with the given name.- Overrides:
startElement
in classComponentReader
- Parameters:
name
- the NCName of the element. It is an error if the name is a QName (ie. contains a prefix).namespace
- the namespace of the element. This may be null. Note: A null namespace is not the same as the default namespace unless the default namespace is also null.atts
- the AttributeSet containing the attributes associated with the element.nsDecls
- the namespace declarations being declared for this element. This may be null.- Throws:
XMLException
- To indicate a problem in processing the current element.
-
endElement
public void endElement(java.lang.String name, java.lang.String namespace) throws XMLException
Signals to end of the element with the given name.- Overrides:
endElement
in classComponentReader
- Parameters:
name
- the NCName of the element. It is an error if the name is a QName (ie. contains a prefix).namespace
- the namespace of the element.- Throws:
XMLException
- To indicate that the current element cannnot be processed successfully.
-
characters
public void characters(char[] ch, int start, int length) throws XMLException
Signals to recieve charactes- Overrides:
characters
in classComponentReader
- Parameters:
ch
- the character array containing the charactersstart
- the starting index into the character arraylength
- the number of characters to recieve- Throws:
XMLException
- See Also:
ComponentReader.characters(char[], int, int)
-
-