Java Doc for XMLManip.java in  » IDE-Netbeans » uml » org » netbeans » modules » uml » core » support » umlsupport » 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 » IDE Netbeans » uml » org.netbeans.modules.uml.core.support.umlsupport 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.uml.core.support.umlsupport.XMLManip

XMLManip
public class XMLManip (Code)

Title:

Description:

Copyright: Copyright (c) 2003

Company:


author:
   not attributable
version:
   1.0




Method Summary
public static  voidDebugXML(Element element, boolean perform)
    
public static  voidappendNewLineElement(Node parent, Document doc)
    
public static  StringcheckForIllegals(String val)
     Makes sure that there are no invalid characters in the value.
public static  voidclearCachedXPaths()
    
public static  ElementcreateElement(Element element, String name, String xmlNamespace)
     Creates a new DOM Element in a given XML namspace.
public static  ElementcreateElement(Document doc, String name, String xmlNamespace)
     Creates a new DOM Element in a given XML namspace.
public static  ElementcreateElement(Element parentNode, String name)
    
public static  ElementcreateElement(Document doc, String name)
    
public static  NodeensureNodeExists(Node curNode, String name, String query)
    
public static  ElementfindElementByID(Branch branch, String id)
     Searches under the given element for an element with the xmi.id supplied.
Parameters:
  branch - The element to search under (Document or Element).
Parameters:
  id - The xmi.id of the element to look for.
public static  NodegetAttribute(Node node, String name)
    
public static  booleangetAttributeBooleanValue(Node n, String str)
     Retreives a nodes attribute value as a boolean.
public static  booleangetAttributeBooleanValue(Node n, String str, boolean defaultValue)
     Retreives a nodes attribute value as a boolean.
public static  doublegetAttributeDoubleValue(Node n, String attr)
     Retreives a nodes attribute value as an double.
public static  intgetAttributeIntValue(Node n, String attr)
     Retreives a nodes attribute value as an integer.
public static  StringgetAttributeValue(Attribute attr)
    
public static  StringgetAttributeValue(org.dom4j.Node n, String str)
     Retreives a nodes attribute value as a string.
public static  XPathgetCreateCachedXPath(String query)
    
public static  DocumentgetDOMDocument(String fileName)
    
public static  DocumentgetDOMDocument(String fileName, IDResolver resolver)
    
public static  DocumentgetDOMDocument()
    
public static  DocumentgetDOMDocument(IDResolver resolver)
    
public static  DocumentgetDOMDocumentFromString(String str)
    
public static  DocumentgetDOMDocumentUseWeakCache(String fileName)
    
public static  NodegetFirstChild(Node node)
     Returns the first child node of the given XML node.
Parameters:
  node - The node in question.
public static  NamespacegetNamespace(Element ref, String namespacePrefix)
     Obtains a DOM4J Namespace given a namespace prefix by querying the XMI fragment.
Parameters:
  namespacePrefix - A namespace prefix.
public static  QNamegetQName(Element ref, String nodeName)
     Obtains a DOM4J QName given a namespace prefixed nodeName.
Parameters:
  nodeName - The name of the node, probably qualified by a namespaceprefix.
public static  StringgetString(String message)
     Returns the locale specific value for the String message.
public static  StringgetString(String key, Object[] params)
     Returns the locale specific message for the given message key, applying a MessageFormat to it with the supplied parameters, if any.
Parameters:
  key - The resource bundle key for the desired message.
Parameters:
  params - Additional parameters to customize the message.
public static  voidinsertNode(Element parent, Node child, int position)
     Inserts a given child node at the given position in the parent's existing child nodes.
public static  voidinsertNode(Element parent, Node child, Node ref)
     Inserts a given child node before the reference node in the parent's existing child nodes.
public static  XMLManipinstance()
    
public static  DocumentloadXML(String text)
    
public static  DocumentloadXML(String text, boolean validate)
     Loads a DOM Document from the given XML text.
Parameters:
  text - The XML text to parse and create a Document from.
Parameters:
  validate - true to validate the XML against any DTDs.
public static  DocumentloadXML(String text, IDResolver resolver)
     Loads a DOM Document from the given XML text.
Parameters:
  text - The XML text to parse and create a Document from.
Parameters:
  The - ID resolver used to determine IDs.
