org.ipdr.common
Class SchemaContentHandler

java.lang.Object
  extended by org.ipdr.common.SchemaContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler

public class SchemaContentHandler
extends java.lang.Object
implements org.xml.sax.ContentHandler

SchemaContentHandler class implements the SAX ContentHandler interface and defines callback behavior for the SAX callbacks associated with a Schema file.


Field Summary
protected  boolean attribDescFlag_
          Flag indicating whether attribute description is present.
protected  CompositeSchemaElement baseElement_
          To store the Base Schema's covering element.
protected  boolean baseSchema_
          Flag indicating Base Schema.
protected  boolean compositeFlag_
          Flag indicating start of composite element.
protected  CompositeSchemaElement compSchemaElement_
          CompositeSchemaElement object being processed.
protected  boolean enumDocSet_
          Flag indicating Enumeration Documentation.
protected  boolean enumFlag_
          Flag indicating whether Enumeration is present for an attribute.
protected  boolean enumMeaning_
          Flag indicating whether ipdr:enumMeaning is present for an attribute.
protected  java.lang.String enumValue_
          String to store the a Enumeration value.
protected  java.util.ArrayList enumValues_
          ArrayList to store the list Enumeration values.
protected  java.lang.String extensionBase_
          String containing the extension base.
static java.lang.String IPDR_DOC_TAG
          String to represent IPDR Doc Tag
static java.lang.String IPDR_SETTLE_TAG
          String to represent IPDR Settlement Doc Tag
protected  java.util.ArrayList listSchemaElements_
          ArrayList to store the list of Schema Elements.
protected  java.util.ArrayList listServiceElements_
          ArrayList to store the list of Service Elements.
protected  org.xml.sax.Locator locator_
          Locator object containing the location information.
protected  boolean referenceFlag_
          Flag indicating whether ipdr:refernce is present for an attribute.
protected  SchemaElement schemaElement_
          SchemaElement object being processed.
protected  java.util.ArrayList schemaLocation_
          ArrayList containing the list of schemas location of the schema file.
protected  java.lang.String schemaVersion_
          String containing the IPDR Version
protected  boolean serviceFlag_
          Flag indicating start of serivice list.
protected  java.lang.String serviceType_
          String containing the the ServiceType in a Schema.
protected  boolean startDocumentFlag_
          Flag indicating start of Document.
protected  boolean startTagFlag_
          Flag indicating start of tag.
protected  boolean statusFlag_
          Flag indicating whether ipdr:status is present for an attribute.
protected  java.lang.String targetNameSpace_
          String containing the Target Namespace for a Schema.
protected  java.util.ArrayList totalListServiceElements_
          ArrayList to store the total list of Service Elements.
protected  boolean unitFlag_
          Flag indicating whether ipdr:unit is present for an attribute.
 
Constructor Summary
SchemaContentHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int end)
          This will report character data (within an element).
 void endDocument()
          This indicates the end of a Document parse - this occurs after all callbacks in all SAX Handlers.
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName)
          Indicates the end of an element (</[element name]>) is reached.
 void endPrefixMapping(java.lang.String prefix)
          This indicates the end of a prefix mapping, when the namespace reported in a startPrefixMapping(java.lang.String, java.lang.String)callback is no longer available.
 boolean getBaseSchemaFlag()
          Method to get flag indicating if Base Schema.
 java.lang.String getExtensionBase()
          Method to get the value of Extension Base.
 java.lang.String getNameSpaceURI()
          Method to get the value of Target Namespace.
 java.util.ArrayList getParsedElements()
          Method to get the list of parsed Elements.
 java.util.ArrayList getSchemaLocation()
          Method to get the list of schema locations.
 java.lang.String getSchemaVersion()
          Method to get the value of Schema Version.
 java.lang.String getServiceType()
          Method to get the value of Service Type.
 void ignorableWhitespace(char[] ch, int start, int end)
          This will report whitespace that can be ignored in the originating document.
 void processingInstruction(java.lang.String target, java.lang.String data)
          This will indicate that a processing instruction (other than the XML declaration) has been encountered.
 void setBaseSchemaFlag(boolean flag)
          Method to set flag indicating if Base Schema.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Provide reference to Locator which provides information about where in a document callbacks occur.
 void skippedEntity(java.lang.String name)
          This will report an entity that is skipped by the parser.
 void startDocument()
          This indicates the start of a Document parse - this precedes all callbacks in all SAX Handlers with the sole exception of setDocumentLocator(org.xml.sax.Locator)>
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes atts)
          This reports the occurrence of an actual element.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          This will indicate the beginning of an XML Namespace prefix mapping.
 
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_
Locator object containing the location information.


schemaLocation_

protected java.util.ArrayList schemaLocation_
ArrayList containing the list of schemas location of the schema file.


serviceType_

protected java.lang.String serviceType_
String containing the the ServiceType in a Schema.


targetNameSpace_

protected java.lang.String targetNameSpace_
String containing the Target Namespace for a Schema.


extensionBase_

protected java.lang.String extensionBase_
String containing the extension base.


schemaVersion_

protected java.lang.String schemaVersion_
String containing the IPDR Version


schemaElement_

protected SchemaElement schemaElement_
SchemaElement object being processed.


compSchemaElement_

protected CompositeSchemaElement compSchemaElement_
CompositeSchemaElement object being processed.


baseElement_

protected CompositeSchemaElement baseElement_
To store the Base Schema's covering element.


listSchemaElements_

protected java.util.ArrayList listSchemaElements_
ArrayList to store the list of Schema Elements.


listServiceElements_

protected java.util.ArrayList listServiceElements_
ArrayList to store the list of Service Elements.


enumValues_

