org.jboss.seam.faces.projectstage
Class WebXmlContextParameterParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.jboss.seam.faces.projectstage.WebXmlContextParameterParser
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
public class WebXmlContextParameterParser
- extends DefaultHandler
Simple SAX parser for reading "context-param" entries from web.xml
- Author:
- Christian Kaltepoth
| 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 |
WebXmlContextParameterParser
public WebXmlContextParameterParser()
parse
public final void parse(InputStream stream)
throws IOException
- Parses the supplied web.xml
InputStream.
- Parameters:
stream - The stream to parse
- Throws:
IOException - for any errors during the parsing process
getContextParameter
public String getContextParameter(String name)
- Returns the value of the supplied context parameter parsed from the web.xml file. Returns
null if the parser
found no value for this parameter.
- Parameters:
name - The name of the context parameter
- Returns:
- the value or
null
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
- Specified by:
startElement in interface ContentHandler- Overrides:
startElement in class DefaultHandler
- Throws:
SAXException
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
- Specified by:
characters in interface ContentHandler- Overrides:
characters in class DefaultHandler
- Throws:
SAXException
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
- Specified by:
endElement in interface ContentHandler- Overrides:
endElement in class DefaultHandler
- Throws:
SAXException
elements
protected boolean elements(String... name)
- Checks whether the element stack currently contains exactly the elements supplied by the caller. This method can be used
to find the current position in the document. The first argument is always the root element of the document, the second
is a child of the root element, and so on. The method uses the local names of the elements only. Namespaces are ignored.
- Parameters:
name - The names of the parent elements
- Returns:
true if the parent element stack contains exactly these elements
Copyright © 2009-2011 Seam Framework. All Rights Reserved.