public static  DocumentloadXML(String text, boolean validate, IDResolver resolver)
     Loads a DOM Document from the given XML text.
Parameters:
  text - The XML text to parse and create a Document from.
Parameters:
  validate - true to validate the XML against any DTDs.
public static  voidremoveAllChildNodes(Element nodeElement)
     Removes all child nodes from parentNode. parentNode[in] the element to modify.
public static  NoderemoveChild(Node node, String query)
    
public static  StringretrieveDCEID()
     Generates and retrieves the string representation of the DCE UUID globally unique identifier.
public static  StringretrieveNodeTextValue(Node curNode, String query)
     Retrieves the text of a given node. curNode[in] The node to query query[in] The query to perform on curNode to find the node in whose text value we require.
public static  StringretrieveSimpleName(org.dom4j.Node node)
    
public static  booleansave(Document document, String filename)
    
public static  voidsaveNode(Node node, String filename)
    
public static  voidsaveNodePretty(Node node, String filename)
    
public static  booleansavePretty(Document document, String filename)
    
public static  ListselectAncestorNodesByAttribute(Node node, String attrName, String attrValue)
     A query of "ancestor::*[@attrName='attrValue']" type
Parameters:
  node -
Parameters:
  attrName -
Parameters:
  attrValue - The list of ancestors with required attribute value.
public static  ListselectNodeList(org.dom4j.Node pNode, String pattern)
    
public static  ListselectNodeListNS(Node pNode, String pattern)
    
public static  org.dom4j.NodeselectSingleNode(org.dom4j.Node pNode, String pattern)
    
public static  voidsetAttributeValue(Element elem, String name, String value)
     Sets the XML attribute that has the passed in name to the passed in value. element[in] the element to set that attribute on.
public static  voidsetAttributeValue(Node n, String name, String value)
    
public static  voidsetNodeTextValue(Node curNode, String query, String newVal, boolean useCData)
     Sets the text value of a node. curNode[in] The node to query with query[in] The query to find the node to set value[in] The new value useCData[in] true ( the default ) to automatically wrap value in a ![CDATA[...]] block,else false to just set the data.



Method Detail
DebugXML
public static void DebugXML(Element element, boolean perform)(Code)

Parameters:
  element -
Parameters:
  b -



appendNewLineElement
public static void appendNewLineElement(Node parent, Document doc)(Code)
Appends a newline to the passed in element parent[in] The parent to own the text node HRESULT



checkForIllegals
public static String checkForIllegals(String val)(Code)
Makes sure that there are no invalid characters in the value. If there are, they are converted appropriately. Specifically: '&' will be changed into & '<' will be changed into < '>' will be changed into >
Parameters:
  value - The value to modify if needed. HRESULT



clearCachedXPaths
public static void clearCachedXPaths()(Code)



createElement
public static Element createElement(Element element, String name, String xmlNamespace)(Code)
Creates a new DOM Element in a given XML namspace. This is a lower level routine than the CreateElement that does not take a namespace as an argument. This call does NOT add the new element to the passed in DOM document.
Parameters:
  element - [in] The element that will recieve the new element. name[in] The name of the element to create. xmlNamespace[in] The XML namespace that the new element shouldbelong to. For example, "omg.org/UML/1.4". Thedefault is "omg.org/UML/1.4" The new DOM node.



createElement
public static Element createElement(Document doc, String name, String xmlNamespace)(Code)
Creates a new DOM Element in a given XML namspace. This is a lower level routine than the CreateElement that does not take a namespace as an argument. This call does NOT add the new element to the passed in DOM document. doc[in] The document that will receive the new element. name[in] The name of the element to create. xmlNamespace[in] The XML namespace that the new element shouldbelong to. For example, "omg.org/UML/1.4". Thedefault is "omg.org/UML/1.4" The new DOM node.



createElement
public static Element createElement(Element parentNode, String name) throws DOMException(Code)



createElement
public static Element createElement(Document doc, String name)(Code)



ensureNodeExists
public static Node ensureNodeExists(Node curNode, String name, String query)(Code)



findElementByID
public static Element findElementByID(Branch branch, String id)(Code)
Searches under the given element for an element with the xmi.id supplied.
Parameters:
  branch - The element to search under (Document or Element).
