Java Doc for DOMElementWriter.java in  » Build » ANT » org » apache » tools » ant » util » 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 » Build » ANT » org.apache.tools.ant.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.ant.util.DOMElementWriter

DOMElementWriter
public class DOMElementWriter (Code)
Writes a DOM tree to a given Writer. warning: this utility currently does not declare XML Namespaces.

Utility class used by org.apache.tools.ant.XmlLoggerXmlLogger and org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter XMLJUnitResultFormatter}.


Inner Class :public static class XmlNamespacePolicy

Field Summary
protected  String[]knownEntities
     Don't try to be too smart but at least recognize the predefined entities.

Constructor Summary
public  DOMElementWriter()
     Create an element writer.
public  DOMElementWriter(boolean xmlDeclaration)
     Create an element writer XML namespaces will be ignored.
public  DOMElementWriter(boolean xmlDeclaration, XmlNamespacePolicy namespacePolicy)
     Create an element writer XML namespaces will be ignored.

Method Summary
public  voidcloseElement(Element element, Writer out, int indent, String indentWith, boolean hasChildren)
     Writes a DOM tree to a stream.
public  Stringencode(String value)
     Escape <, > & ', " as their entities and drop characters that are illegal in XML documents.
Parameters:
  value - the string to encode.
public  Stringencodedata(String value)
     Drop characters that are illegal in XML documents.

Also ensure that we are not including an ]]> marker by replacing that sequence with &#x5d;&#x5d;&gt;.

See XML 1.0 2.2 http://www.w3.org/TR/1998/REC-xml-19980210#charsets and 2.7 http://www.w3.org/TR/1998/REC-xml-19980210#sec-cdata-sect.


Parameters:
  value - the value to be encoded.
public  booleanisLegalCharacter(char c)
     Is the given character allowed inside an XML document?

See XML 1.0 2.2 http://www.w3.org/TR/1998/REC-xml-19980210#charsets.


Parameters:
  c - the character to test.
public  booleanisReference(String ent)
     Is the given argument a character or entity reference?
Parameters:
  ent - the value to be checked.
public  voidopenElement(Element element, Writer out, int indent, String indentWith)
     Writes the opening tag - including all attributes - corresponding to a DOM element.
public  voidopenElement(Element element, Writer out, int indent, String indentWith, boolean hasChildren)
     Writes the opening tag - including all attributes - corresponding to a DOM element.
public  voidwrite(Element root, OutputStream out)
     Writes a DOM tree to a stream in UTF8 encoding.
public  voidwrite(Element element, Writer out, int indent, String indentWith)
     Writes a DOM tree to a stream.
public  voidwriteXMLDeclaration(Writer wri)
     Writes the XML declaration if xmlDeclaration is true.

Field Detail
knownEntities
protected String[] knownEntities(Code)
Don't try to be too smart but at least recognize the predefined entities.




Constructor Detail
DOMElementWriter
public DOMElementWriter()(Code)
Create an element writer. The ?xml? declaration will be included, namespaces ignored.



DOMElementWriter
public DOMElementWriter(boolean xmlDeclaration)(Code)
Create an element writer XML namespaces will be ignored.
Parameters:
  xmlDeclaration - flag to indicate whether the ?xml? declarationshould be included.
since:
   Ant1.7



DOMElementWriter
public DOMElementWriter(boolean xmlDeclaration, XmlNamespacePolicy namespacePolicy)(Code)
Create an element writer XML namespaces will be ignored.
Parameters:
  xmlDeclaration - flag to indicate whether the ?xml? declarationshould be included.
Parameters:
  namespacePolicy - the policy to use.
since:
   Ant1.7




Method Detail
closeElement
public void closeElement(Element element, Writer out, int indent, String indentWith, boolean hasChildren) throws IOException(Code)
Writes a DOM tree to a stream.
Parameters:
  element - the Root DOM element of the tree
Parameters:
  out - where to send the output
Parameters:
  indent - number of
Parameters:
  indentWith - string that should be used to indent thecorresponding tag.
Parameters:
  hasChildren - if true indent.
throws:
  IOException - if an error happens while writing to the stream.



encode
public String encode(String value)(Code)
Escape <, > & ', " as their entities and drop characters that are illegal in XML documents.
Parameters:
  value - the string to encode. the encoded string.



encodedata
public String encodedata(String value)(Code)
Drop characters that are illegal in XML documents.

Also ensure that we are not including an ]]> marker by replacing that sequence with &#x5d;&#x5d;&gt;.

See XML 1.0 2.2 http://www.w3.org/TR/1998/REC-xml-19980210#charsets and 2.7 http://www.w3.org/TR/1998/REC-xml-19980210#sec-cdata-sect.


Parameters:
  value - the value to be encoded. the encoded value.



isLegalCharacter
public boolean isLegalCharacter(char c)(Code)
Is the given character allowed inside an XML document?

See XML 1.0 2.2 http://www.w3.org/TR/1998/REC-xml-19980210#charsets.


Parameters:
  c - the character to test. true if the character is allowed.
since:
   1.10, Ant 1.5



isReference
public boolean isReference(String ent)(Code)
Is the given argument a character or entity reference?
Parameters:
  ent - the value to be checked. true if it is an entity.



openElement
public void openElement(Element element, Writer out, int indent, String indentWith) throws IOException(Code)
Writes the opening tag - including all attributes - corresponding to a DOM element.
Parameters:
  element - the DOM element to write
Parameters:
  out - where to send the output
Parameters:
  indent - number of
Parameters:
  indentWith - string that should be used to indent thecorresponding tag.
throws:
  IOException - if an error happens while writing to the stream.



openElement
public void openElement(Element element, Writer out, int indent, String indentWith, boolean hasChildren) throws IOException(Code)
Writes the opening tag - including all attributes - corresponding to a DOM element.
Parameters:
  element - the DOM element to write
Parameters:
  out - where to send the output
Parameters:
  indent - number of
Parameters:
  indentWith - string that should be used to indent thecorresponding tag.
Parameters:
  hasChildren - whether this element has children.
throws:
  IOException - if an error happens while writing to the stream.
since:
   Ant 1.7



write
public void write(Element root, OutputStream out) throws IOException(Code)
Writes a DOM tree to a stream in UTF8 encoding. Note that it prepends the <?xml version='1.0' encoding='UTF-8'?> if the xmlDeclaration field is true. The indent number is set to 0 and a 2-space indent.
Parameters:
  root - the root element of the DOM tree.
Parameters:
  out - the outputstream to write to.
throws:
  IOException - if an error happens while writing to the stream.



write
public void write(Element element, Writer out, int indent, String indentWith) throws IOException(Code)
Writes a DOM tree to a stream.
Parameters:
  element - the Root DOM element of the tree
Parameters:
  out - where to send the output
Parameters:
  indent - number of
Parameters:
  indentWith - string that should be used to indent thecorresponding tag.
throws:
  IOException - if an error happens while writing to the stream.



writeXMLDeclaration
public void writeXMLDeclaration(Writer wri) throws IOException(Code)
Writes the XML declaration if xmlDeclaration is true.
Parameters:
  wri - the writer to write to.
throws:
  IOException - if there is an error.
since:
   Ant 1.7.0



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.