org.exolab.castor.xml.schema.reader
Class ComponentReader

java.lang.Object
  extended by org.exolab.castor.xml.schema.reader.ComponentReader
Direct Known Subclasses:
AnnotationUnmarshaller, AppInfoUnmarshaller, AttributeGroupUnmarshaller, AttributeUnmarshaller, CharacterUnmarshaller, ComplexContentRestrictionUnmarshaller, ComplexContentUnmarshaller, ComplexTypeUnmarshaller, DocumentationUnmarshaller, ElementUnmarshaller, ExtensionUnmarshaller, FacetUnmarshaller, FieldOrSelectorUnmarshaller, GroupUnmarshaller, IdentityConstraintUnmarshaller, ImportUnmarshaller, IncludeUnmarshaller, ModelGroupUnmarshaller, RedefineUnmarshaller, SchemaUnmarshaller, SimpleContentRestrictionUnmarshaller, SimpleContentUnmarshaller, SimpleTypeListUnmarshaller, SimpleTypeRestrictionUnmarshaller, SimpleTypeUnmarshaller, UnionUnmarshaller, UnknownUnmarshaller, WildcardUnmarshaller

public abstract class ComponentReader
extends java.lang.Object

The base class for separate component unmarshallers for reading an XML Schema component.

Version:
$Revision: 1.3 $ $Date: 2005/03/07 08:27:13 $
Author:
Keith Visco

Field Summary
protected  org.xml.sax.Locator _locator
          The document locator
 
Constructor Summary
ComponentReader()
           
 
Method Summary
 void characters(char[] chars, int start, int length)
          Signals to recieve charactes
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.Exception ex)
          This method is called for a general error.
 void error(java.lang.String err)
          This method is called for a general error.
 void finish()
          Called to signal an end of unmarshalling.
 org.xml.sax.Locator getDocumentLocator()
           
abstract  java.lang.Object getObject()
          Returns the Object created by this Unmarshaller
 Resolver getResolver()
          Returns the resolver used for resolving id references.
 URIResolver getURIResolver()
          Returns the URIresolver used for resolving hrefs.
 void illegalAttribute(java.lang.String attName)
          This method is called when an illegal Attribute is encountered.
 void illegalElement(java.lang.String name)
          This method is called when an illegal Element is encountered.
static boolean isWhiteSpace(char[] chars, int start, int length)
          Determines if the given sequence of characters consists of whitespace characters
 void outOfOrder(java.lang.String name)
          This method is called when an out of order element is encountered
 void redefinedElement(java.lang.String name)
          This method is called when an element which may only be defined once, is redefined.
 void redefinedElement(java.lang.String name, java.lang.String xtraInfo)
          This method is called when an element which may only be defined once, is redefined.
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void setResolver(Resolver resolver)
          Sets the Resolver to be used for resolving id references
 void setURIResolver(URIResolver uriResolver)
          Sets the URIResolver to be used for resolving hrefs.
 void startElement(java.lang.String name, java.lang.String namespace, AttributeSet atts, Namespaces nsDecls)
          Signals the start of an element with the given name.
static int toInt(java.lang.String str)
          Converts the given String to an int
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_locator

protected org.xml.sax.Locator _locator
The document locator

Constructor Detail

ComponentReader

public ComponentReader()
Method Detail

elementName

public abstract java.lang.String elementName()
Returns the name of the element that this ComponentReader handles

Returns:
the name of the element that this ComponentReader handles

getObject

public abstract java.lang.Object getObject()
Returns the Object created by this Unmarshaller

Returns:
the Object created by this Unmarshaller

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

Throws:
XMLException

getDocumentLocator

public org.xml.sax.Locator getDocumentLocator()

getResolver

public Resolver getResolver()
Returns the resolver used for resolving id references.

Returns:
the resolver used for resolving id references.

getURIResolver

public URIResolver getURIResolver()
Returns the URIresolver used for resolving hrefs.

Returns:
the URIresolver used for resolving hrefs.

setResolver

public void setResolver(Resolver resolver)
Sets the Resolver to be used for resolving id references

Parameters:
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.

Parameters:
uriResolver - the URIResolver to be used for resolving hrefs.

isWhiteSpace

public static boolean isWhiteSpace(char[] chars,
                                   int start,
                                   int length)
Determines if the given sequence of characters consists of whitespace characters

Parameters:
chars - an array of characters to check for whitespace
start - the start index into the character array
length - the number of characters to check
Returns:
true if the characters specficied consist only of whitespace characters

error

public void error(java.lang.String err)
           throws XMLException
This method is called for a general error.

Parameters:
err - the error message to report
Throws:
org.xml.sax.SAXException - always thrown.
XMLException

error

public void error(java.lang.Exception ex)
           throws XMLException
This method is called for a general error.

Parameters:
ex - the Exception that caused the error.
Throws:
org.xml.sax.SAXException - always thrown.
XMLException

illegalAttribute

public void illegalAttribute(java.lang.String attName)
                      throws XMLException
This method is called when an illegal Attribute is encountered.

Parameters:
attName - the name of the illegal attribute.
Throws:
org.xml.sax.SAXException - always thrown.
XMLException

illegalElement

public void illegalElement(java.lang.String name)
                    throws XMLException
This method is called when an illegal Element is encountered.

Parameters:
name - the name of the illegal element
Throws:
org.xml.sax.SAXException - always thrown.
XMLException

redefinedElement

public void redefinedElement(java.lang.String name)
                      throws XMLException
This method is called when an element which may only be defined once, is redefined.

Parameters:
name - the name of the element
Throws:
org.xml.sax.SAXException - always thrown.
XMLException

redefinedElement

public void redefinedElement(java.lang.String name,
                             java.lang.String xtraInfo)
                      throws XMLException
This method is called when an element which may only be defined once, is redefined.

Parameters:
name - the name of the element
Throws:
org.xml.sax.SAXException - always thrown.
XMLException

outOfOrder

public void outOfOrder(java.lang.String name)
                throws XMLException
This method is called when an out of order element is encountered

Throws:
org.xml.sax.SAXException - always thrown.
XMLException

toInt

public static int toInt(java.lang.String str)
                 throws java.lang.IllegalArgumentException
Converts the given String to an int

Parameters:
str - the String to convert to an int
Returns:
the int derived from the given String
Throws:
java.lang.IllegalArgumentException - when the given String does not represent a valid int

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)

characters

public void characters(char[] chars,
                       int start,
                       int length)
                throws XMLException
Signals to recieve charactes

Parameters:
chars - the character array containing the characters
start - the starting index into the character array
length - the number of characters to recieve
Throws:
XMLException

endElement

public void endElement(java.lang.String name,
                       java.lang.String namespace)
                throws XMLException
Signals to end of the element with the given name.

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

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.

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


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com