Java Doc for OutputFormat.java in  » Web-Server » Rimfaxe-Web-Server » org » apache » xml » serialize » 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 » Web Server » Rimfaxe Web Server » org.apache.xml.serialize 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xml.serialize.OutputFormat

OutputFormat
public class OutputFormat (Code)
Specifies an output format to control the serializer. Based on the XSLT specification for output format, plus additional parameters. Used to select the suitable serializer and determine how the document should be formatted on output.

The two interesting constructors are:


version:
   $Revision: 1.11.2.1 $ $Date: 2001/11/07 19:00:34 $
author:
   Assaf Arkin
author:
   Keith Visco
See Also:   Serializer
See Also:   Method
See Also:   LineSeparator

Inner Class :public static class DTD
Inner Class :public static class Defaults


Constructor Summary
public  OutputFormat()
     Constructs a new output format with the default values.
public  OutputFormat(String method, String encoding, boolean indenting)
     Constructs a new output format with the default values for the specified method and encoding.
public  OutputFormat(Document doc)
     Constructs a new output format with the proper method, document type identifiers and media type for the specified document.
public  OutputFormat(Document doc, String encoding, boolean indenting)
     Constructs a new output format with the proper method, document type identifiers and media type for the specified document, and with the specified encoding.

Method Summary
public  String[]getCDataElements()
     Returns a list of all the elements whose text node children should be output as CDATA, or null if no such elements were specified.
public  StringgetDoctypePublic()
     Returns the specified document type public identifier, or null.
public  StringgetDoctypeSystem()
     Returns the specified document type system identifier, or null.
public  StringgetEncoding()
     Returns the specified encoding.
public  EncodingInfogetEncodingInfo()
     Returns an EncodingInfo instance for the encoding.
public  intgetIndent()
     Returns the indentation specified.
public  booleangetIndenting()
     Returns true if indentation was specified.
public  chargetLastPrintable()
     Returns the last printable character based on the selected encoding.
public  StringgetLineSeparator()
     Returns a specific line separator to use.
public  intgetLineWidth()
     Return the selected line width for breaking up long lines.
public  StringgetMediaType()
     Returns the specified media type, or null.
public  StringgetMethod()
     Returns the method specified for this output format.
public  String[]getNonEscapingElements()
     Returns a list of all the elements whose text node children should be output unescaped (no character references), or null if no such elements were specified.
public  booleangetOmitComments()
     Returns true if comments should be ommited.
public  booleangetOmitDocumentType()
     Returns true if the DOCTYPE declaration should be ommited.
public  booleangetOmitXMLDeclaration()
     Returns true if the XML document declaration should be ommited.
public  booleangetPreserveEmptyAttributes()
     Returns the preserveEmptyAttribute flag.
public  booleangetPreserveSpace()
     Returns true if the default behavior for this format is to preserve spaces.
public  booleangetStandalone()
     Returns true if the document type is standalone.
public  StringgetVersion()
     Returns the version for this output method.
public  booleanisCDataElement(String tagName)
     Returns true if the text node children of the given elements should be output as CDATA.
public  booleanisNonEscapingElement(String tagName)
     Returns true if the text node children of the given elements should be output unescaped.
public  voidsetCDataElements(String[] cdataElements)
     Sets the list of elements for which text node children should be output as CDATA.
public  voidsetDoctype(String publicId, String systemId)
     Sets the document type public and system identifiers. Required only if the DOM Document or SAX events do not specify the document type, and one must be present in the serialized document.
public  voidsetEncoding(String encoding)
     Sets the encoding for this output method.
public  voidsetEncoding(EncodingInfo encInfo)
     Sets the encoding for this output method with an EncodingInfo instance.
public  voidsetIndent(int indent)
     Sets the indentation.
public  voidsetIndenting(boolean on)
     Sets the indentation on and off.
public  voidsetLineSeparator(String lineSeparator)
     Sets the line separator.
