Package org.apache.commons.jelly.parser
Class DefaultNamespaceFilter
- java.lang.Object
-
- org.xml.sax.helpers.XMLFilterImpl
-
- org.apache.commons.jelly.parser.DefaultNamespaceFilter
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,XMLFilter
,XMLReader
public class DefaultNamespaceFilter extends XMLFilterImpl
XMLFilter that can provide a default namespace when one has not been declared by the XML document. Note: this class does not address the namespace of attributes.- Author:
- Morgan Delagrange
-
-
Field Summary
Fields Modifier and Type Field Description protected String
uriDefault
-
Constructor Summary
Constructors Constructor Description DefaultNamespaceFilter(String defaultNamespace, XMLReader reader)
Filter for undefined an undefined namespace
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endElement(String namespaceURI, String localName, String qName)
All incoming empty URIs will be remapped to the default.void
startElement(String uri, String localName, String qName, Attributes atts)
All incoming empty URIs will be remapped to the default.void
startPrefixMapping(String prefix, String uri)
All incoming empty URIs will be remapped to the default.-
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
uriDefault
protected String uriDefault
-
-
Method Detail
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
All incoming empty URIs will be remapped to the default.- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classXMLFilterImpl
- Parameters:
prefix
- incoming prefixuri
- URI to check and potentially replace- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
All incoming empty URIs will be remapped to the default.- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classXMLFilterImpl
- Parameters:
uri
- URI to check and potentially replacelocalName
-qName
-atts
-- Throws:
SAXException
-
endElement
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
All incoming empty URIs will be remapped to the default.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classXMLFilterImpl
- Parameters:
namespaceURI
- URI to check and potentially replacelocalName
-qName
-- Throws:
SAXException
-
-