Java Doc for SAXOutputter.java in  » Workflow-Engines » OpenWFE » org » jdom » output » 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 » Workflow Engines » OpenWFE » org.jdom.output 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jdom.output.SAXOutputter

SAXOutputter
public class SAXOutputter (Code)
Outputs a JDOM document as a stream of SAX2 events.

Most ContentHandler callbacks are supported. Both ignorableWhitespace() and skippedEntity() have not been implemented. The JDOMLocator class returned by SAXOutputter.getLocator exposes the current node being operated upon.

At this time, it is not possible to access notations and unparsed entity references in a DTD from JDOM. Therefore, DTDHandler callbacks have not been implemented yet.

The ErrorHandler callbacks have not been implemented, since these are supposed to be invoked when the document is parsed and at this point the document exists in memory and is known to have no errors.


version:
   $Revision: 1.2 $, $Date: 2005/05/03 07:02:04 $
author:
   Brett McLaughlin
author:
   Jason Hunter
author:
   Fred Trimble
author:
   Bradley S. Huffman



Constructor Summary
public  SAXOutputter()
     This will create a SAXOutputter without any registered handler.
public  SAXOutputter(ContentHandler contentHandler)
     This will create a SAXOutputter with the specified ContentHandler.
public  SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver)
     This will create a SAXOutputter with the specified SAX2 handlers.
public  SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver, LexicalHandler lexicalHandler)
     This will create a SAXOutputter with the specified SAX2 handlers.

Method Summary
protected  XMLReadercreateParser()
    

Creates a SAX XMLReader.

public  ContentHandlergetContentHandler()
     Returns the registered ContentHandler.
public  DTDHandlergetDTDHandler()
     Return the registered DTDHandler.
public  DeclHandlergetDeclHandler()
     Return the registered DeclHandler.
public  EntityResolvergetEntityResolver()
     Return the registered EntityResolver.
public  ErrorHandlergetErrorHandler()
     Return the registered ErrorHandler.
public  booleangetFeature(String name)
     This will look up the value of a SAX feature.
Parameters:
  name - String the feature name, which is afully-qualified URI.
public  LexicalHandlergetLexicalHandler()
     Return the registered LexicalHandler.
public  JDOMLocatorgetLocator()
     Returns a JDOMLocator object referencing the node currently being processed by this outputter.
public  ObjectgetProperty(String name)
     This will look up the value of a SAX property.
Parameters:
  name - String the property name, which is afully-qualified URI.
public  booleangetReportDTDEvents()
     Returns whether DTD events will be reported.
public  booleangetReportNamespaceDeclarations()
     Returns whether attribute namespace declarations shall be reported as "xmlns" attributes.
public  voidoutput(Document document)
     This will output the JDOM Document, firing off the SAX events that have been registered.
public  voidoutput(List nodes)
     This will output a list of JDOM nodes as a document, firing off the SAX events that have been registered.

Warning: This method may output ill-formed XML documents if the list contains top-level objects that are not legal at the document level (e.g.

public  voidoutput(Element node)
     This will output a single JDOM element as a document, firing off the SAX events that have been registered.
public  voidoutputFragment(List nodes)
     This will output a list of JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered.

Warning: This method does not call the ContentHandler.setDocumentLocator , ContentHandler.startDocument and ContentHandler.endDocument callbacks on the SAXOutputter.setContentHandler ContentHandler .

public  voidoutputFragment(Content node)
     This will output a single JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered.

Warning: This method does not call the ContentHandler.setDocumentLocator , ContentHandler.startDocument and ContentHandler.endDocument callbacks on the SAXOutputter.setContentHandler ContentHandler .

public  voidsetContentHandler(ContentHandler contentHandler)
     This will set the ContentHandler.
public  voidsetDTDHandler(DTDHandler dtdHandler)
     This will set the DTDHandler.
public  voidsetDeclHandler(DeclHandler declHandler)
     This will set the DeclHandler.
public  voidsetEntityResolver(EntityResolver entityResolver)
     This will set the EntityResolver.
public  voidsetErrorHandler(ErrorHandler errorHandler)
     This will set the ErrorHandler.
public  voidsetFeature(String name, boolean value)
     This will set the state of a SAX feature.
public  voidsetLexicalHandler(LexicalHandler lexicalHandler)
     This will set the LexicalHandler.
public  voidsetProperty(String name, Object value)
     This will set the value of a SAX property.
public  voidsetReportDTDEvents(boolean reportDtdEvents)
     This will define whether to report DTD events to SAX DeclHandlers and LexicalHandlers if these handlers are registered and the document to output includes a DocType declaration.
public  voidsetReportNamespaceDeclarations(boolean declareNamespaces)
     This will define whether attribute namespace declarations shall be reported as "xmlns" attributes.


Constructor Detail
SAXOutputter
public SAXOutputter()(Code)
This will create a SAXOutputter without any registered handler. The application is then responsible for registering them using the setXxxHandler() methods.



SAXOutputter
public SAXOutputter(ContentHandler contentHandler)(Code)
This will create a SAXOutputter with the specified ContentHandler.
Parameters:
  contentHandler - contains ContentHandlercallback methods



SAXOutputter
public SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver)(Code)
This will create a SAXOutputter with the specified SAX2 handlers. At this time, only ContentHandler and EntityResolver are supported.
Parameters:
  contentHandler - contains ContentHandlercallback methods
