|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.saxonica.importer.ComponentReader
The base class for separate component unmarshallers for reading an XML Schema component.
| Field Summary | |
static int |
REQUIRE_NULL_NS
Option indicating "no namespace prefix is allowed; the name is in the null Namespace" |
static int |
REQUIRE_TARGET_NS
Option indicating "no namespace prefix is allowed; the name is in the targetNamespace" |
protected com.saxonica.importer.UnmarshallerState |
state
Unmarshaller state. |
static int |
USE_DEFAULT_NS
Option indicating "use the default element namespace when unprefixed" |
static int |
USE_NO_NAMESPACE
Option indicating "use no namespace when unprefixed" |
static int |
USE_TARGET_NS
Option indicating "use the target namespace when unprefixed" |
| Constructor Summary | |
ComponentReader(com.saxonica.importer.UnmarshallerState state)
|
|
| Method Summary | |
void |
allowAttributes(org.xml.sax.Attributes atts,
java.lang.String[] allowed)
Check the attributes of an element against a list of allowed attributes. |
void |
characters(char[] chars,
int start,
int length)
Signals to receive characters |
void |
duplicate(java.lang.String category,
java.lang.String name)
This method is called when two objects in the same symbol space within a schema have duplicate names |
void |
duplicateElement(java.lang.String name)
This method is called when two occurrences of a child element are found and only one is allowed. |
abstract java.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. |
void |
error(java.lang.String err)
This method is called for a general error. |
void |
finish()
Called to signal an end of unmarshalling. |
protected int |
getFingerprint(Schema schema,
java.lang.String name,
int option)
This method is called to check that a QName is valid and allocate a fingerprint for the name in the namePool. |
NamePool |
getNamePool()
Get the NamePool |
abstract java.lang.Object |
getObject()
Returns the Object created by this Unmarshaller |
void |
illegalElement(java.lang.String name)
This method is called when an illegal Element is encountered. |
java.lang.String |
indefiniteArticle(java.lang.String word,
java.lang.String start)
Construct an indefinite article in English |
void |
invalidAttributeValue(java.lang.String name,
java.lang.String value,
java.lang.String message)
This method is called when an invalid attribute value is found |
void |
missingAttribute(java.lang.String name)
This method is called when a required attribute is not found |
void |
missingChildElement(java.lang.String name)
This method is called when a required child element is not found |
void |
mustBeFirstElement(java.lang.String name)
This method is called when a child element is required to be the first child, but is found elsewhere |
void |
mustBeLastElement(java.lang.String name)
This method is called when a child element is required to be the first child, but is found elsewhere |
void |
mustPrecede(java.lang.String name1,
java.lang.String name2)
This method is called when two child elements are found in the wrong order. |
void |
mutuallyExclusive(java.lang.String name1,
java.lang.String name2)
This method is called when two child elements may not coexist |
void |
mutuallyExclusiveAttributes(java.lang.String name1,
java.lang.String name2)
This method is called when two attributes may not coexist |
void |
mutuallyExclusiveElementAndAttribute(java.lang.String elem,
java.lang.String att)
This method is called when an attribute and a child elements may not coexist |
int |
parseFinalOrBlock(java.lang.String attrName,
java.lang.String finalValue,
int allowed)
Parse a list of blocked or final derivations. |
void |
requireAttribute(org.xml.sax.Attributes atts,
java.lang.String required)
Indicate that a particular attribute is required |
void |
setDocumentLocator(org.xml.sax.Locator locator)
|
void |
setNamespaceContext(SchemaNamespaceContext nsContext)
Set the namespace context. |
void |
startElement(java.lang.String name,
java.lang.String namespace,
org.xml.sax.Attributes atts,
SchemaNamespaceContext nsDecls)
Signals the start of an element with the given name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int USE_DEFAULT_NS
public static final int USE_TARGET_NS
public static final int USE_NO_NAMESPACE
public static final int REQUIRE_TARGET_NS
public static final int REQUIRE_NULL_NS
protected com.saxonica.importer.UnmarshallerState state
| Constructor Detail |
public ComponentReader(com.saxonica.importer.UnmarshallerState state)
| Method Detail |
public abstract java.lang.String elementName()
public abstract java.lang.Object getObject()
public void finish()
throws SchemaException
SchemaException
public void allowAttributes(org.xml.sax.Attributes atts,
java.lang.String[] allowed)
throws SchemaException
atts - the attributes actually presentallowed - the attributes that are allowed for this element. Note that
this list must be in alphabetical order.
SchemaException
public void requireAttribute(org.xml.sax.Attributes atts,
java.lang.String required)
throws SchemaException
SchemaException
public void error(java.lang.String err)
throws SchemaException
err - the error message to report
SchemaExceptionpublic NamePool getNamePool()
protected int getFingerprint(Schema schema,
java.lang.String name,
int option)
throws SchemaException
schema - The Schema (used only to get the name pool)name - The QNameoption - The option for handling unprefixed names. Options are
to use the default namespace, the target namespace, or the null namespace
Note that this method
assumes the name, if unprefixed, is in the default namespace: NOT
the targetNamespace of the schema.
SchemaException - if the QName is invalid.
public void illegalElement(java.lang.String name)
throws SchemaException
name - the name of the illegal element
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void duplicateElement(java.lang.String name)
throws SchemaException
name - the name of the illegal element
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void duplicate(java.lang.String category,
java.lang.String name)
throws SchemaException
category - the name of the first attributename - the name of the second attribute
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void mutuallyExclusive(java.lang.String name1,
java.lang.String name2)
throws SchemaException
name1 - the name of the first elementname2 - the name of the second element
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void mutuallyExclusiveElementAndAttribute(java.lang.String elem,
java.lang.String att)
throws SchemaException
elem - the name of the elementatt - the name of the attribute
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void mutuallyExclusiveAttributes(java.lang.String name1,
java.lang.String name2)
throws SchemaException
name1 - the name of the first attributename2 - the name of the second attribute
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void mustPrecede(java.lang.String name1,
java.lang.String name2)
throws SchemaException
name1 - the name of the element that should be firstname2 - the name of the element that should be second
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void mustBeFirstElement(java.lang.String name)
throws SchemaException
name - the name of the illegal element
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public java.lang.String indefiniteArticle(java.lang.String word,
java.lang.String start)
public void mustBeLastElement(java.lang.String name)
throws SchemaException
name - the name of the illegal element
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void invalidAttributeValue(java.lang.String name,
java.lang.String value,
java.lang.String message)
throws SchemaException
name - the name of the attributevalue - the supplied value of the attributemessage - additional explanation of why it's wrong. May be null.
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void missingAttribute(java.lang.String name)
throws SchemaException
name - the name of the attribute
SchemaException - thrown if the errorListener
decides that it's a fatal error.
public void missingChildElement(java.lang.String name)
throws SchemaException
name - the name of the required child element
SchemaException - thrown if the errorListener
decides that it's a fatal error.public final void setDocumentLocator(org.xml.sax.Locator locator)
public final void setNamespaceContext(SchemaNamespaceContext nsContext)
public void characters(char[] chars,
int start,
int length)
throws SchemaException
chars - the character array containing the charactersstart - the starting index into the character arraylength - the number of characters to recieve
SchemaException
public void endElement(java.lang.String name,
java.lang.String namespace)
throws SchemaException
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.
SchemaException
public void startElement(java.lang.String name,
java.lang.String namespace,
org.xml.sax.Attributes atts,
SchemaNamespaceContext nsDecls)
throws SchemaException
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.
SchemaException
public int parseFinalOrBlock(java.lang.String attrName,
java.lang.String finalValue,
int allowed)
throws SchemaException
finalValue - A list of values to be parsed, as a string,
for example "extension restriction"allowed - The permitted values, as a bit-significant integer. For example
the value (DERIVE_BY_EXTENSION | DERIVE_BY_RESTRICTION) allows the values
"extension" and "restriction" to appear.
SchemaException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||