Parameters:
  id - The xmi.id of the element to look for. The Element if found, or null.



getAttribute
public static Node getAttribute(Node node, String name)(Code)

Parameters:
  node -
Parameters:
  string -



getAttributeBooleanValue
public static boolean getAttributeBooleanValue(Node n, String str)(Code)
Retreives a nodes attribute value as a boolean. If the value of the attribute can not be converted to a boolean then false will be returned.
Parameters:
  n - The node that is used to retrieve the attribute.
Parameters:
  str - The name of the attribute value. The boolean value of the attribute.



getAttributeBooleanValue
public static boolean getAttributeBooleanValue(Node n, String str, boolean defaultValue)(Code)
Retreives a nodes attribute value as a boolean. If the value of the attribute can not be converted to a boolean then false will be returned.
Parameters:
  n - The node that is used to retrieve the attribute.
Parameters:
  str - The name of the attribute value.
Parameters:
  defaultValue - the value returned if the attribute is not found. The boolean value of the attribute.



getAttributeDoubleValue
public static double getAttributeDoubleValue(Node n, String attr) throws NumberFormatException(Code)
Retreives a nodes attribute value as an double. If the value of the attribute can not be converted to an integer then zero will be returned.
Parameters:
  n - The node that is used to retrieve the attribute.
Parameters:
  attr - The name of the attribute value. The integer value of the attribute.
throws:
  NumberFormatException - if the attribute does not contain a parsable integer.



getAttributeIntValue
public static int getAttributeIntValue(Node n, String attr) throws NumberFormatException(Code)
Retreives a nodes attribute value as an integer. If the value of the attribute can not be converted to an integer then zero will be returned.
Parameters:
  n - The node that is used to retrieve the attribute.
Parameters:
  attr - The name of the attribute value. The integer value of the attribute.
throws:
  NumberFormatException - if the attribute does not contain a parsable integer.



getAttributeValue
public static String getAttributeValue(Attribute attr)(Code)



getAttributeValue
public static String getAttributeValue(org.dom4j.Node n, String str)(Code)
Retreives a nodes attribute value as a string.
Parameters:
  n - The node that is used to retrieve the attribute.
Parameters:
  attr - The name of the attribute value.



getCreateCachedXPath
public static XPath getCreateCachedXPath(String query)(Code)



getDOMDocument
public static Document getDOMDocument(String fileName)(Code)



getDOMDocument
public static Document getDOMDocument(String fileName, IDResolver resolver)(Code)



getDOMDocument
public static Document getDOMDocument()(Code)



getDOMDocument
public static Document getDOMDocument(IDResolver resolver)(Code)



getDOMDocumentFromString
public static Document getDOMDocumentFromString(String str)(Code)



getDOMDocumentUseWeakCache
public static Document getDOMDocumentUseWeakCache(String fileName)(Code)



getFirstChild
public static Node getFirstChild(Node node)(Code)
Returns the first child node of the given XML node.
Parameters:
  node - The node in question. Only DOM4J Element Nodes have childnodes, so passing in any other Node will return null. The first child node, or null if there are no children.



getNamespace
public static Namespace getNamespace(Element ref, String namespacePrefix)(Code)
Obtains a DOM4J Namespace given a namespace prefix by querying the XMI fragment.
Parameters:
  namespacePrefix - A namespace prefix. A DOM4J Namespace, if the namespacePrefix was known to us.



getQName
public static QName getQName(Element ref, String nodeName)(Code)
Obtains a DOM4J QName given a namespace prefixed nodeName.
Parameters:
  nodeName - The name of the node, probably qualified by a namespaceprefix. A DOM4J QName, with the Namespace correctly set if the namespaceprefix matched a known namespace.



getString
public static String getString(String message)(Code)
Returns the locale specific value for the String message.
Parameters:
  message -



getString
public static String getString(String key, Object[] params)(Code)
Returns the locale specific message for the given message key, applying a MessageFormat to it with the supplied parameters, if any.
Parameters:
  key - The resource bundle key for the desired message.
Parameters:
  params - Additional parameters to customize the message. String The locale-specific text



insertNode
public static void insertNode(Element parent, Node child, int position)(Code)
Inserts a given child node at the given position in the parent's existing child nodes. Note: to append the child node as the last child, it's easier to directly call parent.add(child) than this method. It is not necessary to detach the child before calling this method.
Parameters:
  parent - The parent XML Element.
