Java Doc for XmlUtils.java in  » Science » Cougaar12_4 » org » cougaar » lib » aggagent » 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 » Science » Cougaar12_4 » org.cougaar.lib.aggagent.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.cougaar.lib.aggagent.util.XmlUtils

XmlUtils
public class XmlUtils (Code)
The XmlUtils class is the home of a suite of static convenience methods for handling XML documents. Support for parsing, traversing, and generating these documents may be found here.


Field Summary
public static  booleandebug
     when debug is set to true, all XML is printed to standard out before it is parsed.


Method Summary
public static  ElementgetChildElement(Element elt, String tag)
     Search for an Element of the given name that is a child of the specified Element.
public static  intgetChildInt(Element elt, String tag)
     This convenience method searches for a child Element and attempts to parse its content text as an integer.
public static  StringgetChildText(Element elt, String tag)
     This convenience method extracts the text content of a child Element whose name is specified by the caller.
public static  StringgetElementText(Element elt)
     This convenience method extracts the text content of an XML element (including white spaces).
public static  Elementparse(String s)
     Parse an XML document and return the "document element", which is the root of the XML structure as specified in the text of the document.
public static  Elementparse(InputStream s)
     Parse an XML document and return the "document element", which is the root of the XML structure as specified in the text of the document.
public static  Elementparse(InputSource in)
     Parse an XML document and return the "document element", which is the root of the XML structure as specified in the text of the document.
public static  StringreadToString(InputStream is)
    
public static  StringrequestString(String urlString, String request)
     Post request to URL represented by passed string.
public static  ElementrequestXML(String urlString, String request)
     Post request to URL represented by passed string.
public static  InputStreamsendRequest(String urlString, String request)
     Post request to URL represented by passed string.

Field Detail
debug
public static boolean debug(Code)
when debug is set to true, all XML is printed to standard out before it is parsed.





Method Detail
getChildElement
public static Element getChildElement(Element elt, String tag)(Code)
Search for an Element of the given name that is a child of the specified Element. If any such Elements exist, the first is returned; otherwise, the method returns null. Note: the search will return only direct children, as opposed to higher-order descendants (e.g., grandchildren).



getChildInt
public static int getChildInt(Element elt, String tag) throws NumberFormatException(Code)
This convenience method searches for a child Element and attempts to parse its content text as an integer. An Exception will be raised if no such Element exists, or else one exists, but its contents cannot be intrepreted as an integer. If the Element has more than one child with the given name, then the first one is used (even if the contents are invalid).



getChildText
public static String getChildText(Element elt, String tag)(Code)
This convenience method extracts the text content of a child Element whose name is specified by the caller. Assuming such an Element exists, its contents are handled as in getElementText (q.v.). If there are many child Elements matching the description, the first one is used. If there are no such Elements, then this method returns null.



getElementText
public static String getElementText(Element elt)(Code)
This convenience method extracts the text content of an XML element (including white spaces). If the Element has child Elements, they are ignored, and the intervening Text nodes are concatenated into the result. This method will return null if and only if it is passed a null Element.



parse
public static Element parse(String s) throws IOException, SAXException(Code)
Parse an XML document and return the "document element", which is the root of the XML structure as specified in the text of the document. For this method, the text must come from a String.



parse
public static Element parse(InputStream s) throws IOException, SAXException(Code)
Parse an XML document and return the "document element", which is the root of the XML structure as specified in the text of the document. For this method, the text must come from an InputStream.



parse
public static Element parse(InputSource in) throws IOException, SAXException(Code)
Parse an XML document and return the "document element", which is the root of the XML structure as specified in the text of the document. By and large, this method will be called by other parse methods after converting the source of the XML text into an InputSource.



readToString
public static String readToString(InputStream is) throws IOException(Code)



requestString
public static String requestString(String urlString, String request)(Code)
Post request to URL represented by passed string. Return response as string. Currently just catches exceptions and prints message to standard out (returning null).



requestXML
public static Element requestXML(String urlString, String request)(Code)
Post request to URL represented by passed string. Return parsed XML response. Currently just catches exceptions and prints message to standard out (returning null).



sendRequest
public static InputStream sendRequest(String urlString, String request) throws MalformedURLException, IOException(Code)
Post request to URL represented by passed string. Return response as input stream.



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.