Java Doc for XmlUtil.java in  » ESB » open-esb » com » sun » jbi » framework » 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 » ESB » open esb » com.sun.jbi.framework 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.jbi.framework.XmlUtil

XmlUtil
public class XmlUtil (Code)
This class provides utility methods for accessing data from XML documents.
author:
   Sun Microsystems, Inc.




Method Summary
static  StringgetAttribute(Node node, String attrName)
     Get a single attribute value from a node.
static  BooleangetBooleanValue(Node node, String tag, boolean isRequired)
     Get a boolean value from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not.
static  NodegetElement(Node node, String tag, boolean isRequired)
     Get the named element from the specified node.
static  NodeListgetElements(Node node, String tag, boolean isRequired)
     Get the named elements from the specified node.
static  StringgetStringValue(Node node)
     Get a String value from the specified node.
static  StringgetStringValue(Node node, String tag, boolean isRequired)
     Get a String value from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not.
static  StringgetStringValue(NodeList nodeList)
     Get a single String value from a node list.
static  List<String>getStringValueArray(Node node, String tag, boolean isRequired)
     Get a list of String values from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not.
static  List<String>getStringValueArray(Node node, String tag1, String tag2, boolean isRequired)
     Get a list of String values from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag1 - - the parent element to be processed.
Parameters:
  tag2 - - the child element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not.
static  List<String>getStringValueArray(NodeList nodeList)
     Get a list of String values from a node list.



Method Detail
getAttribute
static String getAttribute(Node node, String attrName)(Code)
Get a single attribute value from a node. If the attribute is not present an empty string value is returned.
Parameters:
  node - the Node to be processed.
Parameters:
  attrName - the name of the attribute to be retrieved. A String representing the value of the attribute. If theattribute is not present, its value is set to an empty string.



getBooleanValue
static Boolean getBooleanValue(Node node, String tag, boolean isRequired) throws com.sun.jbi.framework.XmlParseException(Code)
Get a boolean value from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not. A boolean set based on the text value from the specified element:"true" returns true; "false" returns false. If the element is not presentand isRequired is false, returns a null.
throws:
  com.sun.jbi.framework.XmlParseException - if the node list isnull or if any node is missing its text node.



getElement
static Node getElement(Node node, String tag, boolean isRequired) throws com.sun.jbi.framework.XmlParseException(Code)
Get the named element from the specified node. If isRequired is true, there must be exactly one element of the specified type; if no element is found, an exception is thrown. If isRequired is false, and there is no element of the specified type, null is returned. In either case, if multiple elements are found, an exception is thrown.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the type of the element to be returned.
Parameters:
  isRequired - - true if the element is required, false if not. A Node representing the requested element, or null if no elementwas found and isRequired is false.
throws:
  com.sun.jbi.framework.XmlParseException - if a required element isnot found or if a parse error occurs.



getElements
static NodeList getElements(Node node, String tag, boolean isRequired) throws com.sun.jbi.framework.XmlParseException(Code)
Get the named elements from the specified node. If isRequired is true, there must be at least one element of the specified type; if no element is found, an exception is thrown. If isRequired is false, and there are no elements of the specified type, an empty NodeList is returned.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the type of the elements to be returned.
Parameters:
  isRequired - - true if the element is required, false if not. A NodeList representing the requested elements, or null if theinput node is null.
throws:
  com.sun.jbi.framework.XmlParseException - if a required element isnot found or if a parse error occurs.



getStringValue
static String getStringValue(Node node) throws com.sun.jbi.framework.XmlParseException(Code)
Get a String value from the specified node. The node can have child nodes but must have one and only one child node that is a text node containing the value.
Parameters:
  node - the node to be processed. A String containing the text value from the specified node.
throws:
  com.sun.jbi.framework.XmlParseException - if the node is missingits text node.



getStringValue
static String getStringValue(Node node, String tag, boolean isRequired) throws com.sun.jbi.framework.XmlParseException(Code)
Get a String value from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not. A String containing the text value from the specified element,or null if the element is not present and isRequired is false.
throws:
  com.sun.jbi.framework.XmlParseException - if the node list isnull or if any node is missing its text node.



getStringValue
static String getStringValue(NodeList nodeList) throws com.sun.jbi.framework.XmlParseException(Code)
Get a single String value from a node list. The node list is expected to contain exactly one node, which in turn is expected to contain exactly one text node. If the node list is null or has multiple elements, an exception is thrown.
Parameters:
  nodeList - - the node list to be processed. The String value from the node.
throws:
  com.sun.jbi.framework.XmlParseException - if the node list isnull or has multiple elements, or if the node is missing its textelement.



getStringValueArray
static List<String> getStringValueArray(Node node, String tag, boolean isRequired) throws com.sun.jbi.framework.XmlParseException(Code)
Get a list of String values from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag - - the element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not. A list of Strings containing the text values from the specifiedelements. The list is empty if no elements were found and isRequired isfalse.
throws:
  com.sun.jbi.framework.XmlParseException - if the node list isnull or if any node is missing its text node, or if a required elementis not found.



getStringValueArray
static List<String> getStringValueArray(Node node, String tag1, String tag2, boolean isRequired) throws com.sun.jbi.framework.XmlParseException(Code)
Get a list of String values from a named element in the specified node.
Parameters:
  node - - the node to be processed.
Parameters:
  tag1 - - the parent element to be processed.
Parameters:
  tag2 - - the child element to be processed.
Parameters:
  isRequired - - true if the element is required, false if not. A list of Strings containing the text values from the specifiedelements. The list is empty if no elements were found and isRequired isfalse.
throws:
  com.sun.jbi.framework.XmlParseException - if the node list isnull or if any node is missing its text node, or if a required elementis not found.



getStringValueArray
static List<String> getStringValueArray(NodeList nodeList) throws com.sun.jbi.framework.XmlParseException(Code)
Get a list of String values from a node list. The node list can have any number of nodes, each of which must have a single Text node. For example, given the following XML fragment defined by a node list:

 <sharedNamespaceId>shared-namespace-1</sharedNamespaceId>
 <sharedNamespaceId>shared-namespace-2</sharedNamespaceId>
 <sharedNamespaceId>shared-namespace-3</sharedNamespaceId>
 
The returned ArrayList for this node list would contain three String instances with values "shared-namespace-1", "shared-namespace-2", and "shared-namespace-3".
Parameters:
  nodeList - - the node list to be processed. An array list containing String values from the Text nodes, ornull if there were none.
throws:
  java.lang.IllegalArgumentException - if the node list is null.
throws:
  com.sun.jbi.framework.XmlParseException - if any node in thelist is missing a text node.



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.