Java Doc for DocumentWriter.java in  » Database-ORM » MMBase » org » mmbase » util » xml » 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 » Database ORM » MMBase » org.mmbase.util.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.util.xml.DocumentReader
      org.mmbase.util.xml.DocumentWriter

All known Subclasses:   org.mmbase.util.xml.ApplicationWriter,  org.mmbase.util.xml.ModuleWriter,  org.mmbase.util.xml.BuilderWriter,
DocumentWriter
abstract public class DocumentWriter extends DocumentReader (Code)
Abstract class for creating xml documents. Use this class as the base class for writers that construct and export DOM documents. The document can then be used internally or serialized using a number of utility methods.
since:
   MMBase-1.6
author:
   Pierre van Rooden
version:
   $Id: DocumentWriter.java,v 1.11 2007/02/24 21:57:50 nklasens Exp $


Field Summary
 StringpublicId
    
 StringsystemId
    

Constructor Summary
public  DocumentWriter(String qualifiedName, String publicId, String systemId)
     Constructs the document writer.
public  DocumentWriter(InputSource source)
     Constructs the document by reading it from a source.
public  DocumentWriter(InputSource source, boolean validating, Class resolveBase)
     Constructs the document by reading it from a source. You can pass a resolve class to this constructor, allowing you to indicate the package in which the dtd of the document read is to be found.

Method Summary
protected  CommentaddComment(String key, Element out)
     Creates a Comment (provided comments should be included), and adds it to the specified node as a child. The comment is retrieved from a resource bundle - if no resource was specified, no comments are added.
Parameters:
  key - the key of the comment to add as a string
Parameters:
  out - the element to which to add the new Comment.
protected  CommentaddComment(String key, String a1, Element out)
     Creates a Comment (provided comments should be included), and adds it to the specified node as a child. The comment is retrieved from a resource bundle - if no resource was specified, no comments are added.
Parameters:
  key - the key of the comment to add as a string
Parameters:
  a1 - the first parameter to substitute in the comment
Parameters:
  out - the element to which to add the new Comment.
protected  CommentaddComment(String key, String a1, String a2, Element out)
     Creates a Comment (provided comments should be included), and adds it to the specified node as a child. The comment is retrieved from a resource bundle - if no resource was specified, no comments are added.
Parameters:
  key - the comment to add as a string
Parameters:
  a1 - the first parameter to substitute in the comment
Parameters:
  a2 - the second parameter to substitute in the comment
Parameters:
  out - the element to which to add the new Comment.
protected  ElementaddContentElement(String tagname, String content, Element out)
     Creates a DOM element which contains a Text Node, and adds it to the specified node as a child.
Parameters:
  tagname - name of the new element
Parameters:
  content - content of the new element as a string
Parameters:
  out - the element to which to add the new Element.
abstract protected  voidgenerate()
     Generates the document.
final public  DocumentgenerateDocument()
     Generates the document if it hadn't be done so already.
public  DocumentgetDocument()
     Returns the completed document representation; If the document was not yet generated, it is generated by calling generateDocument().
protected  StringgetMessage(String key)
     Retrieves a message from the resource bundle.
protected  StringgetMessage(String key, String a1)
     Retrieves a message from the resource bundle.
protected  StringgetMessage(String key, String a1, String a2)
     Retrieves a message from the resource bundle.
protected  StringgetMessage(String key, String a1, String a2, String a3)
     Retrieves a message from the resource bundle.
protected  voidgetMessageRetriever(String resourcelocation)
     Initialize the ResourceBundle with the given resource.
public  booleanincludeComments()
    
public  voidsetIncludeComments(boolean value)
    
public  voidwrite(StreamResult result)
     Generates the document and writes it to the result object.
public  voidwriteToFile(String filename)
     Generates the document and store it as a file in the given path.
public  voidwriteToStream(OutputStream out)
     Generates the document and store it in the given stream.
public  StringwriteToString()
     Generates the document and returns it as a string.

Field Detail
publicId
String publicId(Code)



systemId
String systemId(Code)




Constructor Detail
DocumentWriter
public DocumentWriter(String qualifiedName, String publicId, String systemId) throws DOMException(Code)
Constructs the document writer. The constructor creates a basic document with a root element based on the specified document type parameters. The document is empty after construction. It is actually filled with a call to DocumentWriter.generateDocument() , which is in turn called when the document is first accessed through DocumentWriter.getDocument() .
Parameters:
  qualifiedName - the qualified name of the document's root element