Parameters:
  errorHandler - contains ErrorHandler callback methods
Parameters:
  dtdHandler - contains DTDHandler callback methods
Parameters:
  entityResolver - contains EntityResolvercallback methods



SAXOutputter
public SAXOutputter(ContentHandler contentHandler, ErrorHandler errorHandler, DTDHandler dtdHandler, EntityResolver entityResolver, LexicalHandler lexicalHandler)(Code)
This will create a SAXOutputter with the specified SAX2 handlers. At this time, only ContentHandler and EntityResolver are supported.
Parameters:
  contentHandler - contains ContentHandlercallback methods
Parameters:
  errorHandler - contains ErrorHandler callback methods
Parameters:
  dtdHandler - contains DTDHandler callback methods
Parameters:
  entityResolver - contains EntityResolvercallback methods
Parameters:
  lexicalHandler - contains LexicalHandler callbacks.




Method Detail
createParser
protected XMLReader createParser() throws Exception(Code)

Creates a SAX XMLReader.

XMLReader a SAX2 parser.
throws:
  Exception - if no parser can be created.



getContentHandler
public ContentHandler getContentHandler()(Code)
Returns the registered ContentHandler. the current ContentHandler ornull if none was registered.



getDTDHandler
public DTDHandler getDTDHandler()(Code)
Return the registered DTDHandler. the current DTDHandler ornull if none was registered.



getDeclHandler
public DeclHandler getDeclHandler()(Code)
Return the registered DeclHandler. the current DeclHandler ornull if none was registered.



getEntityResolver
public EntityResolver getEntityResolver()(Code)
Return the registered EntityResolver. the current EntityResolver ornull if none was registered.



getErrorHandler
public ErrorHandler getErrorHandler()(Code)
Return the registered ErrorHandler. the current ErrorHandler ornull if none was registered.



getFeature
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
This will look up the value of a SAX feature.
Parameters:
  name - String the feature name, which is afully-qualified URI. boolean the current state of the feature(true or false).
throws:
  SAXNotRecognizedException - when SAXOutputter does notrecognize the feature name.
throws:
  SAXNotSupportedException - when SAXOutputter recognizesthe feature name but determine its value at this time.



getLexicalHandler
public LexicalHandler getLexicalHandler()(Code)
Return the registered LexicalHandler. the current LexicalHandler ornull if none was registered.



getLocator
public JDOMLocator getLocator()(Code)
Returns a JDOMLocator object referencing the node currently being processed by this outputter. The returned object is a snapshot of the location information and can thus safely be memorized for later use.

This method allows direct access to the location information maintained by SAXOutputter without requiring to implement XMLFilter. (In SAX, locators are only available though the ContentHandler interface).

Note that location information is only available while SAXOutputter is outputting nodes. Hence this method should only be used by objects taking part in the output processing such as ErrorHandlers. a JDOMLocator object referencing the node currentlybeing processed or null if no outputoperation is being performed.




getProperty
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
This will look up the value of a SAX property.
Parameters:
  name - String the property name, which is afully-qualified URI. Object the current value of the property.
throws:
  SAXNotRecognizedException - when SAXOutputter does not recognizethe property name.
throws:
  SAXNotSupportedException - when SAXOutputter recognizes theproperty name but cannot determine its value at this time.



getReportDTDEvents
public boolean getReportDTDEvents()(Code)
Returns whether DTD events will be reported. whether DTD events will be reported



getReportNamespaceDeclarations
public boolean getReportNamespaceDeclarations()(Code)
Returns whether attribute namespace declarations shall be reported as "xmlns" attributes. whether attribute namespace declarations shall be reported as"xmlns" attributes.



output
public void output(Document document) throws JDOMException(Code)
This will output the JDOM Document, firing off the SAX events that have been registered.
Parameters:
  document - JDOM Document to output.
throws:
  JDOMException - if any error occurred.



output
public void output(List nodes) throws JDOMException(Code)
This will output a list of JDOM nodes as a document, firing off the SAX events that have been registered.

Warning: This method may output ill-formed XML documents if the list contains top-level objects that are not legal at the document level (e.g. Text or CDATA nodes, multiple Element nodes, etc.). Thus, it should only be used to output document portions towards ContentHandlers capable of accepting such ill-formed documents (such as XSLT processors).


Parameters:
  nodes - List of JDOM nodes to output.
throws:
  JDOMException - if any error occurred.
