public class SAXFilter extends Object implements ContentHandler, LexicalHandler
| Constructor and Description |
|---|
SAXFilter(ContentHandler contentHandler,
LexicalHandler lexicalHandler,
org.xml.sax.helpers.NamespaceSupport namespaces)
Construct a new SAXFilter such that the allowed events will be routed
to the corresponding content and lexical handlers.
|
| Modifier and Type | Method and Description |
|---|---|
SAXFilter |
allowCDATA()
Allow CDATA events
|
SAXFilter |
allowCharacters()
Allow character events
|
SAXFilter |
allowComments()
Allow comment events
|
SAXFilter |
allowDocumentLocators()
Allow document locator events
|
SAXFilter |
allowDocuments()
Allow start/end document events
|
SAXFilter |
allowDTDs()
Allow DTD events
|
SAXFilter |
allowElements()
allow start/end element events
|
SAXFilter |
allowElements(int minimumElementLevel)
Allow start/end element events.
|
SAXFilter |
allowEntities()
Allow XML entities events
|
SAXFilter |
allowIgnorableWhitespace()
Allow ignorable whitespace events
|
SAXFilter |
allowPrefixMappings()
allow start/end prefix mapping events
|
SAXFilter |
allowProcessingInstructions()
Allow processing instruction events
|
SAXFilter |
allowSkippedEntities()
Allow start / end events for skipped entities
|
void |
characters(char[] ch,
int start,
int length)
Character content.
|
void |
comment(char[] ch,
int start,
int length)
XML comment.
|
void |
endCDATA()
End of character data.
|
void |
endDocument()
End of the document.
|
void |
endDTD()
End of a DTD declaration.
|
void |
endElement(String uri,
String localName,
String qName)
End of an element.
|
void |
endEntity(String name)
End of an entity.
|
void |
endPrefixMapping(String prefix)
End of a prefix mapping.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Ignorable whitespace is recognized.
|
void |
processingInstruction(String target,
String data)
A processing instruction was parsed.
|
SAXFilter |
setDefaultNamespace(String uri)
Add a default namespace is none is provided.
|
void |
setDocumentLocator(Locator locator)
Supply a callback object for location awareness.
|
void |
skippedEntity(String name)
Recognize a skipped entity.
|
void |
startCDATA()
Start of character data.
|
void |
startDocument()
Start of the document.
|
void |
startDTD(String name,
String publicId,
String systemId)
Start of a DTD declaration.
|
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
Start of an element.
|
void |
startEntity(String name)
Start of an entity.
|
void |
startPrefixMapping(String prefix,
String uri)
A namespace prefix is declared.
|
public SAXFilter(ContentHandler contentHandler, LexicalHandler lexicalHandler, org.xml.sax.helpers.NamespaceSupport namespaces)
contentHandler - The SAX content handler.lexicalHandler - The SAX lexical handler.namespaces - Namespace support which records what prefixes have been defined.public SAXFilter allowDocuments()
public SAXFilter allowDocumentLocators()
public SAXFilter allowProcessingInstructions()
public SAXFilter allowPrefixMappings()
public SAXFilter allowElements()
public SAXFilter allowElements(int minimumElementLevel)
minimumElementLevel - the minimum level required.public SAXFilter allowIgnorableWhitespace()
public SAXFilter allowSkippedEntities()
public SAXFilter allowCharacters()
public SAXFilter allowDTDs()
public SAXFilter allowEntities()
public SAXFilter allowCDATA()
public SAXFilter allowComments()
public SAXFilter setDefaultNamespace(String uri)
uri - the default namespace uri.public void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXException - passed through.public void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXException - passed through.public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerlocator - the new locator.public void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlertarget - the processing instruction target.data - from the processing instruction.SAXException - passed through.public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerprefix - a tag prefix.uri - namespace indicated by the prefix.SAXException - passed through.public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerprefix - the name of the mapping.SAXException - passed through.public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandleruri - namespace of the element.localName - local name of the element.qName - qualified name of the element.atts - attributes of this instance of the element.SAXException - passed through.public void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandleruri - namespace of the element.localName - local name of the element.qName - qualified name of the element.SAXException - passed through.public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerch - content of the whitespace.start - starting position.length - length of the whitespace.SAXException - passed through.public void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlername - name of the entity.SAXException - passed through.public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerch - content characters.start - starting position.length - length of content.SAXException - passed through.public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlername - of the DTD.publicId - public identifier for the DTD.systemId - system identifier for the DTD.SAXException - passed through.public void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXException - passed through.public void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlername - of the entity.SAXException - passed through.public void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlername - of the entity.SAXException - passed throughpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXException - passed through.public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXException - passed through.public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerch - content of the comment.start - starting position.length - length of the comment.SAXException - passed through.Copyright © 2016 DuraSpace. All rights reserved.