| java.lang.Object net.n3.nanoxml.sax.SAXAdapter
SAXAdapter | public class SAXAdapter implements IXMLBuilder(Code) | | SAXAdapter is the core adapter for using NanoXML/Java with SAX, the "Simple"
API For XML.
See Also: net.n3.nanoxml.IXMLBuilder author: Marc De Scheemaecker version: $Name: RELEASE_2_2_1 $, $Revision: 1.4 $ |
Constructor Summary | |
public | SAXAdapter() Creates the adapter. |
Method Summary | |
public void | addAttribute(String key, String nsPrefix, String nsSystemId, String value, String type) This method is called when a new attribute of an XML element is
encountered. | public void | addPCData(Reader reader, String systemID, int lineNr) This method is called when a PCDATA element is encountered. | public void | elementAttributesProcessed(String name, String nsPrefix, String nsSystemId) This method is called when the attributes of an XML element have been
processed. | public void | endDocument() Indicates that parsing has been completed. | public void | endElement(String name, String nsPrefix, String nsSystemId) This method is called when the end of an XML elemnt is encountered. | protected void | finalize() Cleans up the object when it's destroyed. | public Object | getResult() Returns the result of the building process. | public void | newProcessingInstruction(String target, Reader reader) This method is called when a processing instruction is encountered. | public void | setDocumentHandler(DocumentHandler handler) Sets the document handler. | public void | setReader(IXMLReader reader) Sets the reader. | public void | startBuilding(String systemID, int lineNr) This method is called before the parser starts processing its input. | public void | startElement(String name, String nsPrefix, String nsSystemId, String systemID, int lineNr) This method is called when a new XML element is encountered. |
SAXAdapter | public SAXAdapter()(Code) | | Creates the adapter.
|
addAttribute | public void addAttribute(String key, String nsPrefix, String nsSystemId, String value, String type) throws Exception(Code) | | This method is called when a new attribute of an XML element is
encountered.
Parameters: key - the key (name) of the attribute Parameters: nsPrefix - the prefix used to identify the namespace Parameters: nsSystemId - the system ID associated with the namespace Parameters: value - the value of the attribute Parameters: type - the type of the attribute ("CDATA" if unknown) |
addPCData | public void addPCData(Reader reader, String systemID, int lineNr) throws Exception(Code) | | This method is called when a PCDATA element is encountered. A Java
reader is supplied from which you can read the data. The reader will
only read the data of the element. You don't need to check for
boundaries. If you don't read the full element, the rest of the data
is skipped. You also don't have to care about entities; they are
resolved by the parser.
Parameters: reader - the Java reader from which you can retrieve the data Parameters: systemID - the system ID of the data source Parameters: lineNr - the line in the source where the element starts throws: java.io.IOException - when the reader throws such exception |
elementAttributesProcessed | public void elementAttributesProcessed(String name, String nsPrefix, String nsSystemId) throws Exception(Code) | | This method is called when the attributes of an XML element have been
processed.
See Also: SAXAdapter.startElement See Also: SAXAdapter.addAttribute Parameters: name - the name of the element Parameters: nsPrefix - the prefix used to identify the namespace Parameters: nsSystemId - the system ID associated with the namespace |
endDocument | public void endDocument() throws Exception(Code) | | Indicates that parsing has been completed.
|
endElement | public void endElement(String name, String nsPrefix, String nsSystemId) throws Exception(Code) | | This method is called when the end of an XML elemnt is encountered.
See Also: SAXAdapter.startElement Parameters: name - the name of the element Parameters: nsPrefix - the prefix used to identify the namespace Parameters: nsSystemId - the system ID associated with the namespace |
finalize | protected void finalize() throws Throwable(Code) | | Cleans up the object when it's destroyed.
|
newProcessingInstruction | public void newProcessingInstruction(String target, Reader reader) throws Exception(Code) | | This method is called when a processing instruction is encountered.
PIs with target "xml" are handled by the parser.
Parameters: target - the PI target Parameters: reader - to read the data from the PI |
setDocumentHandler | public void setDocumentHandler(DocumentHandler handler)(Code) | | Sets the document handler.
Parameters: handler - the document handler |
setReader | public void setReader(IXMLReader reader)(Code) | | Sets the reader.
Parameters: reader - the reader. |
startBuilding | public void startBuilding(String systemID, int lineNr) throws Exception(Code) | | This method is called before the parser starts processing its input.
Parameters: systemID - the system ID of the data source Parameters: lineNr - the line on which the parsing starts |
startElement | public void startElement(String name, String nsPrefix, String nsSystemId, String systemID, int lineNr) throws Exception(Code) | | This method is called when a new XML element is encountered.
See Also: SAXAdapter.endElement Parameters: name - the name of the element Parameters: nsPrefix - the prefix used to identify the namespace Parameters: nsSystemId - the system ID associated with the namespace Parameters: systemID - the system ID of the data source Parameters: lineNr - the line in the source where the element starts |
|
|