org.openanzo.util.properties
Class PropertiesDefinitionParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.openanzo.util.properties.PropertiesDefinitionParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class PropertiesDefinitionParser
extends org.xml.sax.helpers.DefaultHandler

PropertiesDefintionParser handles the parsed results of a properties definition file.

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Nested Class Summary
 class PropertiesDefinitionParser.Description
          Representation of a description value
 class PropertiesDefinitionParser.Example
          Representation of an Example
 class PropertiesDefinitionParser.Property
          Class representing a Property
 class PropertiesDefinitionParser.PropertyGroup
          Class representing a group of properties that get combined into a class
static class PropertiesDefinitionParser.PropType
          Types of property values
 class PropertiesDefinitionParser.Tag
          Representation of a tag value
static class PropertiesDefinitionParser.Type
          Types of examples and descriptions
 
Constructor Summary
PropertiesDefinitionParser()
           
 
Method Summary
static java.lang.String capFirstLetter(java.lang.String value)
          Capitalize the first Letter of a string, and the first letter following a .
 void characters(char[] ch, int start, int length)
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
           
 PropertiesDefinitionParser.PropertyGroup getGroup()
          Get the PropertyGroup for this parser
 java.util.ArrayList<PropertiesDefinitionParser.PropertyGroup> getGroups()
          Get the set of property groups that were parsed
static java.lang.String replaceDots(java.lang.String value)
          Replace all '.', and capitalize the letters following the '.'s.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attributes)
           
 
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesDefinitionParser

public PropertiesDefinitionParser()
Method Detail

capFirstLetter

public static java.lang.String capFirstLetter(java.lang.String value)
Capitalize the first Letter of a string, and the first letter following a .

Parameters:
value -
Returns:
new string where first Letter of the string is capitalized, as well the any letter following a .

replaceDots

public static java.lang.String replaceDots(java.lang.String value)
Replace all '.', and capitalize the letters following the '.'s.

Parameters:
value -
Returns:
new string where any letter following a '.' is capitalized.

getGroup

public PropertiesDefinitionParser.PropertyGroup getGroup()
Get the PropertyGroup for this parser

Returns:
the PropertyGroup for this parser

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String name)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler

getGroups

public java.util.ArrayList<PropertiesDefinitionParser.PropertyGroup> getGroups()
Get the set of property groups that were parsed

Returns:
the set of property groups that were parsed


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.