|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--com.objectwave.templateMerge.XMLTemplateRead
This class is used to read the XML file and translate it into KnownTemplates
Nested Class Summary | |
static class |
XMLTemplateRead.Test
Unit Test |
Constructor Summary | |
XMLTemplateRead()
Constructor with no parameters. |
|
XMLTemplateRead(java.io.Reader input)
Constructor |
|
XMLTemplateRead(java.lang.String uri)
Constructor |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
This method will read the characters in an XML document. |
void |
endElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw)
This method will parse the collection in an XML document. |
protected java.util.Vector |
getBody(java.lang.String body)
read a string line by line and write them into a vector |
KnownTemplates |
getTemplates()
Get the KnowTemplates which has all information in the XML file |
protected InformationToken[] |
getTokens(java.lang.String token)
read a String line by line and get the token array according the token name |
protected void |
initialize()
|
protected void |
parse(org.xml.sax.InputSource uri)
Parse the XML |
protected void |
parse(java.lang.String uri)
Parse the XML |
protected void |
setPostTemplate()
set the post part for the current template |
protected void |
setPreTemplate()
set the pre part for the current template |
protected void |
setSubTemplate()
set the sub templates for the current template |
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String raw,
org.xml.sax.Attributes attrs)
This method will parse a single element in an XML document. |
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 |
Constructor Detail |
public XMLTemplateRead()
public XMLTemplateRead(java.lang.String uri) throws ConfigurationException
uri
- String the XML file name
ConfigurationException
public XMLTemplateRead(java.io.Reader input) throws ConfigurationException
input
- Reader
ConfigurationException
Method Detail |
protected void setPreTemplate()
protected void setPostTemplate()
protected void setSubTemplate()
public KnownTemplates getTemplates()
protected InformationToken[] getTokens(java.lang.String token) throws java.io.IOException
token
- String the string to be read
java.io.IOException
protected java.util.Vector getBody(java.lang.String body) throws java.io.IOException
body
- String the string to be read
java.io.IOException
protected void initialize()
public void startElement(java.lang.String uri, java.lang.String local, java.lang.String raw, org.xml.sax.Attributes attrs)
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- String The Namespace URIlocal
- String The local name (without prefix)raw
- String The raw XML 1.0 name (with prefix)attrs
- Attributes The attributes attached to the element.public void endElement(java.lang.String uri, java.lang.String local, java.lang.String raw)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
uri
- String The Namespace URIlocal
- String The local name (without prefix)raw
- String The raw XML 1.0 name (with prefix)public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ch
- char array The characters from the XML document.start
- integer The start position in the array.length
- integer The number of characters to read from the arrayprotected void parse(java.lang.String uri) throws ConfigurationException
uri
- The XML file name
ConfigurationException
- If any error happen in the XML file
processingprotected void parse(org.xml.sax.InputSource uri) throws ConfigurationException
uri
- The input source of the XML data.
ConfigurationException
- If any error happen in the XML file
processing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |