Java Doc for XMLFilterBase.java in  » J2EE » enhydra » sax » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » enhydra » sax 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.xml.sax.helpers.XMLFilterImpl
      sax.XMLFilterBase

All known Subclasses:   sax.DataFormatFilter,  sax.XMLWriter,  sax.DataUnformatFilter,
XMLFilterBase
public class XMLFilterBase extends XMLFilterImpl implements LexicalHandler(Code)
Adds convenience methods and lexical event filtering to base SAX2 Filter implementation. Code and comments adapted from XMLWriter-0.2, written by David Megginson and released into the public domain, without warranty.

The convenience methods are provided so that clients do not have to create empty attribute lists or provide empty strings as parameters; for example, the method invocation

 w.startElement("foo");
 

is equivalent to the regular SAX2 ContentHandler method

 w.startElement("", "foo", "", new AttributesImpl());
 

Except that it is more efficient because it does not allocate a new empty attribute list each time.

In fact, there is an even simpler convenience method, dataElement, designed for writing elements that contain only character data.

 w.dataElement("greeting", "Hello, world!");
 

is equivalent to

 w.startElement("greeting");
 w.characters("Hello, world!");
 w.endElement("greeting");
 

See Also:   org.xml.sax.helpers.XMLFilterImpl


Field Summary
final protected static  AttributesEMPTY_ATTS
    
final protected static  String[]LEXICAL_HANDLER_NAMES
    

Constructor Summary
public  XMLFilterBase()
     Construct an XML filter with no parent.
public  XMLFilterBase(XMLReader parent)
     Create an XML filter with the specified parent.

Method Summary
public  voidcharacters(String data)
     Add a string of character data, with XML escaping.
public  voidcomment(char[] ch, int start, int length)
    
public  voiddataElement(String uri, String localName, String qName, Attributes atts, String content)
     Add an element with character data content.
public  voiddataElement(String uri, String localName, String content)
     Add an element with character data content but no qname or attributes.

This is a convenience method to add a complete element with character data content, including the start tag and end tag.

public  voiddataElement(String localName, Attributes atts, String content)
     Add an element with character data content but no Namespace URI or qname.

This is a convenience method to add a complete element with character data content, including the start tag and end tag.

public  voiddataElement(String localName, String content)
     Add an element with character data content but no attributes or Namespace URI.

This is a convenience method to add a complete element with character data content, including the start tag and end tag.

public  voidemptyElement(String uri, String localName, String qName, Attributes atts)
     Add an empty element. Both a XMLFilterBase.startElement startElement and an XMLFilterBase.endElement endElement event will be passed on down the filter chain.
Parameters:
  uri - The element's Namespace URI, or the empty stringif the element has no Namespace or if Namespaceprocessing is not being performed.
Parameters:
  localName - The element's local name (without prefix).
public  voidemptyElement(String uri, String localName)
     Add an empty element without a qname or attributes.

This method will supply an empty string for the qname and an empty attribute list.

public  voidemptyElement(String localName, Attributes atts)
     Add an empty element without a Namespace URI or qname.
public  voidemptyElement(String localName)
     Add an empty element without a Namespace URI, qname or attributes.

This method will supply an empty string for the qname, and empty string for the Namespace URI, and an empty attribute list.

public  voidendCDATA()
    
public  voidendDTD()
     Filter a end DTD event.
public  voidendElement(String uri, String localName)
     End an element without a qname.
public  voidendElement(String localName)
     End an element without a Namespace URI or qname.
public  voidendEntity(String name)
    
public  LexicalHandlergetLexicalHandler()
     Get the current lexical handler.
public  ObjectgetProperty(String name)
     Look up the value of a property.
Parameters:
  name - The property name.
public  voidparse(InputSource input)
     Parse a document.
public  voidsetLexicalHandler(LexicalHandler handler)
     Set the lexical handler.
public  voidsetProperty(String name, Object value)
     Set the value of a property.
public  voidstartCDATA()
    
public  voidstartDTD(String name, String publicId, String systemId)
     Filter a start DTD event.
public  voidstartElement(String uri, String localName)
     Start a new element without a qname or attributes.

This method will provide a default empty attribute list and an empty string for the qualified name.

public  voidstartElement(String localName, Attributes atts)
     Start a new element without a Namespace URI or qname.
public  voidstartElement(String localName)
     Start a new element without a Namespace URI, qname, or attributes.

This method will provide an empty string for the Namespace URI, and empty string for the qualified name, and a default empty attribute list.

public  voidstartEntity(String name)
    

Field Detail
EMPTY_ATTS
final protected static Attributes EMPTY_ATTS(Code)



LEXICAL_HANDLER_NAMES
final protected static String[] LEXICAL_HANDLER_NAMES(Code)




Constructor Detail
XMLFilterBase
public XMLFilterBase()(Code)
Construct an XML filter with no parent.

This filter will have no parent: you must assign a parent before you start a parse or do any configuration with setFeature or setProperty.


See Also:   org.xml.sax.XMLReader.setFeature
See Also:   org.xml.sax.XMLReader.setProperty



XMLFilterBase
public XMLFilterBase(XMLReader parent)(Code)
Create an XML filter with the specified parent.

Use the XMLReader provided as the source of events.


Parameters:
  xmlreader - The parent in the filter chain.




Method Detail
characters
public void characters(String data) throws SAXException(Code)
Add a string of character data, with XML escaping.

This is a convenience method that takes an XML String, converts it to a character array, then invokes @see org.xml.sax.ContentHandler#characters .


Parameters:
  data - The character data.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:    @see org.xml.sax.ContentHandler#characters



comment
public void comment(char[] ch, int start, int length) throws SAXException(Code)



dataElement
public void dataElement(String uri, String localName, String qName, Attributes atts, String content) throws SAXException(Code)
Add an element with character data content.

This is a convenience method to add a complete element with character data content, including the start tag and end tag.

This method invokes @see org.xml.sax.ContentHandler#startElement , followed by XMLFilterBase.characters(String) , followed by @see org.xml.sax.ContentHandler#endElement .


Parameters:
  uri - The element's Namespace URI.
Parameters:
  localName - The element's local name.
Parameters:
  qName - The element's default qualified name.
Parameters:
  atts - The element's attributes.
Parameters:
  content - The character data content.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement
See Also:   XMLFilterBase.characters(String)
See Also:   org.xml.sax.ContentHandler.endElement



dataElement
public void dataElement(String uri, String localName, String content) throws SAXException(Code)
Add an element with character data content but no qname or attributes.

This is a convenience method to add a complete element with character data content, including the start tag and end tag. This method provides an empty string for the qname and an empty attribute list. It invokes XMLFilterBase.dataElement(String,String,String,Attributes,String) } directly.


Parameters:
  uri - The element's Namespace URI.
Parameters:
  localName - The element's local name.
Parameters:
  content - The character data content.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement
See Also:   XMLFilterBase.characters(String)
See Also:   org.xml.sax.ContentHandler.endElement



dataElement
public void dataElement(String localName, Attributes atts, String content) throws SAXException(Code)
Add an element with character data content but no Namespace URI or qname.

This is a convenience method to add a complete element with character data content, including the start tag and end tag. The method provides an empty string for the Namespace URI, and empty string for the qualified name. It invokes XMLFilterBase.dataElement(String,String,String,Attributes,String) } directly.


Parameters:
  localName - The element's local name.
Parameters:
  atts - The element's attributes.
Parameters:
  content - The character data content.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement
See Also:   XMLFilterBase.characters(String)
See Also:   org.xml.sax.ContentHandler.endElement



dataElement
public void dataElement(String localName, String content) throws SAXException(Code)
Add an element with character data content but no attributes or Namespace URI.

This is a convenience method to add a complete element with character data content, including the start tag and end tag. The method provides an empty string for the Namespace URI, and empty string for the qualified name, and an empty attribute list. It invokes XMLFilterBase.dataElement(String,String,String,Attributes,String) } directly.


Parameters:
  localName - The element's local name.
Parameters:
  content - The character data content.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement
See Also:   XMLFilterBase.characters(String)
See Also:   org.xml.sax.ContentHandler.endElement



emptyElement
public void emptyElement(String uri, String localName, String qName, Attributes atts) throws SAXException(Code)
Add an empty element. Both a XMLFilterBase.startElement startElement and an XMLFilterBase.endElement endElement event will be passed on down the filter chain.
Parameters:
  uri - The element's Namespace URI, or the empty stringif the element has no Namespace or if Namespaceprocessing is not being performed.
Parameters:
  localName - The element's local name (without prefix). Thisparameter must be provided.
Parameters:
  qName - The element's qualified name (with prefix), orthe empty string if none is available. This parameteris strictly advisory: the writer may or may not usethe prefix attached.
Parameters:
  atts - The element's attribute list.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement
See Also:   org.xml.sax.ContentHandler.endElement



emptyElement
public void emptyElement(String uri, String localName) throws SAXException(Code)
Add an empty element without a qname or attributes.

This method will supply an empty string for the qname and an empty attribute list. It invokes XMLFilterBase.emptyElement(String,String,String,Attributes) directly.


Parameters:
  uri - The element's Namespace URI.
Parameters:
  localName - The element's local name.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   XMLFilterBase.emptyElement(String,String,String,Attributes)



emptyElement
public void emptyElement(String localName, Attributes atts) throws SAXException(Code)
Add an empty element without a Namespace URI or qname.

This method will provide an empty string for the Namespace URI, and empty string for the qualified name. It invokes XMLFilterBase.emptyElement(String,String,String,Attributes) directly.


Parameters:
  localName - The element's local name.
Parameters:
  atts - The element's attribute list.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement



emptyElement
public void emptyElement(String localName) throws SAXException(Code)
Add an empty element without a Namespace URI, qname or attributes.

This method will supply an empty string for the qname, and empty string for the Namespace URI, and an empty attribute list. It invokes XMLFilterBase.emptyElement(String,String,String,Attributes) directly.


Parameters:
  localName - The element's local name.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   XMLFilterBase.emptyElement(String,String,String,Attributes)



endCDATA
public void endCDATA() throws SAXException(Code)



endDTD
public void endDTD() throws SAXException(Code)
Filter a end DTD event.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ext.LexicalHandler.endDTD



endElement
public void endElement(String uri, String localName) throws SAXException(Code)
End an element without a qname.

This method will supply an empty string for the qName. It invokes XMLFilterBase.endElement(String,String,String) directly.


Parameters:
  uri - The element's Namespace URI.
Parameters:
  localName - The element's local name.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.endElement



endElement
public void endElement(String localName) throws SAXException(Code)
End an element without a Namespace URI or qname.

This method will supply an empty string for the qName and an empty string for the Namespace URI. It invokes XMLFilterBase.endElement(String,String,String) directly.


Parameters:
  localName - The element's local name.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.endElement



endEntity
public void endEntity(String name) throws SAXException(Code)



getLexicalHandler
public LexicalHandler getLexicalHandler()(Code)
Get the current lexical handler. The current lexical handler, or null if none was set.



getProperty
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
Look up the value of a property.
Parameters:
  name - The property name. The current value of the property.
exception:
  org.xml.sax.SAXNotRecognizedException - When theXMLReader does not recognize the feature name.
exception:
  org.xml.sax.SAXNotSupportedException - When theXMLReader recognizes the property name butcannot determine its value at this time.
See Also:   org.xml.sax.XMLReader.setFeature



parse
public void parse(InputSource input) throws SAXException, IOException(Code)
Parse a document.
Parameters:
  input - The input source for the document entity.
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
exception:
  java.io.IOException - An IO exception from the parser,possibly from a byte stream or character streamsupplied by the application.
See Also:   org.xml.sax.XMLReader.parse(org.xml.sax.InputSource)