Parameters:
  publicId - the PUBLIC id of the document type
Parameters:
  systemId - the SYSTEm id of the document type



DocumentWriter
public DocumentWriter(InputSource source)(Code)
Constructs the document by reading it from a source.
Parameters:
  source - the input source from which to read the document
since:
   MMBase-1.7



DocumentWriter
public DocumentWriter(InputSource source, boolean validating, Class resolveBase)(Code)
Constructs the document by reading it from a source. You can pass a resolve class to this constructor, allowing you to indicate the package in which the dtd of the document read is to be found. The dtd sould be in the resources package under the package of the class passed.
Parameters:
  source - the input source from which to read the document
Parameters:
  validating - whether to validate the document
Parameters:
  resolveBase - the base class whose package is used to resolve dtds, set to null if unknown
since:
   MMBase-1.7




Method Detail
addComment
protected Comment addComment(String key, Element out)(Code)
Creates a Comment (provided comments should be included), and adds it to the specified node as a child. The comment is retrieved from a resource bundle - if no resource was specified, no comments are added.
Parameters:
  key - the key of the comment to add as a string
Parameters:
  out - the element to which to add the new Comment. the newly created comment or null if nothing was added
See Also:   DocumentWriter.setIncludeComments



addComment
protected Comment addComment(String key, String a1, Element out)(Code)
Creates a Comment (provided comments should be included), and adds it to the specified node as a child. The comment is retrieved from a resource bundle - if no resource was specified, no comments are added.
Parameters:
  key - the key of the comment to add as a string
Parameters:
  a1 - the first parameter to substitute in the comment
Parameters:
  out - the element to which to add the new Comment. the newly created comment or null if nothing was added
See Also:   DocumentWriter.setIncludeComments



addComment
protected Comment addComment(String key, String a1, String a2, Element out)(Code)
Creates a Comment (provided comments should be included), and adds it to the specified node as a child. The comment is retrieved from a resource bundle - if no resource was specified, no comments are added.
Parameters:
  key - the comment to add as a string
Parameters:
  a1 - the first parameter to substitute in the comment
Parameters:
  a2 - the second parameter to substitute in the comment
Parameters:
  out - the element to which to add the new Comment. the newly created comment or null if nothing was added
See Also:   DocumentWriter.setIncludeComments



addContentElement
protected Element addContentElement(String tagname, String content, Element out)(Code)
Creates a DOM element which contains a Text Node, and adds it to the specified node as a child.
Parameters:
  tagname - name of the new element
Parameters:
  content - content of the new element as a string
Parameters:
  out - the element to which to add the new Element. the newly created element



generate
abstract protected void generate() throws DOMException(Code)
Generates the document. You need to override this class with the code that constructs your document.
throws:
  DOMException - when an error occurred during generation



generateDocument
final public Document generateDocument() throws DOMException(Code)
Generates the document if it hadn't be done so already. If not, an exception is thrown. Use getDocument() to safely retrive a generated coeumnt.
throws:
  DOMException - when an error occurred during generation
throws:
  DOMException - when the document was already constructed



getDocument
public Document getDocument() throws DOMException(Code)
Returns the completed document representation; If the document was not yet generated, it is generated by calling generateDocument(). the generated document
throws:
  DOMException - when an error occurred during generation



getMessage
protected String getMessage(String key)(Code)
Retrieves a message from the resource bundle.
Parameters:
  key - the key of the message



getMessage
protected String getMessage(String key, String a1)(Code)
Retrieves a message from the resource bundle.
Parameters:
  key - the key of the message
Parameters:
  a1 - the first parameter to substitute in the message



getMessage
protected String getMessage(String key, String a1, String a2)(Code)
Retrieves a message from the resource bundle.
Parameters:
  key - the key of the message
Parameters:
  a1 - the first parameter to substitute in the message
Parameters:
  a2 - the second parameter to substitute in the message



getMessage
protected String getMessage(String key, String a1, String a2, String a3)(Code)
Retrieves a message from the resource bundle.
Parameters:
  key - the key of the message
Parameters:
  a1 - the first parameter to substitute in the message