See Also:   SAXOutputter.output(org.jdom.Document)



output
public void output(Element node) throws JDOMException(Code)
This will output a single JDOM element as a document, firing off the SAX events that have been registered.
Parameters:
  node - the Element node to output.
throws:
  JDOMException - if any error occurred.



outputFragment
public void outputFragment(List nodes) throws JDOMException(Code)
This will output a list of JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered.

Warning: This method does not call the ContentHandler.setDocumentLocator , ContentHandler.startDocument and ContentHandler.endDocument callbacks on the SAXOutputter.setContentHandler ContentHandler . The user shall invoke these methods directly prior/after outputting the document fragments.


Parameters:
  nodes - List of JDOM nodes to output.
throws:
  JDOMException - if any error occurred.
See Also:   SAXOutputter.outputFragment(org.jdom.Content)



outputFragment
public void outputFragment(Content node) throws JDOMException(Code)
This will output a single JDOM nodes as a fragment of an XML document, firing off the SAX events that have been registered.

Warning: This method does not call the ContentHandler.setDocumentLocator , ContentHandler.startDocument and ContentHandler.endDocument callbacks on the SAXOutputter.setContentHandler ContentHandler . The user shall invoke these methods directly prior/after outputting the document fragments.


Parameters:
  node - the Content node to output.
throws:
  JDOMException - if any error occurred.
See Also:   SAXOutputter.outputFragment(java.util.List)



setContentHandler
public void setContentHandler(ContentHandler contentHandler)(Code)
This will set the ContentHandler.
Parameters:
  contentHandler - contains ContentHandlercallback methods.



setDTDHandler
public void setDTDHandler(DTDHandler dtdHandler)(Code)
This will set the DTDHandler.
Parameters:
  dtdHandler - contains DTDHandler callback methods.



setDeclHandler
public void setDeclHandler(DeclHandler declHandler)(Code)
This will set the DeclHandler.
Parameters:
  declHandler - contains declaration callback methods.



setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)(Code)
This will set the EntityResolver.
Parameters:
  entityResolver - contains EntityResolver callback methods.



setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)(Code)
This will set the ErrorHandler.
Parameters:
  errorHandler - contains ErrorHandler callback methods.



setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
This will set the state of a SAX feature.

All XMLReaders are required to support setting to true and to false.

SAXOutputter currently supports the following SAX core features:

http://xml.org/sax/features/namespaces
description: true indicates namespace URIs and unprefixed local names for element and attribute names will be available
access: read/write, but always true!
http://xml.org/sax/features/namespace-prefixes
description: true indicates XML 1.0 names (with prefixes) and attributes (including xmlns* attributes) will be available
access: read/write
http://xml.org/sax/features/validation
description: controls whether SAXOutputter is reporting DTD-related events; if true, the DocType internal subset will be parsed to fire DTD events
access: read/write, defaults to true


Parameters:
  name - String the feature name, which is afully-qualified URI.
Parameters:
  value - boolean the requested state of thefeature (true or false).
throws:
  SAXNotRecognizedException - when SAXOutputter does notrecognize the feature name.
throws:
  SAXNotSupportedException - when SAXOutputter recognizesthe feature name but cannot set the requested value.



setLexicalHandler
public void setLexicalHandler(LexicalHandler lexicalHandler)(Code)
This will set the LexicalHandler.
Parameters:
  lexicalHandler - contains lexical callback methods.



setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException(Code)
This will set the value of a SAX property. This method is also the standard mechanism for setting extended handlers.

SAXOutputter currently supports the following SAX properties:

http://xml.org/sax/properties/lexical-handler
data type: org.xml.sax.ext.LexicalHandler
description: An optional extension handler for lexical events like comments.
access: read/write
http://xml.org/sax/properties/declaration-handler
data type: org.xml.sax.ext.DeclHandler
description: An optional extension handler for DTD-related events other than notations and unparsed entities.
access: read/write


Parameters:
  name - String the property name, which is afully-qualified URI.
Parameters:
  value - Object the requested value for the property.
throws:
  SAXNotRecognizedException - when SAXOutputter does not recognizethe property name.
throws:
  SAXNotSupportedException - when SAXOutputter recognizes theproperty name but cannot set the requested value.



setReportDTDEvents
public void setReportDTDEvents(boolean reportDtdEvents)(Code)
This will define whether to report DTD events to SAX DeclHandlers and LexicalHandlers if these handlers are registered and the document to output includes a DocType declaration.
Parameters:
  reportDtdEvents - whether to notify DTD events.



setReportNamespaceDeclarations
public void setReportNamespaceDeclarations(boolean declareNamespaces)(Code)
This will define whether attribute namespace declarations shall be reported as "xmlns" attributes. This flag defaults to false and behaves as the "namespace-prefixes" SAX core feature.
Parameters:
  declareNamespaces - whether attribute namespace declarationsshall be reported as "xmlns" attributes.



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.