Java Doc for XMLUtils.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » 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 » Content Management System » apache lenya 2.0 » org.apache.cocoon.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.cocoon.xml.XMLUtils

XMLUtils
public class XMLUtils (Code)
XML utility methods.
author:
   Nicola Ken Barozzi
author:
   Sylvain Wallez
author:
   Carsten Ziegeler
version:
   $Id: XMLUtils.java 433543 2006-08-22 06:22:54Z crossley $


Field Summary
final public static  AttributesEMPTY_ATTRIBUTES
     Empty attributes immutable object.


Method Summary
public static  voidcreateElement(ContentHandler contentHandler, String localName)
    
public static  voidcreateElement(ContentHandler contentHandler, String localName, String stringValue)
    
public static  voidcreateElement(ContentHandler contentHandler, String localName, Attributes atts)
     Create a start and endElement with a empty Namespace
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element.
public static  voidcreateElement(ContentHandler contentHandler, String localName, Attributes atts, String stringValue)
     Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element.
public static  voidcreateElementNS(ContentHandler contentHandler, String namespaceURI, String localName)
    
public static  voidcreateElementNS(ContentHandler contentHandler, String namespaceURI, String localName, String stringValue)
    
public static  voidcreateElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts)
     Create a start and endElement
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element.
public static  voidcreateElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts, String stringValue)
     Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element.
public static  PropertiescreatePropertiesForXML(boolean omitXMLDeclaration)
     Create a new properties set for serializing xml.
public static  voiddata(ContentHandler contentHandler, String data)
    
public static  PropertiesdefaultSerializeToXMLFormat()
     This is the default properties set used to serialize xml.
public static  PropertiesdefaultSerializeToXMLFormat(boolean omitXMLDeclaration)
     This is the default properties set used to serialize xml.
public static  voidendElement(ContentHandler contentHandler, String localName)
    
public static  voidendElement(ContentHandler contentHandler, String namespaceURI, String localName)
    
public static  XMLConsumergetConsumer(ContentHandler ch, LexicalHandler lh)
     Get an XMLConsumer from a ContentHandler and a LexicalHandler.
public static  XMLConsumergetConsumer(ContentHandler ch)
     Get an XMLConsumer from ContentHandler.
public static  Stringserialize(org.apache.excalibur.xml.sax.XMLizable xml, Properties format)
     Serialize a XMLizable into a string.
public static  StringserializeNode(Node node)
     Serialize a DOM node into a string using format created by createPropertiesForXML(false).
public static  StringserializeNode(Node node, Properties format)
     Serialize a DOM node into a string.
public static  StringserializeNodeToXML(Node node)
     Serialize a DOM node to a String.
public static  voidstartElement(ContentHandler contentHandler, String localName)
    
public static  voidstartElement(ContentHandler contentHandler, String namespaceURI, String localName)
    
public static  voidstartElement(ContentHandler contentHandler, String localName, Attributes atts)
     Create a startElement with a empty Namespace
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element.
public static  voidstartElement(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts)
     Create a startElement with a empty Namespace Prefix must be mapped to empty String
Parameters:
  namespaceURI - The Namespace URI
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element.
public static  voidstripDuplicateAttributes(Node node, Node parent)
    
public static  voidvalueOf(ContentHandler contentHandler, String text)
     Implementation of <xsp:expr> for String : outputs characters representing the value.
public static  voidvalueOf(ContentHandler contentHandler, org.apache.excalibur.xml.sax.XMLizable v)
     Implementation of <xsp:expr> for XMLizable : outputs the value by calling v.toSax(contentHandler).
public static  voidvalueOf(ContentHandler contentHandler, Node v)
     Implementation of <xsp:expr> for org.w3c.dom.Node : converts the Node to a SAX event stream.
public static  voidvalueOf(ContentHandler contentHandler, Collection v)
     Implementation of <xsp:expr> for java.util.Collection : outputs the value by calling xspExpr() on each element of the collection.
public static  voidvalueOf(ContentHandler contentHandler, Object v)
    

Field Detail
EMPTY_ATTRIBUTES
final public static Attributes EMPTY_ATTRIBUTES(Code)
Empty attributes immutable object.





