|
Arch4J 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.xml.sax.helpers.DefaultHandler
|
+--org.arch4j.property.XMLPropertyReader
This class is used to parse (read) an XML-based property file.
JAXP and SAX parsing is configured locally, so there is no dependence on other frameworks until property management (of which this class is a part) is fully started.
A non-validating parser is used; the property file format is simple enough to validate each property on the fly. In the future a DTD could be written and the file validated against it while parsing.
| Field Summary |
| Fields inherited from interface org.arch4j.property.PropertyConstants |
ADD_STRING, BOOLEAN_CHAR, BOOLEAN_NAME, CHAR_CHAR, CHAR_NAME, DEFAULT_DOMAIN_NAME, DOMAIN_CHAR, DOMAIN_TAG_NAME, DOUBLE_CHAR, DOUBLE_NAME, EMPTY_STRING, FALSE_STRING, FLOAT_CHAR, FLOAT_NAME, INT_CHAR, INT_NAME, KEY_CHAR, KEY_TAG_NAME, LONG_CHAR, LONG_NAME, NAME_CHAR, NAME_TAG_NAME, PROPERTY_CHAR, PROPERTY_TAG_NAME, STRING_CHAR, STRING_NAME, TOP_LEVEL_CHAR, TOP_LEVEL_TAG_NAME, TRUE_STRING, TYPE_CHAR, TYPE_TAG_NAME, VALUE_CHAR, VALUE_TAG_NAME, XML_DECLARATION |
| Constructor Summary | |
XMLPropertyReader(Map properties,
File propertyFile)
Constructs a XMLPropertyReader, which will be used to parse
the given property file into the property map. |
|
| Method Summary | |
void |
endElement(String uri,
String localName,
String qName)
Receive notification of the end of an element. |
void |
load()
Parse and load the properties. |
void |
startElement(String uri,
String localName,
String qName,
org.xml.sax.Attributes attributes)
Receive notification of the start of an element. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, 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 |
| Constructor Detail |
public XMLPropertyReader(Map properties,
File propertyFile)
XMLPropertyReader, which will be used to parse
the given property file into the property map.
properties - The property map to fill in.propertyFile - The XML property file to parse.| Method Detail |
public void load()
public void startElement(String uri,
String localName,
String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandleruri - The namespace URIlocalName - The element type name.qName - The qualified name.attributes - The specified or defaulted attributes.
org.xml.sax.SAXException - Any SAX exception, possibly
wrapping another exception.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(String uri,
String localName,
String qName)
throws org.xml.sax.SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandleruri - The namespace URIlocalName - The element type name.qName - The qualified name.
org.xml.sax.SAXException - Any SAX exception, possibly
wrapping another exception.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
|
Arch4J 1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||