net.sf.jaxme.xs.impl
Class XSLogicalParser

java.lang.Object
  extended bynet.sf.jaxme.xs.impl.XSLogicalParser

public class XSLogicalParser
extends java.lang.Object

Implementation of a logical parser.

Author:
Jochen Wiedmann

Constructor Summary
XSLogicalParser()
           
 
Method Summary
protected  void add(XsESchema pSyntaxSchema, java.lang.Object pChild)
          Adds the given object to the schema.
 XsESchema getCurrentSyntaxSchema()
          Returns the syntax schema, which is currently being parsed.
protected  XSContext getData()
           
protected  org.xml.sax.InputSource getInputSource(java.lang.String pReferencingSystemId, XsAnyURI pURI)
          Converts the given URI into an instance of InputSource.
 XSSchema getSchema()
          Returns the schema, which is currently being parsed.
 XsESchema[] getSyntaxSchemas()
          Provides context information to the schema which is currently being parsed.
protected  void importSchema(XsESchema pImportingSchema, XsEImport pImport)
          Handles xs:import.
protected  void includeSchema(XsESchema pIncludingSchema, XsEInclude pInclude)
          Handles xs:include.
 boolean isValidating()
          Returns whether the parser is validating.
 XSSchema parse(org.xml.sax.InputSource pSource)
          This is the logical parsers frontent.
protected  void parse(XsESchema pSyntaxSchema)
          Parses the given InputSource syntactically and converts the objects that it finds into logical objects.
protected  XsESchema parseSyntax(org.xml.sax.InputSource pSource)
           
protected  void redefine(XsESchema pSyntaxSchema, XsERedefine pRedefine, XsRedefinable pChild)
          Redefines the given XsRedefinable.
protected  void redefineSchema(XsESchema pRedefiningSchema, XsERedefine pRedefine)
          Handles xs:refefine.
 void setValidating(boolean pValidating)
          Sets whether the parser is validating.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSLogicalParser

public XSLogicalParser()
Method Detail

getData

protected XSContext getData()

setValidating

public void setValidating(boolean pValidating)

Sets whether the parser is validating.


isValidating

public boolean isValidating()

Returns whether the parser is validating.


getSchema

public XSSchema getSchema()

Returns the schema, which is currently being parsed.


parseSyntax

protected XsESchema parseSyntax(org.xml.sax.InputSource pSource)
                         throws org.xml.sax.SAXException,
                                java.io.IOException,
                                javax.xml.parsers.ParserConfigurationException
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

getInputSource

protected org.xml.sax.InputSource getInputSource(java.lang.String pReferencingSystemId,
                                                 XsAnyURI pURI)
                                          throws java.io.IOException

Converts the given URI into an instance of InputSource.

Throws:
java.io.IOException

redefine

protected void redefine(XsESchema pSyntaxSchema,
                        XsERedefine pRedefine,
                        XsRedefinable pChild)
                 throws org.xml.sax.SAXException

Redefines the given XsRedefinable.

Throws:
org.xml.sax.SAXException

add

protected void add(XsESchema pSyntaxSchema,
                   java.lang.Object pChild)
            throws org.xml.sax.SAXException

Adds the given object to the schema.

Throws:
org.xml.sax.SAXException

redefineSchema

protected void redefineSchema(XsESchema pRedefiningSchema,
                              XsERedefine pRedefine)
                       throws org.xml.sax.SAXException,
                              java.io.IOException,
                              javax.xml.parsers.ParserConfigurationException

Handles xs:refefine.

Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

includeSchema

protected void includeSchema(XsESchema pIncludingSchema,
                             XsEInclude pInclude)
                      throws org.xml.sax.SAXException,
                             java.io.IOException,
                             javax.xml.parsers.ParserConfigurationException

Handles xs:include.

Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

importSchema

protected void importSchema(XsESchema pImportingSchema,
                            XsEImport pImport)
                     throws org.xml.sax.SAXException,
                            java.io.IOException,
                            javax.xml.parsers.ParserConfigurationException

Handles xs:import.

Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException

parse

protected void parse(XsESchema pSyntaxSchema)
              throws javax.xml.parsers.ParserConfigurationException,
                     org.xml.sax.SAXException,
                     java.io.IOException

Parses the given InputSource syntactically and converts the objects that it finds into logical objects. These logical objects are added to the given XSSchema.

Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

parse

public XSSchema parse(org.xml.sax.InputSource pSource)
               throws javax.xml.parsers.ParserConfigurationException,
                      org.xml.sax.SAXException,
                      java.io.IOException

This is the logical parsers frontent. It parses the given InputSource. If the parsed schema includes or imports other schemas, they are also parsed and added to the parsers object tree.

Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

getSyntaxSchemas

public XsESchema[] getSyntaxSchemas()

Provides context information to the schema which is currently being parsed. The schema with index 0 is the outermost schema, on which the parser is actually invoked.


getCurrentSyntaxSchema

public XsESchema getCurrentSyntaxSchema()

Returns the syntax schema, which is currently being parsed.