protected java.util.ArrayList enumValues_
ArrayList to store the list Enumeration values.


enumValue_

protected java.lang.String enumValue_
String to store the a Enumeration value.


enumDocSet_

protected boolean enumDocSet_
Flag indicating Enumeration Documentation.


enumMeaning_

protected boolean enumMeaning_
Flag indicating whether ipdr:enumMeaning is present for an attribute.


unitFlag_

protected boolean unitFlag_
Flag indicating whether ipdr:unit is present for an attribute.


statusFlag_

protected boolean statusFlag_
Flag indicating whether ipdr:status is present for an attribute.


referenceFlag_

protected boolean referenceFlag_
Flag indicating whether ipdr:refernce is present for an attribute.


attribDescFlag_

protected boolean attribDescFlag_
Flag indicating whether attribute description is present.


enumFlag_

protected boolean enumFlag_
Flag indicating whether Enumeration is present for an attribute.


startTagFlag_

protected boolean startTagFlag_
Flag indicating start of tag.


serviceFlag_

protected boolean serviceFlag_
Flag indicating start of serivice list.


compositeFlag_

protected boolean compositeFlag_
Flag indicating start of composite element.


startDocumentFlag_

protected boolean startDocumentFlag_
Flag indicating start of Document.


totalListServiceElements_

protected java.util.ArrayList totalListServiceElements_
ArrayList to store the total list of Service Elements.


baseSchema_

protected boolean baseSchema_
Flag indicating Base Schema.


IPDR_DOC_TAG

public static final java.lang.String IPDR_DOC_TAG
String to represent IPDR Doc Tag

See Also:
Constant Field Values

IPDR_SETTLE_TAG

public static final java.lang.String IPDR_SETTLE_TAG
String to represent IPDR Settlement Doc Tag

See Also:
Constant Field Values
Constructor Detail

SchemaContentHandler

public SchemaContentHandler()
Method Detail

setBaseSchemaFlag

public void setBaseSchemaFlag(boolean flag)
Method to set flag indicating if Base Schema.

Parameters:
flag - Boolean indication if Base Schema

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Provide reference to Locator which provides information about where in a document callbacks occur.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Parameters:
locator - Locator object tied to callback process

getBaseSchemaFlag

public boolean getBaseSchemaFlag()
Method to get flag indicating if Base Schema.

Returns:
Boolean indication if Base Schema

getSchemaLocation

public java.util.ArrayList getSchemaLocation()
Method to get the list of schema locations.

Returns:
List of schema locations

getServiceType

public java.lang.String getServiceType()
Method to get the value of Service Type.

Returns:
The Service Type

getNameSpaceURI

public java.lang.String getNameSpaceURI()
Method to get the value of Target Namespace.

Returns:
The Target NameSpace

getExtensionBase

public java.lang.String getExtensionBase()
Method to get the value of Extension Base.

Returns:
The Extension Base

getSchemaVersion

public java.lang.String getSchemaVersion()
Method to get the value of Schema Version.

Returns:
The Schema Version

getParsedElements

public java.util.ArrayList getParsedElements()
Method to get the list of parsed Elements.

Returns:
The list of parsed Elements

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
This indicates the start of a Document parse - this precedes all callbacks in all SAX Handlers with the sole exception of setDocumentLocator(org.xml.sax.Locator)>

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
This indicates the end of a Document parse - this occurs after all callbacks in all SAX Handlers.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
This will indicate that a processing instruction (other than the XML declaration) has been encountered.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Parameters:
target - String target of PI
data - String containing all data sent to the PI. This typically looks like one or more attribute value pairs.
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
This will indicate the beginning of an XML Namespace prefix mapping. Although this typically occur within the root element of an XML document, it can occur at any point within the document. Note that a prefix mapping on an element triggers this callback before the callback for the actual element itself (startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)) occurs.

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - String prefix used for the namespace being reported
uri - String URI for the namespace being reported

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
This indicates the end of a prefix mapping, when the namespace reported in a startPrefixMapping(java.lang.String, java.lang.String)callback is no longer available.

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - String of namespace being reported

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String rawName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
This reports the occurrence of an actual element. It will include the element's attributes, with the exception of XML vocabulary specific attributes, such as xmlns:[namespace prefix] and xsi:schemaLocation

Specified by:
startElement in interface org.xml.sax.ContentHandler
Parameters:
namespaceURI - Namespace URI this element is associated with, or an empty string
localName - String XML 1.0 version of element name: [namespace prefix]:[localName]
rawName - String name of element (with no namespace prefix, if one is present)
atts - Attributes list for this element
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String rawName)
                throws org.xml.sax.SAXException
Indicates the end of an element (</[element name]>) is reached. Note that the parser does not distinguish between empty elements and non-empty elements, so this will occur uniformly.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Parameters:
namespaceURI - URI of namespace this element is associated with
localName - String name of element in XML 1.0 form
rawName - String name of element without prefix
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing

characters

public void characters(char[] ch,
                       int start,
                       int end)
                throws org.xml.sax.SAXException
This will report character data (within an element).

Specified by:
characters in interface org.xml.sax.ContentHandler
Parameters:
ch - char[] character array with character data
start - int index in array where data starts.
end - int index in array where data ends.
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int end)
                         throws org.xml.sax.SAXException
This will report whitespace that can be ignored in the originating document. This is typically only invoked when validation is ocurring in the parsing process.

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Parameters:
ch - char[] character array with character data
start - int index in array where data starts.
end - int index in array where data ends.
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
This will report an entity that is skipped by the parser. This should only occur for non-validating parsers, and then is still implementation-dependent behavior.

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Parameters:
name - String name of entity being skipped
Throws:
org.xml.sax.SAXException - when an exception occurs during the parsing