public  voidsetLineWidth(int lineWidth)
     Sets the line width.
public  voidsetMediaType(String mediaType)
     Sets the media type.
public  voidsetMethod(String method)
     Sets the method for this output format.
public  voidsetNonEscapingElements(String[] nonEscapingElements)
     Sets the list of elements for which text node children should be output unescaped (no character references).
public  voidsetOmitComments(boolean omit)
     Sets comment omitting on and off.
public  voidsetOmitDocumentType(boolean omit)
     Sets DOCTYPE declaration omitting on and off.
public  voidsetOmitXMLDeclaration(boolean omit)
     Sets XML declaration omitting on and off.
public  voidsetPreserveEmptyAttributes(boolean preserve)
     Sets the preserveEmptyAttribute flag.
public  voidsetPreserveSpace(boolean preserve)
     Sets space preserving as the default behavior.
public  voidsetStandalone(boolean standalone)
     Sets document DTD standalone.
public  voidsetVersion(String version)
     Sets the version for this output method.
public static  StringwhichDoctypePublic(Document doc)
     Returns the document type public identifier specified for this document, or null.
public static  StringwhichDoctypeSystem(Document doc)
     Returns the document type system identifier specified for this document, or null.
public static  StringwhichMediaType(String method)
     Returns the suitable media format for a document output with the specified method.
public static  StringwhichMethod(Document doc)
     Determine the output method for the specified document. If the document is an instance of org.w3c.dom.html.HTMLDocument then the method is said to be html.


Constructor Detail
OutputFormat
public OutputFormat()(Code)
Constructs a new output format with the default values.



OutputFormat
public OutputFormat(String method, String encoding, boolean indenting)(Code)
Constructs a new output format with the default values for the specified method and encoding. If indent is true, the document will be pretty printed with the default indentation level and default line wrapping.
Parameters:
  method - The specified output method
Parameters:
  encoding - The specified encoding
Parameters:
  indenting - True for pretty printing
See Also:   OutputFormat.setEncoding
See Also:   OutputFormat.setIndenting
See Also:   OutputFormat.setMethod



OutputFormat
public OutputFormat(Document doc)(Code)
Constructs a new output format with the proper method, document type identifiers and media type for the specified document.
Parameters:
  doc - The document to output
See Also:   OutputFormat.whichMethod



OutputFormat
public OutputFormat(Document doc, String encoding, boolean indenting)(Code)
Constructs a new output format with the proper method, document type identifiers and media type for the specified document, and with the specified encoding. If indent is true, the document will be pretty printed with the default indentation level and default line wrapping.
Parameters:
  doc - The document to output
Parameters:
  encoding - The specified encoding
Parameters:
  indenting - True for pretty printing
See Also:   OutputFormat.setEncoding
See Also:   OutputFormat.setIndenting
See Also:   OutputFormat.whichMethod




Method Detail
getCDataElements
public String[] getCDataElements()(Code)
Returns a list of all the elements whose text node children should be output as CDATA, or null if no such elements were specified.



getDoctypePublic
public String getDoctypePublic()(Code)
Returns the specified document type public identifier, or null.



getDoctypeSystem
public String getDoctypeSystem()(Code)
Returns the specified document type system identifier, or null.



getEncoding
public String getEncoding()(Code)
Returns the specified encoding. If no encoding was specified, the default is always "UTF-8". The encoding



getEncodingInfo
public EncodingInfo getEncodingInfo()(Code)
Returns an EncodingInfo instance for the encoding.
See Also:   setEncoding



getIndent
public int getIndent()(Code)
Returns the indentation specified. If no indentation was specified, zero is returned and the document should not be indented. The indentation or zero
See Also:   OutputFormat.setIndenting



getIndenting
public boolean getIndenting()(Code)
Returns true if indentation was specified.



getLastPrintable
public char getLastPrintable()(Code)
Returns the last printable character based on the selected encoding. Control characters and non-printable characters are always printed as character references.