Parameters:
  a2 - the second parameter to substitute in the message
Parameters:
  a3 - the third parameter to substitute in the message



getMessageRetriever
protected void getMessageRetriever(String resourcelocation)(Code)
Initialize the ResourceBundle with the given resource. You need a respource to use the addfCOmment() and getMessage() methods.
Parameters:
  resourcelocation - Resource.



includeComments
public boolean includeComments()(Code)
Gets whether the document will include comments if true, the document will include comments



setIncludeComments
public void setIncludeComments(boolean value)(Code)
Sets whether the document will include comments
Parameters:
  value - if true, the document will include comments



write
public void write(StreamResult result) throws TransformerException(Code)
Generates the document and writes it to the result object.
Parameters:
  result - the StreamResult object where to store the configuration'



writeToFile
public void writeToFile(String filename) throws IOException, TransformerException(Code)
Generates the document and store it as a file in the given path.
Parameters:
  filename - the filepath where the configuration is to be stored
throws:
  TransformerException - if the document is malformed
throws:
  IOException - if the file cannot be written



writeToStream
public void writeToStream(OutputStream out) throws TransformerException(Code)
Generates the document and store it in the given stream.
Parameters:
  out - the output stream where the configuration is to be stored



writeToString
public String writeToString() throws TransformerException(Code)
Generates the document and returns it as a string.
throws:
  TransformerException - if the document is malformed



Fields inherited from org.mmbase.util.xml.DocumentReader
final public static String DTD_ERROR(Code)(Java Doc)
final public static String DTD_ERROR_1_0(Code)(Java Doc)
final protected static String FILENOTFOUND(Code)(Java Doc)
final public static String PUBLIC_ID_ERROR(Code)(Java Doc)
final public static String PUBLIC_ID_ERROR_1_0(Code)(Java Doc)
protected Document document(Code)(Java Doc)
static UtilReader.PropertiesMap<String> utilProperties(Code)(Java Doc)

Methods inherited from org.mmbase.util.xml.DocumentReader
public static void appendChild(Element parent, Element newChild, String path)(Code)(Java Doc)
public static String getAttribute(Element element, String nameSpace, String localName)(Code)(Java Doc)
public List<Element> getChildElements(String path)(Code)(Java Doc)
public List<Element> getChildElements(Element e)(Code)(Java Doc)
public List<Element> getChildElements(String path, String tag)(Code)(Java Doc)
public List<Element> getChildElements(Element e, String tag)(Code)(Java Doc)
public static DocumentBuilder getDocumentBuilder()(Code)(Java Doc)
public static DocumentBuilder getDocumentBuilder(boolean validating)(Code)(Java Doc)
public static DocumentBuilder getDocumentBuilder(boolean validating, ErrorHandler handler, EntityResolver resolver)(Code)(Java Doc)
public static DocumentBuilder getDocumentBuilder(boolean validating, boolean xsd, ErrorHandler handler, EntityResolver resolver)(Code)(Java Doc)
public String getElementAttributeValue(String path, String attr)(Code)(Java Doc)
public String getElementAttributeValue(Element e, String attr)(Code)(Java Doc)
public Element getElementByPath(String path)(Code)(Java Doc)
public Element getElementByPath(Element e, String path)(Code)(Java Doc)
public String getElementName(Element e)(Code)(Java Doc)
public String getElementValue(String path)(Code)(Java Doc)
public String getElementValue(Element e)(Code)(Java Doc)
public static String getNodeTextValue(Node n)(Code)(Java Doc)
public static String getNodeTextValue(Node n, boolean trim)(Code)(Java Doc)
public Element getRootElement()(Code)(Java Doc)
public String getSystemId()(Code)(Java Doc)
public static boolean hasAttribute(Element element, String nameSpace, String localName)(Code)(Java Doc)
public static void main(String argv) throws Exception(Code)(Java Doc)
public static void registerPublicIDs()(Code)(Java Doc)
public static void setNodeTextValue(Node n, String value)(Code)(Java Doc)
public static void setPrefix(Document d, String ns, String prefix)(Code)(Java Doc)
public void setSystemId(String url)(Code)(Java Doc)
public static Document toDocument(Element element)(Code)(Java Doc)
final protected static boolean validate()(Code)(Java Doc)
final protected static boolean validate(boolean requested)(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.