Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

au.edu.educationau.belts.bootstrap.school
Class TypeContentHandler  view TypeContentHandler download TypeContentHandler.java

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byau.edu.educationau.belts.bootstrap.school.TypeContentHandler
All Implemented Interfaces:
au.edu.educationau.belts.bootstrap.BELTSEntityContentHandler, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class TypeContentHandler
extends org.xml.sax.helpers.DefaultHandler
implements au.edu.educationau.belts.bootstrap.BELTSEntityContentHandler

This class performs the action of parsing XML for a type and creating the type, based on the input XML

Version:
$Revision: 1.6 $ - $Date: 2003/04/16 02:42:56 $

Field Summary
private  au.edu.educationau.belts.container.BELTSContainer _container
           
private  java.lang.StringBuffer _currElement
           
private  au.edu.educationau.belts.model.school.TypeEntity _currType
           
 
Constructor Summary
TypeContentHandler(au.edu.educationau.belts.container.BELTSContainer container)
          Constructor supplying the BELTS Container
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receive notification of character data.
static au.edu.educationau.belts.model.school.TypeEntity createType(au.edu.educationau.belts.container.BELTSContainer container, org.xml.sax.Attributes atts)
           
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
          Receive notification of the end of an element.
 java.lang.String getNamespace()
           
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Receive notification of the beginning of an element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
 

Field Detail

_currElement

private java.lang.StringBuffer _currElement

_container

private au.edu.educationau.belts.container.BELTSContainer _container

_currType

private au.edu.educationau.belts.model.school.TypeEntity _currType
Constructor Detail

TypeContentHandler

public TypeContentHandler(au.edu.educationau.belts.container.BELTSContainer container)
Constructor supplying the BELTS Container

Method Detail

getNamespace

public java.lang.String getNamespace()
Specified by:
getNamespace in interface au.edu.educationau.belts.bootstrap.BELTSEntityContentHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ContentHandler
Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

The application must not attempt to read from the array outside of the specified range.

Individual characters may consist of more than one Java char value. There are two important cases where this happens, because characters can't be represented in just sixteen bits. In one case, characters are represented in a Surrogate Pair, using two special Unicode values. Such characters are in the so-called "Astral Planes", with a code point above U+FFFF. A second case involves composite characters, such as a base character combining with one or more accent characters.

Your code should not assume that algorithms using char-at-a-time idioms will be working in character units; in some cases they will split characters. This is relevant wherever XML permits arbitrary characters, such as attribute values, processing instruction data, and comments as well as in data reported from this method. It's also generally relevant whenever Java code manipulates internationalized text; the issue isn't unique to XML.

Note that some parsers will report whitespace in element content using the ignorableWhitespace 55 method rather than this one (validating parsers must do so).

Specified by:
characters in interface org.xml.sax.ContentHandler

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ContentHandler
Receive notification of the end of an element.

The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement 55 event for every endElement event (even when the element is empty).

For information on the names, see startElement.

Specified by:
endElement in interface org.xml.sax.ContentHandler

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ContentHandler
Receive notification of the beginning of an element.

The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement 55 event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.

This event allows up to three name components for each element:

  1. the Namespace URI;
  2. the local name; and
  3. the qualified (prefixed) name.

Any or all of these may be provided, depending on the values of the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes properties:

  • the Namespace URI and local name are required when the namespaces property is true (the default), and are optional when the namespaces property is false (if one is specified, both must be);
  • the qualified name is required when the namespace-prefixes property is true, and is optional when the namespace-prefixes property is false (the default).

Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted. The attribute list will contain attributes used for Namespace declarations (xmlns* attributes) only if the http://xml.org/sax/features/namespace-prefixes property is true (it is false by default, and support for a true value is optional).

Like characters() 55 , attribute values may have characters that need more than one char value.

Specified by:
startElement in interface org.xml.sax.ContentHandler

createType

public static au.edu.educationau.belts.model.school.TypeEntity createType(au.edu.educationau.belts.container.BELTSContainer container,
                                                                          org.xml.sax.Attributes atts)
                                                                   throws org.xml.sax.SAXException