|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--net.chaosserver.bilbo.data.DirectoryHandler
A Sax helper customized to read in the Xml representation of a Directory object.
Field Summary | |
protected Directory |
directory
Holds the directory currently being read in. |
protected Stack |
directoryStack
Stack of directories to allow for child mappings. |
protected String |
encoding
Indicates type of encoding to try. |
protected FilenameMapping |
filenameMapping
Holds the FilenameMapping currently being read in. |
protected Name |
name
Holds the Name currently being read in. |
Constructor Summary | |
DirectoryHandler()
Default constructor. |
|
DirectoryHandler(String encoding)
Creates a directory handler that will generate strings in given encoding. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Called when character strings are reached. |
void |
endDocument()
Destroyes the directory stack when the document is done. |
void |
endElement(String uri,
String localName,
String qName)
Called at the end of an element. |
protected Directory |
getDirectory()
Getter for the Directory object generated by this handler. |
void |
startDocument()
Creates a new stack to hold the directories. |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
Called at the start of an element. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Stack directoryStack
protected Directory directory
protected FilenameMapping filenameMapping
protected Name name
protected String encoding
Constructor Detail |
public DirectoryHandler()
public DirectoryHandler(String encoding)
encoding
- the encoding to generate the String objects in.Method Detail |
public void startDocument()
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
public void endDocument()
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
protected Directory getDirectory()
This method should be called after the handler has been used against an Xml document containing a directory.
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
uri
- the uri of the tag coming backlocalName
- the localname of the tag coming backqName
- this is the name it is processing against.attributes
- attributes associated with the open tag
SAXException
- if there is an error processing.public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
ch
- the character array of the xml filestart
- the start of the current sequencelength
- the length of the current sequence
SAXException
- if there is an error processing.public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
uri
- the uri of the tag coming backlocalName
- the localname of the tag coming backqName
- this is the name it is processing against.
SAXException
- if there is an error processing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |