Java Doc for DomUtils.java in  » ERP-CRM-Financial » sakai » edu » indiana » lib » twinpeaks » 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 » ERP CRM Financial » sakai » edu.indiana.lib.twinpeaks.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   edu.indiana.lib.twinpeaks.util.DomUtils

DomUtils
public class DomUtils (Code)


Field Summary
final public static  StringENCODING
    
final public static  StringINPUT_ENCODING
    


Method Summary
public static  voidaddEntity(Element element, String entity)
     Add an entity to a specified Element.
public static  voidaddText(Element element, String text)
     Add Text object to an Element.
public static  voidcopyDocument(Document source, Document target)
    
public static  voidcopyDocumentNode(Node source, Document target)
    
public static  ElementcreateElement(Document document, String name)
    
public static  ElementcreateElement(Element parent, String name)
    
public static  DocumentcreateXmlDocument()
    
public static  DocumentcreateXmlDocument(String rootName)
     Start a new XML Document.
public static  StringgetAllText(Node parent)
     Get any text associated with this element and it's children.
public static  StringgetAllTextAtNode(Node parent)
    
public static  StringgetAttribute(Element element, String name)
     Get an Attribute from an Element.
public static  NodegetChildSiblingByName(Node currentNode, String tagName)
    
public static  ElementgetElement(Element element, String name)
     Return the first named Element found.
public static  NodeListgetElementList(Element element, String name)
     Return a list of named Elements.
public static  StringgetFirstText(Node parent)
    
public static  NodegetNextNodeByName(Node currentNode, String tagName)
    
public static  NodegetNextSiblingByName(Node currentNode, String tagName)
    
public static  NodegetPreviousNodeByName(Node currentNode, String tagName)
    
public static  NodegetPreviousSiblingByName(Node currentNode, String tagName)
    
public static  StringgetText(Node parent)
    
public static  StringgetTextNodeByNumber(Node parent, int number)
    
public static  DocumentBuildergetXmlDocumentBuilder()
     Get a DOM Document builder.
public static  StringnormalizeText(String update)
    
public static  StringnormalizeText(String original, String update)
    
public static  DocumentparseHtmlBytes(byte[] html)
     Parse HTML text (from a raw byte array) into a Document.
public static  DocumentparseHtmlString(String html)
     Parse HTML text (from a String) into a Document.
public static  DocumentparseXmlBytes(byte[] xml)
     Parse XML text (from a raw byte array) into a Document.
public static  DocumentparseXmlFile(String filename)
     Parse an XML file into a Document.
public static  DocumentparseXmlReader(Reader xmlReader)
     Parse XML text (from a Reader) into a Document.
public static  DocumentparseXmlStream(InputStream xmlStream)
     Parse XML text (from an input stream) into a Document.
public static  DocumentparseXmlString(String xml)
     Parse XML text (from a string) into a Document.
public  NoderemoveNode(Node node)
     Remove this node from its parent.
public static  ListselectElementsByAttributeValue(Element element, String name, String attribute, String value)
     Return a list of named Elements with a specific attribute value.
public static  ListselectElementsByAttributeValue(Element element, String name, String attribute, String value, boolean returnFirst)
     Return a list of named Elements with a specific attribute value.
public static  ElementselectFirstElementByAttributeValue(Element element, String name, String attribute, String value)
     Return the first named Element with a specific attribute value.
public static  Stringserialize(Object object)
     Write formatted XML text to a String.
public static  voidserializeXml(Node node, OutputStream target)
     Write formatted XML text to supplied OutputStream.
public static  voidserializeXml(Node node, Writer writer)
     Write formatted XML text to supplied Writer.
public static  voidsetAttribute(Element element, String name, String value)
    
public static  StringtextSearch(Node parent, boolean recursiveSearch)
    

Field Detail
ENCODING
final public static String ENCODING(Code)



INPUT_ENCODING
final public static String INPUT_ENCODING(Code)





Method Detail
addEntity
public static void addEntity(Element element, String entity)(Code)
Add an entity to a specified Element. (eg DomUtils.addEntity(element, "nbsp");)
Parameters:
  element - the containing element
Parameters:
  entity - the entity to add



addText
public static void addText(Element element, String text)(Code)
Add Text object to an Element.
Parameters:
  element - the containing element
Parameters:
  text - the text to add



copyDocument
public static void copyDocument(Document source, Document target)(Code)
Copy an XML document, adding it as a child of the target document root
Parameters:
  source - Document to copy
