com.metamatrix.common.xml.xmi
Class XMIHeaderContentHandler

java.lang.Object
  extended by com.metamatrix.common.xml.xmi.XMIHeaderContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler

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


Constructor Summary
XMIHeaderContentHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          This will report character data (within an element).
protected  void checkHeader()
           
 void complete()
          This method is called after the end tag for the XMI header is encountered, and allows the subclass to provide specific behavior if necessary.
 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 qName)
          Indicates the end of an element (</[element name]>) is reached.
 void endPrefixMapping(java.lang.String prefix)
           This will add the prefix mapping to the XMIHeader object.
 XMIHeader getHeader()
          Return the XMI Header for this content handler.
 void ignorableWhitespace(char[] ch, int start, int length)
          Capture ignorable whitespace as text.
 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 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 uri, java.lang.String localName, java.lang.String qName, 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 add the prefix mapping to the XMIHeader object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMIHeaderContentHandler

public XMIHeaderContentHandler()
                        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

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

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:
SAXException - when things go wrong
org.xml.sax.SAXException

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:
SAXException - when things go wrong
org.xml.sax.SAXException

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 - StringThrows:
org.xml.sax.SAXException - when things go wrong

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
This will add the prefix mapping to the XMIHeader object.

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - String namespace prefix.
uri - String namespace URI.
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException

This will add the prefix mapping to the XMIHeader object.

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - String namespace prefix.
uri - String namespace URI.
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         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:
uri - String namespace URI this element is associated with, or an empty String
localName - String name of element (with no namespace prefix, if one is present)
qName - String XML 1.0 version of element name: [namespace prefix]:[localName]
atts - Attributes list for this element
Throws:
org.xml.sax.SAXException - when things go wrong

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Capture ignorable whitespace as text. If setIgnoringElementContentWhitespace(true) has been called then this method does nothing.

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Parameters:
ch - [] - char array of ignorable whitespace
start - int - starting position within array
length - int - length of whitespace after start
Throws:
org.xml.sax.SAXException - when things go wrong

characters

public void characters(char[] ch,
                       int start,
                       int length)
                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.
length - int length of data.
Throws:
org.xml.sax.SAXException - when things go wrong

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                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 - String URI of namespace this element is associated with
localName - String name of element without prefix
qName - String name of element in XML 1.0 form
Throws:
org.xml.sax.SAXException - when things go wrong

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:
SAXException - when things go wrong
org.xml.sax.SAXException

getHeader

public XMIHeader getHeader()
Return the XMI Header for this content handler.


complete

public void complete()
              throws org.xml.sax.SAXException
This method is called after the end tag for the XMI header is encountered, and allows the subclass to provide specific behavior if necessary. This implementation does nothing by default.

Throws:
org.xml.sax.SAXException

checkHeader

protected void checkHeader()
                    throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException


Copyright © 2009. All Rights Reserved.