|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.app.xmlui.objectmanager.SAXFilter
public class SAXFilter
This is a Swiss army like SAX Filter, its purpose is to filter out undesirable SAX events from the stream. The primary application of this is for inserting SAX fragment into an existing SAX pipeline, under this scenario you would not want new startDocument or endDocument events interfering with the existing pipeline thus this class can filter those out. The Swiss army part comes in because it's configurable. Instead of defining a static set of events that are filled out by default all events are filled out and must be turned on to allow each type Individually. Primarily you can filter events based upon their type, i.e. start/end elements or start/end documents. However there is one special control, and that is to only allow elements below a minimum level. .
| Constructor Summary | |
|---|---|
SAXFilter(ContentHandler contentHandler,
LexicalHandler lexicalHandler,
NamespaceSupport namespaces)
Construct a new SAXFilter such that the allowed events will be routed to the corresponding content and lexical handlers. |
|
| Method Summary | |
|---|---|
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)
|
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
endEntity(String name)
|
void |
endPrefixMapping(String prefix)
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
processingInstruction(String target,
String data)
|
SAXFilter |
setDefaultNamespace(String uri)
Add a default namespace is none is provided. |
void |
setDocumentLocator(Locator locator)
|
void |
skippedEntity(String name)
|
void |
startCDATA()
|
void |
startDocument()
SAX Content events |
void |
startDTD(String name,
String publicId,
String systemId)
SAX Lexical events |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
|
void |
startEntity(String name)
|
void |
startPrefixMapping(String prefix,
String uri)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SAXFilter(ContentHandler contentHandler,
LexicalHandler lexicalHandler,
NamespaceSupport namespaces)
contentHandler - The SAX content handler.lexicalHandler - The SAX lexical handler.namespaces - Namespace support which records what prefixes have been defined.| Method Detail |
|---|
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
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandler
public void processingInstruction(String target,
String data)
throws SAXException
processingInstruction in interface ContentHandlerSAXException
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerSAXException
public void endPrefixMapping(String prefix)
throws SAXException
endPrefixMapping in interface ContentHandlerSAXException
public void startElement(String uri,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerSAXException
public void endElement(String uri,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerSAXException
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXException
public void skippedEntity(String name)
throws SAXException
skippedEntity in interface ContentHandlerSAXException
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXException
public void startDTD(String name,
String publicId,
String systemId)
throws SAXException
startDTD in interface LexicalHandlerSAXException
public void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXException
public void startEntity(String name)
throws SAXException
startEntity in interface LexicalHandlerSAXException
public void endEntity(String name)
throws SAXException
endEntity in interface LexicalHandlerSAXException
public void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXException
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXException
public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||