setLexicalHandler
public void setLexicalHandler(LexicalHandler handler)(Code)
Set the lexical handler.
Parameters:
  handler - The new lexical handler.
exception:
  java.lang.NullPointerException - If the handleris null.



setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
Set the value of a property.

This will always fail if the parent is null.


Parameters:
  name - The property name.
Parameters:
  state - The requested property value.
exception:
  org.xml.sax.SAXNotRecognizedException - When theXMLReader does not recognize the property name.
exception:
  org.xml.sax.SAXNotSupportedException - When theXMLReader recognizes the property name butcannot set the requested value.
See Also:   org.xml.sax.XMLReader.setProperty



startCDATA
public void startCDATA() throws SAXException(Code)



startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException(Code)
Filter a start DTD event.
Parameters:
  name - The document type name.
Parameters:
  publicId - The declared public identifier for theexternal DTD subset, or null if none was declared.
Parameters:
  systemId - The declared system identifier for theexternal DTD subset, or null if none was declared.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ext.LexicalHandler.startDTD



startElement
public void startElement(String uri, String localName) throws SAXException(Code)
Start a new element without a qname or attributes.

This method will provide a default empty attribute list and an empty string for the qualified name. It invokes XMLFilterBase.startElement(String,String,String,Attributes) directly.


Parameters:
  uri - The element's Namespace URI.
Parameters:
  localName - The element's local name.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement



startElement
public void startElement(String localName, Attributes atts) throws SAXException(Code)
Start a new element without a Namespace URI or qname.

This method will provide an empty string for the Namespace URI, and empty string for the qualified name. It invokes XMLFilterBase.startElement(String,String,String,Attributes) directly.


Parameters:
  localName - The element's local name.
Parameters:
  atts - The element's attribute list.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement



startElement
public void startElement(String localName) throws SAXException(Code)
Start a new element without a Namespace URI, qname, or attributes.

This method will provide an empty string for the Namespace URI, and empty string for the qualified name, and a default empty attribute list. It invokes XMLFilterBase.startElement(String,String,String,Attributes) directly.


Parameters:
  localName - The element's local name.
exception:
  org.xml.sax.SAXException - If a filterfurther down the chain raises an exception.
See Also:   org.xml.sax.ContentHandler.startElement



startEntity
public void startEntity(String name) throws SAXException(Code)



Methods inherited from org.xml.sax.helpers.XMLFilterImpl
public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc)
public void endDocument() throws SAXException(Code)(Java Doc)
public void endElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc)
public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc)
public void error(SAXParseException e) throws SAXException(Code)(Java Doc)
public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc)
public ContentHandler getContentHandler()(Code)(Java Doc)
public DTDHandler getDTDHandler()(Code)(Java Doc)
public EntityResolver getEntityResolver()(Code)(Java Doc)
public ErrorHandler getErrorHandler()(Code)(Java Doc)
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)(Java Doc)
public XMLReader getParent()(Code)(Java Doc)
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)(Java Doc)
public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc)
public void notationDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc)
public void parse(InputSource input) throws SAXException, IOException(Code)(Java Doc)
public void parse(String systemId) throws SAXException, IOException(Code)(Java Doc)
public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc)
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException(Code)(Java Doc)
public void setContentHandler(ContentHandler handler)(Code)(Java Doc)
public void setDTDHandler(DTDHandler handler)(Code)(Java Doc)
public void setDocumentLocator(Locator locator)(Code)(Java Doc)
public void setEntityResolver(EntityResolver resolver)(Code)(Java Doc)
public void setErrorHandler(ErrorHandler handler)(Code)(Java Doc)
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)(Java Doc)
public void setParent(XMLReader parent)(Code)(Java Doc)
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)(Java Doc)
public void skippedEntity(String name) throws SAXException(Code)(Java Doc)
public void startDocument() throws SAXException(Code)(Java Doc)
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException(Code)(Java Doc)
public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc)
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException(Code)(Java Doc)
public void warning(SAXParseException e) throws SAXException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.