|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.XMLFilterImpl
org.inria.ns.reflex.xml.sax.SAXFilter
public class SAXFilter
An XMLFilter invokable with
system IDs that support many URI schemes.
Support lexical handler and DTD-declaration handler.
This filter takes care of multiple invokations of startDocument() and endDocument().
This filter is suitable for nested documents : no more that one startDocument() and its well-balanced endDocument() events will be fired.
This filter can be used with explicit invokation of startDocument(), then parse(...), and to finish endDocument().
*** This class is used to fix buggy XSLT
processors :
***
| Constructor Summary | |
|---|---|
SAXFilter(ParserConfiguration parserConfiguration)
Create a filter. |
|
| Method Summary | |
|---|---|
void |
attributeDecl(String eName,
String aName,
String type,
String valueDefault,
String value)
Fire a SAX event. |
void |
comment(char[] ch,
int start,
int length)
Fire a SAX event. |
void |
elementDecl(String name,
String model)
Fire a SAX event. |
void |
endCDATA()
Fire a SAX event. |
void |
endDocument()
Fires an end document event if well balanced with the startDocument(). |
void |
endDTD()
Fire a SAX event. |
void |
endEntity(String name)
Fire a SAX event. |
void |
externalEntityDecl(String name,
String publicId,
String systemId)
Fire a SAX event. |
DeclHandler |
getDeclHandler()
Return the DTD-declaration handler registered as a property to this filter. |
LexicalHandler |
getLexicalHandler()
Return the lexical handler registered as a property to this filter. |
XFile |
getLocation()
Get the base location of this filter, used to resolve relative system IDs. |
Object |
getProperty(String name)
|
void |
internalEntityDecl(String name,
String value)
Fire a SAX event. |
boolean |
isLocalizable()
Indicates if a base location has been set on this filter ; when true, getLocation() won't throw
an exception. |
void |
parse(String systemId)
Parse an XML document from a system identifier (URI). |
void |
setDeclHandler(DeclHandler handler)
Set the decl handler. |
void |
setLexicalHandler(LexicalHandler handler)
Set the lexical handler. |
void |
setLocation(XFile location)
Set the base location of this filter, used to resolve relative system IDs. |
void |
setProperty(String name,
Object value)
|
void |
startCDATA()
Fire a SAX event. |
void |
startDocument()
Fires a start document event. |
void |
startDTD(String name,
String publicId,
String systemId)
Fire a SAX event. |
void |
startEntity(String name)
Fire a SAX event. |
| Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
|---|
characters, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, startElement, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xml.sax.ContentHandler |
|---|
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startElement, startPrefixMapping |
| Methods inherited from interface org.xml.sax.DTDHandler |
|---|
notationDecl, unparsedEntityDecl |
| Constructor Detail |
|---|
public SAXFilter(ParserConfiguration parserConfiguration)
configuration - The non-null configuration
expected for the parser, if one is needed.| Method Detail |
|---|
public void parse(String systemId)
throws SAXException,
IOException
parse in interface XMLReaderparse in class XMLFilterImplsystemId - The system identifier (URI) of the document to parse.
The scheme supported are those supported by the I/O module.
SAXException
IOExceptionXMLFilterImpl.parse(java.lang.String)
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class XMLFilterImplSAXException - The client may throw
an exception during processing.ContentHandler.startDocument()
public void endDocument()
throws SAXException
startDocument().
endDocument in interface ContentHandlerendDocument in class XMLFilterImplSAXException - The client may throw
an exception during processing.ContentHandler.endDocument()
public void startDTD(String name,
String publicId,
String systemId)
throws SAXException
startDTD in interface LexicalHandlerSAXExceptionLexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)
public void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionLexicalHandler.endDTD()
public void startEntity(String name)
throws SAXException
startEntity in interface LexicalHandlerSAXExceptionLexicalHandler.startEntity(java.lang.String)
public void endEntity(String name)
throws SAXException
endEntity in interface LexicalHandlerSAXExceptionLexicalHandler.endEntity(java.lang.String)
public void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionLexicalHandler.startCDATA()
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionLexicalHandler.endCDATA()
public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXExceptionLexicalHandler.comment(char[], int, int)public LexicalHandler getLexicalHandler()
null.public void setLexicalHandler(LexicalHandler handler)
handler - The new lexical handler.
NullPointerException - If the handler is null.
public void elementDecl(String name,
String model)
throws SAXException
elementDecl in interface DeclHandlerSAXExceptionDeclHandler.elementDecl(java.lang.String, java.lang.String)
public void attributeDecl(String eName,
String aName,
String type,
String valueDefault,
String value)
throws SAXException
attributeDecl in interface DeclHandlerSAXExceptionDeclHandler.attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void internalEntityDecl(String name,
String value)
throws SAXException
internalEntityDecl in interface DeclHandlerSAXExceptionDeclHandler.internalEntityDecl(java.lang.String, java.lang.String)
public void externalEntityDecl(String name,
String publicId,
String systemId)
throws SAXException
externalEntityDecl in interface DeclHandlerSAXExceptionDeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)public DeclHandler getDeclHandler()
null.public void setDeclHandler(DeclHandler handler)
handler - The new decl handler.
NullPointerException - If the handler is null.
public Object getProperty(String name)
throws SAXNotRecognizedException,
SAXNotSupportedException
getProperty in interface XMLReadergetProperty in class XMLFilterImplSAXNotRecognizedException
SAXNotSupportedExceptionXMLFilterImpl.getProperty(java.lang.String)
public void setProperty(String name,
Object value)
throws SAXNotRecognizedException,
SAXNotSupportedException
setProperty in interface XMLReadersetProperty in class XMLFilterImplSAXNotRecognizedException
SAXNotSupportedExceptionXMLFilterImpl.setProperty(java.lang.String, java.lang.Object)
public XFile getLocation()
throws UnlocalizableException
getLocation in interface LocalizableUnlocalizableException - If no base location has been set before.Localizable.getLocation(),
isLocalizable()
public void setLocation(XFile location)
throws UnlocalizableException
setLocation in interface Localizablelocation - The base location.
UnlocalizableException - If a base URI is irrelevant for
this instance.Localizable.setLocation(org.inria.ns.reflex.modules.io.XFile)public boolean isLocalizable()
true, getLocation() won't throw
an exception.
isLocalizable in interface Localizabletrue if a base location has been set, false otherwise.Localizable.isLocalizable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||