|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sundog.hoople.BaseParser
The base class that all Hoople Parsers must extend from. It can be used on both a compile-time ant setting or at run time. It works like a SAXParser, but with less configuration needed.
As URLConfigParser is parsing a file, keeps track of which BaseParsers is interested in a particular section of the XML file. So, for example, the StrutsParser will only have methods called on it in the <struts> section. When the URLConfigParser is parsing a section of the XML that a BaseParser is interested in, it will call startElement and endElement as it gets to the beginning and end of each element.
| Constructor Summary | |
protected |
BaseParser(java.lang.String configSectionParentTagName)
Pass the name of the tag that determines when this parser should start having startElement and endElement methods called. |
| Method Summary | |
protected java.lang.String |
convertToAbsolutePath(java.io.File relativeTo,
java.lang.String path)
Return the absolute url of the given path. |
abstract void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
java.lang.String elementText,
java.io.File file,
java.io.File documentRoot)
Override this method with things to do when the URLConfigParser finds the end of an element and isActive() returns true. |
javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
|
URLConfigParser |
getUrlConfigurationParser()
|
boolean |
isActive()
|
protected void |
setActive(boolean active)
|
void |
setActive(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
Called at the start and end of all tags to let this parser opt-in or out of having its startElelment and endElement methods called. |
void |
setDocumentBuilder(javax.xml.parsers.DocumentBuilder documentBuilder)
|
void |
setUrlConfigurationParser(URLConfigParser UrlConfigParser)
|
abstract void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes,
java.io.File urlConfigFile,
java.io.File documentRoot)
Override this method with things to do when the URLConfigParser finds the start of an element and isActive() returns true. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected BaseParser(java.lang.String configSectionParentTagName)
| Method Detail |
public URLConfigParser getUrlConfigurationParser()
public void setUrlConfigurationParser(URLConfigParser UrlConfigParser)
public javax.xml.parsers.DocumentBuilder getDocumentBuilder()
public void setDocumentBuilder(javax.xml.parsers.DocumentBuilder documentBuilder)
public abstract void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes,
java.io.File urlConfigFile,
java.io.File documentRoot)
throws org.xml.sax.SAXException,
java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public abstract void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
java.lang.String elementText,
java.io.File file,
java.io.File documentRoot)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected java.lang.String convertToAbsolutePath(java.io.File relativeTo,
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic boolean isActive()
protected void setActive(boolean active)
public void setActive(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||