Java Doc for XMLUtil.java in  » Portal » stringbeans-3.5 » com » nabhinc » 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 » Portal » stringbeans 3.5 » com.nabhinc.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.nabhinc.util.XMLUtil

XMLUtil
abstract public class XMLUtil (Code)
Miscelleneous XML utility methods that help extract text and elements from a DOM tree.
author:
   Padmanabh Dabke (c) 2001,2003 Nabh Information Systems, Inc. All
author:
   Rights Reserved.


Field Summary
public static  StringLINE_FEED
     Line feed string.


Method Summary
public static  StringgetChildCharacterData(Element parentEl)
     Concat all the text and cdata node children of this elem and return the resulting text.
Parameters:
  parentEl - the element whose cdata/text node values are to be combined.
public static  StringgetElementText(Element n)
     Returns the text body of the element.
public static  ElementgetFirstSubElement(Element el)
     Returns first direct child that is an XML element.
public static  ElementgetRootElementFromString(String xmlSpec)
     Parses given XML string and returns the document root element.
public static  ElementgetRootElementFromURL(String urlStr)
     Reads XML data from the given URL, parses it, and returns the document root element.
public static  ElementgetSubElement(Element el, String tag)
     Returns first direct child element with the given tag.
public static  ElementgetSubElementRecursive(Element el, String tag)
     Returns first direct child element with the given tag.
public static  StringgetSubElementText(Element el, String tag)
     Returns the text body of the first subelement with given tag.
public static  StringgetSubElementText(Element el, String tag, String defaul)
     Returns the text body of the first subelement with given tag.
public static  intgetSubElementTextAsInt(Element el, String tag)
     Uses getSubElementText to get the value of a subnode, converts it to int and returns it.
public static  StringgetSubElementTextGlobal(Element el, String tag)
     Returns the text body of the first subelement with given tag with any XML scope.
public static  StringgetSubElementTextRecursive(Element el, String tag)
     Returns the text body of the first subelement with given tag.
public static  StringgetSubElementTextRecursive(Element el, String tag, String defaul)
     Returns the text body of the first subelement with given tag.
public static  Element[]getSubElements(Element el, String tag)
     Returns all direct child element with the given tag.
public static  voidwriteElement(Object elem, String tag, java.io.Writer w)
     Writes an XML element with the given tag.
public static  voidwriteElement(String indent, String tag, String value, Writer w)
    
public static  voidwriteElementEnd(String indent, String tag, Writer w)
    
public static  voidwriteElementStart(String indent, String tag, Writer w)
    
public static  voidwriteEmptyElement(String indent, String tag, Writer w)
    

Field Detail
LINE_FEED
public static String LINE_FEED(Code)
Line feed string. Useful in writing multiline text files.





Method Detail
getChildCharacterData
public static String getChildCharacterData(Element parentEl)(Code)
Concat all the text and cdata node children of this elem and return the resulting text.
Parameters:
  parentEl - the element whose cdata/text node values are to be combined. the concatanated string.



getElementText
public static String getElementText(Element n)(Code)
Returns the text body of the element. Returns null if there is no body. Direct children with the given tag
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for



getFirstSubElement
public static Element getFirstSubElement(Element el)(Code)
Returns first direct child that is an XML element. First child that is an XML element
Parameters:
  el - Parent element



getRootElementFromString
public static Element getRootElementFromString(String xmlSpec) throws IOException, org.xml.sax.SAXException, ParserConfigurationException, FactoryConfigurationError(Code)
Parses given XML string and returns the document root element. Root element within the document
Parameters:
  xmlSpec - A string containing an XML doc



getRootElementFromURL
public static Element getRootElementFromURL(String urlStr) throws IOException, org.xml.sax.SAXException, ParserConfigurationException, FactoryConfigurationError(Code)
Reads XML data from the given URL, parses it, and returns the document root element. Root element within the document
Parameters:
  urlStr - URL string pointing to an XML document



getSubElement
public static Element getSubElement(Element el, String tag)(Code)
Returns first direct child element with the given tag. Firstirect child with the given tag or null
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for



getSubElementRecursive
public static Element getSubElementRecursive(Element el, String tag)(Code)
Returns first direct child element with the given tag. Firstirect child with the given tag or null
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for



getSubElementText
public static String getSubElementText(Element el, String tag)(Code)
Returns the text body of the first subelement with given tag. Returns null if it does not find a node with the given tag. Direct children with the given tag
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for



getSubElementText
public static String getSubElementText(Element el, String tag, String defaul)(Code)
Returns the text body of the first subelement with given tag. Returns supplied default if it does not find a node with the given tag. Direct children with the given tag
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for defaultDefault string to return in case an element with the specifiedtag does not exist.



getSubElementTextAsInt
public static int getSubElementTextAsInt(Element el, String tag)(Code)
Uses getSubElementText to get the value of a subnode, converts it to int and returns it. int value stored in the subelement text
Parameters:
  el - Parent element
Parameters:
  tag - Tag to look for



getSubElementTextGlobal
public static String getSubElementTextGlobal(Element el, String tag)(Code)
Returns the text body of the first subelement with given tag with any XML scope. Direct children with the given tag
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for



getSubElementTextRecursive
public static String getSubElementTextRecursive(Element el, String tag)(Code)
Returns the text body of the first subelement with given tag. Returns null if it does not find a node with the given tag. Direct children with the given tag
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for



getSubElementTextRecursive
public static String getSubElementTextRecursive(Element el, String tag, String defaul)(Code)
Returns the text body of the first subelement with given tag. Returns supplied default if it does not find a node with the given tag. Direct children with the given tag
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for defaultDefault string to return in case an element with the specifiedtag does not exist.



getSubElements
public static Element[] getSubElements(Element el, String tag)(Code)
Returns all direct child element with the given tag. Direct children with the given tag
Parameters:
  el - Parent element
Parameters:
  tag - Subelement tag to look for



writeElement
public static void writeElement(Object elem, String tag, java.io.Writer w) throws java.io.IOException(Code)
Writes an XML element with the given tag.
Parameters:
  elem - Element value
Parameters:
  tag - Element tag.
Parameters:
  w - Writer
exception:
  java.io.IOException - I/O exception.



writeElement
public static void writeElement(String indent, String tag, String value, Writer w) throws IOException(Code)



writeElementEnd
public static void writeElementEnd(String indent, String tag, Writer w) throws IOException(Code)



writeElementStart
public static void writeElementStart(String indent, String tag, Writer w) throws IOException(Code)



writeEmptyElement
public static void writeEmptyElement(String indent, String tag, Writer w) throws IOException(Code)



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.