Parameters:
  target - Document to contain copy



copyDocumentNode
public static void copyDocumentNode(Node source, Document target)(Code)
Copy a Node from one source document, adding it to the document root of a different, target Document
Parameters:
  source - Document to copy
Parameters:
  target - Document to contain copy



createElement
public static Element createElement(Document document, String name)(Code)
Create a new element
Parameters:
  document - Document to contain the new element
Parameters:
  name - the element name new Element



createElement
public static Element createElement(Element parent, String name)(Code)
Add a new element to the given parent
Parameters:
  parent - the parent Element
Parameters:
  name - the child name new Element



createXmlDocument
public static Document createXmlDocument() throws DomException(Code)
Start a new XML Document (with root name = xml) the Document
throws:
  DomException -



createXmlDocument
public static Document createXmlDocument(String rootName) throws DomException(Code)
Start a new XML Document.
Parameters:
  rootName - The name of the Document root Element (created here) the Document
throws:
  DomException -



getAllText
public static String getAllText(Node parent)(Code)
Get any text associated with this element and it's children. Null if none.
Parameters:
  parent - the node containing text Text



getAllTextAtNode
public static String getAllTextAtNode(Node parent)(Code)
Get the text associated with this element, at all suboordinate levels
Parameters:
  parent - the node containing text Text (trimmed of leading/trailing whitespace, null if none)



getAttribute
public static String getAttribute(Element element, String name)(Code)
Get an Attribute from an Element. Returns an empty String if none found
Parameters:
  element - the containing Element
Parameters:
  name - the attribute name Attribute as a String



getChildSiblingByName
public static Node getChildSiblingByName(Node currentNode, String tagName)(Code)
Search for a named child of a given node
Parameters:
  currentNode - Starting point for our search
Parameters:
  tagName - Node name to look up matching Node (null if none)



getElement
public static Element getElement(Element element, String name)(Code)
Return the first named Element found. Null if none.
Parameters:
  element - the containing Element
Parameters:
  name - the tag name matching Element (null if none)



getElementList
public static NodeList getElementList(Element element, String name)(Code)
Return a list of named Elements.
Parameters:
  element - the containing Element
Parameters:
  name - the tag name NodeList of matching elements



getFirstText
public static String getFirstText(Node parent)(Code)
Get the first text node associated with this element
Parameters:
  parent - the node containing text Text (trimmed of leanding/trailing whitespace, null if none)



getNextNodeByName
public static Node getNextNodeByName(Node currentNode, String tagName)(Code)
Search across the tree for a given sibling
Parameters:
  currentNode - Starting point for our search
Parameters:
  tagName - Node name to look up matching Node (null if none)DomUtils.getNextSiblingByName(Node currentNode,String tagName)



getNextSiblingByName
public static Node getNextSiblingByName(Node currentNode, String tagName)(Code)
Search our next siblings for a given node
Parameters:
  currentNode - Starting point for our search
Parameters:
  tagName - Node name to look up matching Node (null if none)



getPreviousNodeByName
public static Node getPreviousNodeByName(Node currentNode, String tagName)(Code)
Search up the tree for a given node
Parameters:
  currentNode - Starting point for our search
Parameters:
  tagName - Node name to look up matching Node (null if none)



getPreviousSiblingByName
public static Node getPreviousSiblingByName(Node currentNode, String tagName)(Code)
Search earlier siblings for a given node
Parameters:
  currentNode - Starting point for our search
Parameters:
  tagName - Node name to look up matching Node (null if none)



getText
public static String getText(Node parent)(Code)
Get the text associated with this element, at this level only
Parameters:
  parent - the node containing text Text (trimmed of leading/trailing whitespace, null if none)



getTextNodeByNumber
public static String getTextNodeByNumber(Node parent, int number)(Code)
Get the specified text node associated with this element
Parameters:
  parent - the node containing text
Parameters:
  number - The text node to fetch (1st, 2nd, etc) Text (trimmed of leanding/trailing whitespace, null if none)



getXmlDocumentBuilder
public static DocumentBuilder getXmlDocumentBuilder() throws DomException(Code)
Get a DOM Document builder. The DocumentBuilder
throws:
  DomException -



normalizeText
public static String normalizeText(String update)(Code)
"Normalize" XML text node content to create a simple string
Parameters:
  update - Text to add to the original string Concatenated contents (trimmed, pagination characters (\r, \n, etc.)removed, with a space seperator)



