|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.juniper.netconf.XML
An XML object represents XML content and provides methods to
manipulate it.
The XML object has an 'active' element, which represents the
hierarchy at which the XML can be manipulated.
As an example, one
| Constructor Summary | |
protected |
XML(org.w3c.dom.Element active)
|
| Method Summary | |
XML |
addPath(java.lang.String path)
Append multiple elements under the active element of XML object, by specifying the path.The bottommost hierarchy element now becomes the active element. |
void |
addSibling(java.lang.String element)
Add a sibling element with the active element of XML object. |
void |
addSibling(java.lang.String element,
java.lang.String text)
Append a sibling element, with text, with the active element of XML object. |
void |
addSiblings(java.util.HashMap map)
Add multiple siblings with different names and different text, with the active element of XML object. |
void |
addSiblings(java.lang.String element,
java.lang.String[] text)
Add multiple sibling elements,with same names but different text, with the active element of XML object. |
void |
append(java.util.HashMap map)
Append multiple elements with different names and different text, under the active element of XML object. |
XML |
append(java.lang.String element)
Append an element under the active element of XML object. |
XML |
append(java.lang.String element,
java.util.HashMap map)
Append an element under the active element of XML object. |
XML |
append(java.lang.String element,
java.lang.String text)
Append an element, with text, under the active element of XML object. |
void |
append(java.lang.String element,
java.lang.String[] text)
Append multiple elements, with same name but different text under the active element of XML object. |
java.util.List |
findNodes(java.util.List list)
Get all the nodes at a given hiearchy, as list of org.w3c.dom.Node objects. |
java.lang.String |
findValue(java.util.List list)
Find the text value of an element. |
org.w3c.dom.Document |
getOwnerDocument()
Get the owner Document for the XML object. |
void |
junosActivate()
Sets the attribute ("active","active") for the active element of XML object. |
void |
junosDeactivate()
Sets the attribute ("inactive","inactive") for the active element of XML object. |
void |
junosDelete()
Sets the attribute ("delete","delete") for the active element of XML object. |
void |
junosInsert(java.lang.String before,
java.lang.String name)
Sets the attribute ("insert") and ("name") for the active element of XML object. |
void |
junosRename(java.lang.String toBeRenamed,
java.lang.String newName)
Sets the attribute ("rename") and ("name") for the active element of XML object. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set attribute for the active element of XML object. |
void |
setText(java.lang.String text)
Set text for the active element of XML object. |
java.lang.String |
toString()
Get the xml string of the XML object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected XML(org.w3c.dom.Element active)
| Method Detail |
public org.w3c.dom.Document getOwnerDocument()
public XML append(java.lang.String element)
element - The name of element to append.
public XML append(java.lang.String element,
java.lang.String text)
element - The name of element to append.text - The text value of the element to be appended
public void append(java.lang.String element,
java.lang.String[] text)
element - The name of elements to append.text - The array containing text value for each element.public void append(java.util.HashMap map)
map - The hashmap, each entry containing element name as the key and
text value as the key value.
public XML append(java.lang.String element,
java.util.HashMap map)
element - The name of the element to be appended.map - The hashmap, each entry containing element name as the key and
text value as the key value.
public void addSibling(java.lang.String element)
element - The name of the new element to be added.
public void addSibling(java.lang.String element,
java.lang.String text)
element - The name of element to add.text - The text value of the element to be appended.
public void addSiblings(java.lang.String element,
java.lang.String[] text)
element - The name of elements to add.text - The array containing text value for each element.public void addSiblings(java.util.HashMap map)
map - The hashmap, each entry containing element name as the key and
text value as the key value.public XML addPath(java.lang.String path)
path - The path to be added. For example, to add the hierarchy:
<a>
<b>
<c/>
</b>
</a>
The path should be "a/b/c"
public void setAttribute(java.lang.String name,
java.lang.String value)
name - The name of the attribute.value - The value of the attribute.
public void setText(java.lang.String text)
throws javax.xml.parsers.ParserConfigurationException
text - The text value to be set
javax.xml.parsers.ParserConfigurationExceptionpublic void junosDelete()
public void junosActivate()
public void junosDeactivate()
public void junosRename(java.lang.String toBeRenamed,
java.lang.String newName)
public void junosInsert(java.lang.String before,
java.lang.String name)
public java.lang.String findValue(java.util.List list)
list - The String based list of elements which determine the hierarchy.
For example, for the below XML:
<rpc-reply>
<environment-information>
<environment-item>
<name>FPC 0 CPU</name>
<temperature>
To find out the text value of temperature node, the list
should be- {"environment-information","environment-item",
"name~FPC 0 CPU","temperature"}
public java.util.List findNodes(java.util.List list)
list - The String based list of elements which determine the hierarchy.
For example, for the below XML:
<rpc-reply>
<environment-information>
<environment-item>
<name>FPC 0 CPU</name>
To get the 'environment-item' Node with name 'FPC 0 CPU',
, the list should be- {"environment-information",
"environment-item",
"name~FPC 0 CPU"}
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||