org.jbind.xml.schema.element
Class SchemaParser

java.lang.Object
  extended byorg.jbind.xml.schema.element.SchemaParser
All Implemented Interfaces:
IContentHandler, IElemValHelper, IErrorHandler, IRegExFactory, ISchemaParser, IXPathFactory

public class SchemaParser
extends java.lang.Object
implements ISchemaParser, IElemValHelper, IContentHandler, IErrorHandler


Constructor Summary
SchemaParser(org.xml.sax.EntityResolver anEntityResolver, IXPathFactory anXPathFactory, IRegExFactory aRegExFactory)
           
 
Method Summary
 IRegEx createRegEx(java.lang.String aRegEx)
           
 IXPath createXPath(java.lang.String anXPath, java.util.Map aPrefixMappings, boolean aRestrictedForm)
          Creates an XPath.
 void endDocument(org.xml.sax.InputSource anInputSource, INamespaceContext aNamespaceContext)
          Signals the end of a document.
 void endElement(QualifiedName aQName, java.util.Map anAttributes, int aLine, int aColumn, org.xml.sax.InputSource anInputSource, INamespaceContext aNamespaceContext)
          Signals the end of an element.
 void endXInclude()
          Signals the end of an XInclude.
 boolean error(IMessage aMessage)
          Signals an error.
 void exception(java.lang.Exception anException, org.xml.sax.InputSource anInputSource)
          Signals that an exception occured.
 void fatalError(IMessage aMessage)
          Signals a fatal error.
 ISchemaDocument getDocument()
           
 ISchemaElement parseSchema(java.net.URL anUrl, ISchemaElement aParent)
          Parses a schema doucment.
 void startDocument(org.xml.sax.InputSource anInputSource, INamespaceContext aNamespaceContext)
          Signals the start of a document.
 void startElement(QualifiedName aQName, java.util.Map anAttributes, int aLine, int aColumn, org.xml.sax.InputSource anInputSource, INamespaceContext aNamespaceContext)
          Signals the start of an element.
 void startXInclude(java.lang.String aParseMethod, java.net.URL aUrl, java.lang.String aFragementId)
          Signals that an XInclude started.
 void text(java.lang.String aString, int aLine, int aColumn, org.xml.sax.InputSource anInputSource, INamespaceContext aNamespaceContext)
          Signals text.
 boolean warning(IMessage aMessage)
          Signals a warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaParser

public SchemaParser(org.xml.sax.EntityResolver anEntityResolver,
                    IXPathFactory anXPathFactory,
                    IRegExFactory aRegExFactory)
Method Detail

parseSchema

public ISchemaElement parseSchema(java.net.URL anUrl,
                                  ISchemaElement aParent)
                           throws XmlException
Description copied from interface: ISchemaParser
Parses a schema doucment.

Specified by:
parseSchema in interface ISchemaParser
Parameters:
anUrl - (required).
aParent - (optional).
Returns:
(required).
Throws:
XmlException

getDocument

public ISchemaDocument getDocument()

startDocument

public void startDocument(org.xml.sax.InputSource anInputSource,
                          INamespaceContext aNamespaceContext)
Description copied from interface: IContentHandler
Signals the start of a document.

Specified by:
startDocument in interface IContentHandler
Parameters:
anInputSource - (required).
aNamespaceContext - (required).

endDocument

public void endDocument(org.xml.sax.InputSource anInputSource,
                        INamespaceContext aNamespaceContext)
Description copied from interface: IContentHandler
Signals the end of a document.

Specified by:
endDocument in interface IContentHandler
Parameters:
anInputSource - (required).
aNamespaceContext - (required).

startElement

public void startElement(QualifiedName aQName,
                         java.util.Map anAttributes,
                         int aLine,
                         int aColumn,
                         org.xml.sax.InputSource anInputSource,
                         INamespaceContext aNamespaceContext)
                  throws java.lang.Exception
Description copied from interface: IContentHandler
Signals the start of an element.