normalizeText
public static String normalizeText(String original, String update)(Code)
"Normalize" XML text node content to create a simple string
Parameters:
  original - Original text
Parameters:
  update - Text to add to the original string Concatenated contents (trimmed, pagination characters (\r, \n, etc.)removed, with a space seperator)



parseHtmlBytes
public static Document parseHtmlBytes(byte[] html) throws DomException(Code)
Parse HTML text (from a raw byte array) into a Document.
Parameters:
  html - The HTML text DOM Document
throws:
  DomException -

The used to be:parseHtmlStream(new ByteArrayInputStream(html));




parseHtmlString
public static Document parseHtmlString(String html) throws DomException(Code)
Parse HTML text (from a String) into a Document.
Parameters:
  html - The HTML text DOM Document
throws:
  DomException -

This used to be:return parseHtmlReader(new StringReader(html));




parseXmlBytes
public static Document parseXmlBytes(byte[] xml) throws DomException(Code)
Parse XML text (from a raw byte array) into a Document.
Parameters:
  xml - The XML text DOM Document
throws:
  DomException -



parseXmlFile
public static Document parseXmlFile(String filename) throws DomException(Code)
Parse an XML file into a Document.
Parameters:
  filename - - The filename to parse DOM Document
throws:
  DomException -



parseXmlReader
public static Document parseXmlReader(Reader xmlReader) throws DomException(Code)
Parse XML text (from a Reader) into a Document.
Parameters:
  xmlReader - The XML Reader DOM Document
throws:
  DomException -



parseXmlStream
public static Document parseXmlStream(InputStream xmlStream) throws DomException(Code)
Parse XML text (from an input stream) into a Document.
Parameters:
  xmlStream - The XML text stream DOM Document
throws:
  DomException -



parseXmlString
public static Document parseXmlString(String xml) throws DomException(Code)
Parse XML text (from a string) into a Document.
Parameters:
  xml - The XML text DOM Document
throws:
  DomException -



removeNode
public Node removeNode(Node node)(Code)
Remove this node from its parent.
Parameters:
  node - the node to remove Node removed



selectElementsByAttributeValue
public static List selectElementsByAttributeValue(Element element, String name, String attribute, String value)(Code)
Return a list of named Elements with a specific attribute value.
Parameters:
  element - the containing Element
Parameters:
  name - the tag name
Parameters:
  attribute - Attribute name
Parameters:
  value - Attribute value List of matching elements



selectElementsByAttributeValue
public static List selectElementsByAttributeValue(Element element, String name, String attribute, String value, boolean returnFirst)(Code)
Return a list of named Elements with a specific attribute value.
Parameters:
  element - the containing Element
Parameters:
  name - the tag name
Parameters:
  attribute - Attribute name
Parameters:
  value - Attribute value
Parameters:
  returnFirst - Return only the first matching value? List of matching elements



selectFirstElementByAttributeValue
public static Element selectFirstElementByAttributeValue(Element element, String name, String attribute, String value)(Code)
Return the first named Element with a specific attribute value.
Parameters:
  element - the containing Element
Parameters:
  name - the tag name
Parameters:
  attribute - Attribute name
Parameters:
  value - Attribute value The first matching Element (null if none)



serialize
public static String serialize(Object object) throws DomException(Code)
Write formatted XML text to a String.
Parameters:
  object - The XML Document, HTML Document, or Element to write String containing the formatted document text
throws:
  DomException -



serializeXml
public static void serializeXml(Node node, OutputStream target) throws DomException(Code)
Write formatted XML text to supplied OutputStream.
Parameters:
  node - Node to write
Parameters:
  target - stream to write to
throws:
  DomException -



serializeXml
public static void serializeXml(Node node, Writer writer) throws DomException(Code)
Write formatted XML text to supplied Writer.
Parameters:
  node - the Node to write
Parameters:
  writer - Writer the document is written to
throws:
  DomException -



setAttribute
public static void setAttribute(Element element, String name, String value)(Code)
Set an Attribute in an Element
Parameters:
  element - the containing Element
Parameters:
  name - the attribute name
Parameters:
  value - the attribute value



textSearch
public static String textSearch(Node parent, boolean recursiveSearch)(Code)
Get the text associated with this element at this level only, or recursivley, searching through all child elements
Parameters:
  parent - the node containing text
Parameters:
  recursiveSearch - Search all child elements? Text (trimmed of leading/trailing whitespace, null if none)



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.