getLineSeparator
public String getLineSeparator()(Code)
Returns a specific line separator to use. The default is the Web line separator (\n). A string is returned to support double codes (CR + LF). The specified line separator



getLineWidth
public int getLineWidth()(Code)
Return the selected line width for breaking up long lines. When indenting, and only when indenting, long lines will be broken at space boundaries based on this line width. No line wrapping occurs if this value is zero.



getMediaType
public String getMediaType()(Code)
Returns the specified media type, or null. To determine the media type based on the document type, use OutputFormat.whichMediaType . The specified media type, or null



getMethod
public String getMethod()(Code)
Returns the method specified for this output format. Typically the method will be xml, html or text, but it might be other values. If no method was specified, null will be returned and the most suitable method will be determined for the document by calling OutputFormat.whichMethod . The specified output method, or null



getNonEscapingElements
public String[] getNonEscapingElements()(Code)
Returns a list of all the elements whose text node children should be output unescaped (no character references), or null if no such elements were specified.



getOmitComments
public boolean getOmitComments()(Code)
Returns true if comments should be ommited. The default is false.



getOmitDocumentType
public boolean getOmitDocumentType()(Code)
Returns true if the DOCTYPE declaration should be ommited. The default is false.



getOmitXMLDeclaration
public boolean getOmitXMLDeclaration()(Code)
Returns true if the XML document declaration should be ommited. The default is false.



getPreserveEmptyAttributes
public boolean getPreserveEmptyAttributes()(Code)
Returns the preserveEmptyAttribute flag. If flag is false, then' attributes with empty string values are output as the attribute name only (in HTML mode). preserve the preserve flag



getPreserveSpace
public boolean getPreserveSpace()(Code)
Returns true if the default behavior for this format is to preserve spaces. All elements that do not specify otherwise or specify the default behavior will be formatted based on this rule. All elements that specify space preserving will always preserve space.



getStandalone
public boolean getStandalone()(Code)
Returns true if the document type is standalone. The default is false.



getVersion
public String getVersion()(Code)
Returns the version for this output method. If no version was specified, will return null and the default version number will be used. If the serializerr does not support that particular version, it should default to a supported version. The specified method version, or null



isCDataElement
public boolean isCDataElement(String tagName)(Code)
Returns true if the text node children of the given elements should be output as CDATA.
Parameters:
  tagName - The element's tag name True if should serialize as CDATA



isNonEscapingElement
public boolean isNonEscapingElement(String tagName)(Code)
Returns true if the text node children of the given elements should be output unescaped.
Parameters:
  tagName - The element's tag name True if should serialize unescaped



setCDataElements
public void setCDataElements(String[] cdataElements)(Code)
Sets the list of elements for which text node children should be output as CDATA.
Parameters:
  cdataElements - List of CDATA element tag names



setDoctype
public void setDoctype(String publicId, String systemId)(Code)
Sets the document type public and system identifiers. Required only if the DOM Document or SAX events do not specify the document type, and one must be present in the serialized document. Any document type specified by the DOM Document or SAX events will override these values.
Parameters:
  publicId - The public identifier, or null
Parameters:
  systemId - The system identifier, or null



setEncoding
public void setEncoding(String encoding)(Code)
Sets the encoding for this output method. If no encoding was specified, the default is always "UTF-8". Make sure the encoding is compatible with the one used by the java.io.Writer .
See Also:   OutputFormat.getEncoding
Parameters:
  encoding - The encoding, or null



setEncoding
public void setEncoding(EncodingInfo encInfo)(Code)
Sets the encoding for this output method with an EncodingInfo instance.



setIndent
public void setIndent(int indent)(Code)
Sets the indentation. The document will not be indented if the indentation is set to zero. Calling OutputFormat.setIndenting will reset this value to zero (off) or the default (on).
Parameters:
  indent - The indentation, or zero



setIndenting
public void setIndenting(boolean on)(Code)
Sets the indentation on and off. When set on, the default indentation level and default line wrapping is used (see OutputFormat.DEFAULT_INDENT and OutputFormat.DEFAULT_LINE_WIDTH ). To specify a different indentation level or line wrapping, use OutputFormat.setIndent and OutputFormat.setLineWidth .
Parameters:
  on - True if indentation should be on



setLineSeparator
public void setLineSeparator(String lineSeparator)(Code)
Sets the line separator. The default is the Web line separator (\n). The machine's line separator can be obtained from the system property line.separator, but is only useful if the document is edited on machines of the same type. For general documents, use the Web line separator.
Parameters:
  lineSeparator - The specified line separator



setLineWidth
public void setLineWidth(int lineWidth)(Code)
Sets the line width. If zero then no line wrapping will occur. Calling OutputFormat.setIndenting will reset this value to zero (off) or the default (on).
Parameters:
  lineWidth - The line width to use, zero for default
See Also:   OutputFormat.getLineWidth
See Also:   OutputFormat.setIndenting



setMediaType
public void setMediaType(String mediaType)(Code)
Sets the media type.
See Also:   OutputFormat.getMediaType
Parameters:
  mediaType - The specified media type



setMethod
public void setMethod(String method)(Code)
Sets the method for this output format.
See Also:   OutputFormat.getMethod
Parameters:
  method - The output method, or null



setNonEscapingElements
public void setNonEscapingElements(String[] nonEscapingElements)(Code)
Sets the list of elements for which text node children should be output unescaped (no character references).
Parameters:
  nonEscapingElements - List of unescaped element tag names



setOmitComments
public void setOmitComments(boolean omit)(Code)
Sets comment omitting on and off.
Parameters:
  omit - True if comments should be ommited



setOmitDocumentType
public void setOmitDocumentType(boolean omit)(Code)
Sets DOCTYPE declaration omitting on and off.
Parameters:
  omit - True if DOCTYPE declaration should be ommited



setOmitXMLDeclaration
public void setOmitXMLDeclaration(boolean omit)(Code)
Sets XML declaration omitting on and off.
Parameters:
  omit - True if XML declaration should be ommited



setPreserveEmptyAttributes
public void setPreserveEmptyAttributes(boolean preserve)(Code)
Sets the preserveEmptyAttribute flag. If flag is false, then' attributes with empty string values are output as the attribute name only (in HTML mode).
Parameters:
  preserve - the preserve flag



setPreserveSpace
public void setPreserveSpace(boolean preserve)(Code)
Sets space preserving as the default behavior. The default is space stripping and all elements that do not specify otherwise or use the default value will not preserve spaces.
Parameters:
  preserve - True if spaces should be preserved



setStandalone
public void setStandalone(boolean standalone)(Code)
Sets document DTD standalone. The public and system identifiers must be null for the document to be serialized as standalone.
Parameters:
  standalone - True if document DTD is standalone



setVersion
public void setVersion(String version)(Code)
Sets the version for this output method. For XML the value would be "1.0", for HTML it would be "4.0".
See Also:   OutputFormat.getVersion
Parameters:
  version - The output method version, or null



whichDoctypePublic
public static String whichDoctypePublic(Document doc)(Code)
Returns the document type public identifier specified for this document, or null.



whichDoctypeSystem
public static String whichDoctypeSystem(Document doc)(Code)
Returns the document type system identifier specified for this document, or null.



whichMediaType
public static String whichMediaType(String method)(Code)
Returns the suitable media format for a document output with the specified method.



whichMethod
public static String whichMethod(Document doc)(Code)
Determine the output method for the specified document. If the document is an instance of org.w3c.dom.html.HTMLDocument then the method is said to be html. If the root element is 'html' and all text nodes preceding the root element are all whitespace, then the method is said to be html. Otherwise the method is xml.
Parameters:
  doc - The document to check The suitable method



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.