The base class for separate component unmarshallers for
reading an XML Schema component.
characters
public void characters(char[] chars,
int start,
int length)
throws XMLException
Signals to recieve charactes
chars
- the character array containing the charactersstart
- the starting index into the character arraylength
- the number of characters to recieve
elementName
public abstract String elementName()
Returns the name of the element that this ComponentReader
handles
- the name of the element that this ComponentReader
handles
endElement
public void endElement(String name,
String namespace)
throws XMLException
Signals to end of the element with the given name.
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.
error
public void error(String err)
throws XMLException
This method is called for a general error.
err
- the error message to report
finish
public void finish()
throws XMLException
Called to signal an end of unmarshalling. This method should
be overridden to perform any necessary clean up by an unmarshaller
getDocumentLocator
public Locator getDocumentLocator()
getObject
public abstract Object getObject()
Returns the Object created by this Unmarshaller
- the Object created by this Unmarshaller
getResolver
public Resolver getResolver()
Returns the resolver used for resolving id references.
- the resolver used for resolving id references.
getURIResolver
public URIResolver getURIResolver()
Returns the URIresolver used for resolving hrefs.
- the URIresolver used for resolving hrefs.
illegalAttribute
public void illegalAttribute(String attName)
throws XMLException
This method is called when an illegal Attribute is encountered.
attName
- the name of the illegal attribute.
illegalElement
public void illegalElement(String name)
throws XMLException
This method is called when an illegal Element is encountered.
name
- the name of the illegal element
isWhiteSpace
public static boolean isWhiteSpace(char[] chars,
int start,
int length)
Determines if the given sequence of characters consists
of whitespace characters
chars
- an array of characters to check for whitespacestart
- the start index into the character arraylength
- the number of characters to check
- true if the characters specficied consist only
of whitespace characters
outOfOrder
public void outOfOrder(String name)
throws XMLException
This method is called when an out of order element is encountered
redefinedElement
public void redefinedElement(String name)
throws XMLException
This method is called when an element which may only
be defined once, is redefined.
name
- the name of the element
redefinedElement
public void redefinedElement(String name,
String xtraInfo)
throws XMLException
This method is called when an element which may only
be defined once, is redefined.
name
- the name of the element
setDocumentLocator
public void setDocumentLocator(Locator locator)
setResolver
public void setResolver(Resolver resolver)
Sets the Resolver to be used for resolving id references
resolver
- the Resolver to be used for resolving
id references
setURIResolver
public void setURIResolver(URIResolver uriResolver)
Sets the URIResolver to be used for resolving hrefs.
uriResolver
- the URIResolver to be used for resolving hrefs.
startElement
public void startElement(String name,
String namespace,
AttributeSet atts,
Namespaces nsDecls)
throws XMLException
Signals the start of an element with the given name.
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.
toInt
public static int toInt(String str)
throws IllegalArgumentException
Converts the given String to an int
str
- the String to convert to an int
- the int derived from the given String