Specified by:
startElement in interface IContentHandler
Parameters:
aQName - (required). The name of the element.
anAttributes - (required). Maps IQNames to AttributeData.
aLine - The current line.
aColumn - The current column.
anInputSource - (required).
aNamespaceContext - (required).
Throws:
java.lang.Exception

endElement

public void endElement(QualifiedName aQName,
                       java.util.Map anAttributes,
                       int aLine,
                       int aColumn,
                       org.xml.sax.InputSource anInputSource,
                       INamespaceContext aNamespaceContext)
                throws java.lang.Exception
Description copied from interface: IContentHandler
Signals the end of an element.

Specified by:
endElement in interface IContentHandler
Parameters:
aQName - (required). The name of the element.
anAttributes - (required). Maps IQNames to AttributeData.
aLine - The current line.
aColumn - The current column.
anInputSource - (required).
aNamespaceContext - (required).
Throws:
java.lang.Exception

text

public void text(java.lang.String aString,
                 int aLine,
                 int aColumn,
                 org.xml.sax.InputSource anInputSource,
                 INamespaceContext aNamespaceContext)
          throws java.lang.Exception
Description copied from interface: IContentHandler
Signals text.

Specified by:
text in interface IContentHandler
Parameters:
aString - (required).
aLine - The current line.
aColumn - The current column.
anInputSource - (required).
aNamespaceContext - (required).
Throws:
java.lang.Exception

startXInclude

public void startXInclude(java.lang.String aParseMethod,
                          java.net.URL aUrl,
                          java.lang.String aFragementId)
Description copied from interface: IContentHandler
Signals that an XInclude started.

Specified by:
startXInclude in interface IContentHandler
Parameters:
aParseMethod - (required). There are 3 possible values:
  1. "xml"
  2. "text"
  3. "fallback": This type is used to indicate a content handler that a resource could not be included but that its fallback content is going to be used.
aUrl - (required). The resource that is included or that could not be accessed (in case that the parse method is "fallback"). A content handler may use this URL for example to generate xml:base attributes for included elements.

endXInclude

public void endXInclude()
Description copied from interface: IContentHandler
Signals the end of an XInclude.

Specified by:
endXInclude in interface IContentHandler

createRegEx

public IRegEx createRegEx(java.lang.String aRegEx)
                   throws java.lang.Exception
Specified by:
createRegEx in interface IRegExFactory
Throws:
java.lang.Exception

createXPath

public IXPath createXPath(java.lang.String anXPath,
                          java.util.Map aPrefixMappings,
                          boolean aRestrictedForm)
                   throws java.lang.Exception
Description copied from interface: IXPathFactory
Creates an XPath.

Specified by:
createXPath in interface IXPathFactory
Parameters:
anXPath - (required).
aPrefixMappings - (required). Maps namespace prefixes to namespace strings.
aRestrictedForm - Determines if only the restricted form of XPaths of the XML schema specification is allowed or if unrestricted XPaths are allowed.
Returns:
(required).
Throws:
java.lang.Exception

fatalError

public void fatalError(IMessage aMessage)
Description copied from interface: IErrorHandler
Signals a fatal error. The parser stops imediately to report any further events.

Specified by:
fatalError in interface IErrorHandler
Parameters:
aMessage - (required).

error

public boolean error(IMessage aMessage)
Description copied from interface: IErrorHandler
Signals an error.

Specified by:
error in interface IErrorHandler
Parameters:
aMessage - (required).
Returns:
If true is returned then the parsing is aborted otherwise the parsing is continued.

warning

public boolean warning(IMessage aMessage)
Description copied from interface: IErrorHandler
Signals a warning.

Specified by:
warning in interface IErrorHandler
Parameters:
aMessage - (required).
Returns:
If true is returned then the parsing is aborted otherwise the parsing is continued.

exception

public void exception(java.lang.Exception anException,
                      org.xml.sax.InputSource anInputSource)
Description copied from interface: IErrorHandler
Signals that an exception occured. The parser stops imediately to report any further events.

Specified by:
exception in interface IErrorHandler
Parameters:
anException - (required).
anInputSource - (required). The source that is parsed.