Method Detail
createElement
public static void createElement(ContentHandler contentHandler, String localName) throws SAXException(Code)
Create a start and endElement with a empty Namespace and without Attributes
Parameters:
  localName - The local name (without prefix)
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)



createElement
public static void createElement(ContentHandler contentHandler, String localName, String stringValue) throws SAXException(Code)
Create a start and endElement with a empty Namespace and without Attributes The content of the Element is set to the stringValue parameter
Parameters:
  localName - The local name (without prefix)
Parameters:
  stringValue - The content of the Element
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)



createElement
public static void createElement(ContentHandler contentHandler, String localName, Attributes atts) throws SAXException(Code)
Create a start and endElement with a empty Namespace
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element. Ifthere are no attributes, it shall be an emptyAttributes object.
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)
See Also:   org.xml.sax.Attributes



createElement
public static void createElement(ContentHandler contentHandler, String localName, Attributes atts, String stringValue) throws SAXException(Code)
Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element. Ifthere are no attributes, it shall be an emptyAttributes object.
Parameters:
  stringValue - The content of the Element
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)
See Also:   org.xml.sax.Attributes



createElementNS
public static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName) throws SAXException(Code)
Create a start and endElement without Attributes
Parameters:
  localName - The local name (without prefix)
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)



createElementNS
public static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, String stringValue) throws SAXException(Code)
Create a start and endElement without Attributes The content of the Element is set to the stringValue parameter
Parameters:
  localName - The local name (without prefix)
Parameters:
  stringValue - The content of the Element
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)



createElementNS
public static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts) throws SAXException(Code)
Create a start and endElement
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element. Ifthere are no attributes, it shall be an emptyAttributes object.
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)
See Also:   org.xml.sax.Attributes



createElementNS
public static void createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts, String stringValue) throws SAXException(Code)
Create a start and endElement with a empty Namespace The content of the Element is set to the stringValue parameter
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element. Ifthere are no attributes, it shall be an emptyAttributes object.
Parameters:
  stringValue - The content of the Element
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)
See Also:   org.xml.sax.Attributes



createPropertiesForXML
public static Properties createPropertiesForXML(boolean omitXMLDeclaration)(Code)
Create a new properties set for serializing xml. The omit xml declaration property can be controlled by the flag.
  • Method: xml
  • Omit xml declaration: according to the flag
  • Indent: yes



data
public static void data(ContentHandler contentHandler, String data) throws SAXException(Code)
Add string data
Parameters:
  contentHandler - The SAX content handler
Parameters:
  data - The string data



defaultSerializeToXMLFormat
public static Properties defaultSerializeToXMLFormat()(Code)
This is the default properties set used to serialize xml. It is used by the serializeNodeToXML() method. The format is as follows: Method: xml Encoding: ISO-8859-1 Omit xml declaration: no Indent: yes



defaultSerializeToXMLFormat
public static Properties defaultSerializeToXMLFormat(boolean omitXMLDeclaration)(Code)
This is the default properties set used to serialize xml. It is used by the serializeNodeToXML() method. The omit xml declaration property can be controlled by the flag. Method: xml Encoding: ISO-8859-1 Omit xml declaration: according to the flag Indent: yes



endElement
public static void endElement(ContentHandler contentHandler, String localName) throws SAXException(Code)
Create endElement with empty Namespace

For information on the names, see startElement.


Parameters:
  localName - The local name (without prefix)
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.



endElement
public static void endElement(ContentHandler contentHandler, String namespaceURI, String localName) throws SAXException(Code)
Create endElement Prefix must be mapped to empty String

For information on the names, see startElement.


Parameters:
  localName - The local name (without prefix)
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.



getConsumer
public static XMLConsumer getConsumer(ContentHandler ch, LexicalHandler lh)(Code)
Get an XMLConsumer from a ContentHandler and a LexicalHandler. If the content handler is already an XMLConsumer, it is returned as is, otherwise it is wrapped in an XMLConsumer with the lexical handler.
Parameters:
  ch - the content handler, which should not be null
Parameters:
  lh - the lexical handler, which can be null an XMLConsumer for ch an lh



