Package org.ametys.runtime.util
Class MapHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.ametys.runtime.util.MapHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
This class is intended to be use as a simple helper to construct Maps from
SAX events.
The incoming SAX document must follow this structure :
<root>
<Name1>value1</Name1>
<Name2>value2</Name2>
...
</root>
Each pair Name/Value will be put (as Strings) in the constructed Map
The incoming SAX document must follow this structure :
<root>
<Name1>value1</Name1>
<Name2>value2</Name2>
...
</root>
Each pair Name/Value will be put (as Strings) in the constructed Map
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidendElement(String uri, String localName, String qName) voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
MapHandler
Create a map handler- Parameters:
map- Map to fill
-
-
Method Details
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-