Parameters:
  child - The child Node to be added to the parent.
Parameters:
  position - The number of the child node before which the new childwill be inserted.



insertNode
public static void insertNode(Element parent, Node child, Node ref)(Code)
Inserts a given child node before the reference node in the parent's existing child nodes. Note: to append the child node as the last child, it's easier to directly call parent.add(child) than this method. It is not necessary to detach the child before calling this method.
Parameters:
  parent - The parent XML Element.
Parameters:
  child - The child Node to be added to the parent.
Parameters:
  position - The number of the child node before which the new childwill be inserted.



instance
public static XMLManip instance()(Code)



loadXML
public static Document loadXML(String text)(Code)

Parameters:
  doc -
Parameters:
  header -



loadXML
public static Document loadXML(String text, boolean validate)(Code)
Loads a DOM Document from the given XML text.
Parameters:
  text - The XML text to parse and create a Document from.
Parameters:
  validate - true to validate the XML against any DTDs. The Document created.



loadXML
public static Document loadXML(String text, IDResolver resolver)(Code)
Loads a DOM Document from the given XML text.
Parameters:
  text - The XML text to parse and create a Document from.
Parameters:
  The - ID resolver used to determine IDs. The Document created.



loadXML
public static Document loadXML(String text, boolean validate, IDResolver resolver)(Code)
Loads a DOM Document from the given XML text.
Parameters:
  text - The XML text to parse and create a Document from.
Parameters:
  validate - true to validate the XML against any DTDs. The Document created.



removeAllChildNodes
public static void removeAllChildNodes(Element nodeElement)(Code)
Removes all child nodes from parentNode. parentNode[in] the element to modify. HRESULTs



removeChild
public static Node removeChild(Node node, String query)(Code)



retrieveDCEID
public static String retrieveDCEID()(Code)
Generates and retrieves the string representation of the DCE UUID globally unique identifier. See section 3.5.1 in the XMI spec. the string. The form is like this: "DCE.2fac1234-31f8-11b4-a222-08002b34c003"Perfect for the xmi.uuid attribute.



retrieveNodeTextValue
public static String retrieveNodeTextValue(Node curNode, String query)(Code)
Retrieves the text of a given node. curNode[in] The node to query query[in] The query to perform on curNode to find the node in whose text value we require. value[out] The text value HRESULTs



retrieveSimpleName
public static String retrieveSimpleName(org.dom4j.Node node)(Code)



save
public static boolean save(Document document, String filename)(Code)

Parameters:
  document -
Parameters:
  fileName -



saveNode
public static void saveNode(Node node, String filename)(Code)



saveNodePretty
public static void saveNodePretty(Node node, String filename)(Code)



savePretty
public static boolean savePretty(Document document, String filename)(Code)



selectAncestorNodesByAttribute
public static List selectAncestorNodesByAttribute(Node node, String attrName, String attrValue)(Code)
A query of "ancestor::*[@attrName='attrValue']" type
Parameters:
  node -
Parameters:
  attrName -
Parameters:
  attrValue - The list of ancestors with required attribute value.



selectNodeList
public static List selectNodeList(org.dom4j.Node pNode, String pattern)(Code)



selectNodeListNS
public static List selectNodeListNS(Node pNode, String pattern)(Code)



selectSingleNode
public static org.dom4j.Node selectSingleNode(org.dom4j.Node pNode, String pattern)(Code)

Parameters:
  pNode -
Parameters:
  pattern -



setAttributeValue
public static void setAttributeValue(Element elem, String name, String value)(Code)
Sets the XML attribute that has the passed in name to the passed in value. element[in] the element to set that attribute on. attrName[in] the name of the XML attribute to set. value[in] the actual value to set. HRESULT



setAttributeValue
public static void setAttributeValue(Node n, String name, String value)(Code)



setNodeTextValue
public static void setNodeTextValue(Node curNode, String query, String newVal, boolean useCData)(Code)
Sets the text value of a node. curNode[in] The node to query with query[in] The query to find the node to set value[in] The new value useCData[in] true ( the default ) to automatically wrap value in a ![CDATA[...]] block,else false to just set the data. HRESULTs



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.