getConsumer
public static XMLConsumer getConsumer(ContentHandler ch)(Code)
Get an XMLConsumer from ContentHandler. If the content handler is already an XMLConsumer, it is returned as is, otherwise it is wrapped in an XMLConsumer.
Parameters:
  ch - the content handler, which should not be null an XMLConsumer for ch



serialize
public static String serialize(org.apache.excalibur.xml.sax.XMLizable xml, Properties format) throws ProcessingException(Code)
Serialize a XMLizable into a string. If the object is null the empty string is returned.
Parameters:
  format - The format of the output to be used by SAX transformer.
See Also:   OutputKeys



serializeNode
public static String serializeNode(Node node) throws ProcessingException(Code)
Serialize a DOM node into a string using format created by createPropertiesForXML(false).
See Also:   XMLUtils.createPropertiesForXML



serializeNode
public static String serializeNode(Node node, Properties format) throws ProcessingException(Code)
Serialize a DOM node into a string. If the node is null the empty string is returned.
Parameters:
  format - The format of the output to be used by SAX transformer.
See Also:   OutputKeys



serializeNodeToXML
public static String serializeNodeToXML(Node node) throws ProcessingException(Code)
Serialize a DOM node to a String. The defaultSerializeToXMLFormat() is used to format the serialized xml.



startElement
public static void startElement(ContentHandler contentHandler, String localName) throws SAXException(Code)
Create a startElement with a empty Namespace and without Attributes
Parameters:
  localName - The local name (without prefix)
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)



startElement
public static void startElement(ContentHandler contentHandler, String namespaceURI, String localName) throws SAXException(Code)
Create a startElement without Attributes Prefix must be mapped to empty String
Parameters:
  namespaceURI - The Namespace URI
Parameters:
  localName - The local name (without prefix)
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)



startElement
public static void startElement(ContentHandler contentHandler, String localName, Attributes atts) throws SAXException(Code)
Create a startElement with a empty Namespace
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element. Ifthere are no attributes, it shall be an emptyAttributes object.
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)
See Also:   org.xml.sax.Attributes



startElement
public static void startElement(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts) throws SAXException(Code)
Create a startElement with a empty Namespace Prefix must be mapped to empty String
Parameters:
  namespaceURI - The Namespace URI
Parameters:
  localName - The local name (without prefix)
Parameters:
  atts - The attributes attached to the element. Ifthere are no attributes, it shall be an emptyAttributes object.
exception:
  org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception.
See Also:   XMLUtils.endElement(ContentHandler,String)
See Also:   org.xml.sax.Attributes



stripDuplicateAttributes
public static void stripDuplicateAttributes(Node node, Node parent)(Code)



valueOf
public static void valueOf(ContentHandler contentHandler, String text) throws SAXException(Code)
Implementation of <xsp:expr> for String : outputs characters representing the value.
Parameters:
  contentHandler - the SAX content handler
Parameters:
  text - the value



valueOf
public static void valueOf(ContentHandler contentHandler, org.apache.excalibur.xml.sax.XMLizable v) throws SAXException(Code)
Implementation of <xsp:expr> for XMLizable : outputs the value by calling v.toSax(contentHandler).
Parameters:
  contentHandler - the SAX content handler
Parameters:
  v - the XML fragment



valueOf
public static void valueOf(ContentHandler contentHandler, Node v) throws SAXException(Code)
Implementation of <xsp:expr> for org.w3c.dom.Node : converts the Node to a SAX event stream.
Parameters:
  contentHandler - the SAX content handler
Parameters:
  v - the value



valueOf
public static void valueOf(ContentHandler contentHandler, Collection v) throws SAXException(Code)
Implementation of <xsp:expr> for java.util.Collection : outputs the value by calling xspExpr() on each element of the collection.
Parameters:
  contentHandler - the SAX content handler
Parameters:
  v - the XML fragment



valueOf
public static void valueOf(ContentHandler contentHandler, Object v) throws SAXException(Code)
Implementation of <xsp:expr> for Object depending on its class :
  • if it's an array, call xspExpr() on all its elements,
  • if it's class has a specific xspExpr()implementation, use it,
  • else, output it's string representation.

Parameters:
  contentHandler - the SAX content handler
Parameters:
  v - the value



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.