|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Specialization of INodeInspector
for nodes where
getNodeKind()
returns
ELEMENT
.
Nested Class Summary |
---|
Nested classes inherited from class org.eclipse.jet.xpath.inspector.INodeInspector |
---|
INodeInspector.NodeKind |
Method Summary | |
---|---|
java.lang.Object |
addElement(java.lang.Object node,
ExpandedName elementName,
java.lang.Object addBeforeThisSibling)
Create a new Element under context Node |
java.lang.Object |
addTextElement(java.lang.Object parentElement,
java.lang.String name,
java.lang.String bodyContent,
boolean asCData)
Create a new text (simple) element under parentElement with the specified
name and content.
|
java.lang.Object |
copyElement(java.lang.Object tgtParent,
java.lang.Object srcElement,
java.lang.String name,
boolean recursive)
Make a copy of srcElement under tgtParent with the specified name.
|
boolean |
createAttribute(java.lang.Object node,
java.lang.String attributeName,
java.lang.String value)
Create the named attribute on the context node (which is an ELEMENT) and set its value to the passed value. |
java.lang.Object[] |
getAttributes(java.lang.Object node)
Return all the attributes for the given contextNode. |
java.lang.Object |
getNamedAttribute(java.lang.Object node,
ExpandedName nameTestExpandedName)
Return the named attribute for the given contextNode. |
void |
removeAttribute(java.lang.Object node,
java.lang.String name)
Remove the named attribute from the node that represents an element. |
void |
removeElement(java.lang.Object node)
Remove the specified element from its containing model. |
Methods inherited from interface org.eclipse.jet.xpath.inspector.INodeInspector |
---|
expandedNameOf, getChildren, getDocumentRoot, getNodeKind, getParent, nameOf, stringValueOf, testExpandedName |
Method Detail |
public java.lang.Object[] getAttributes(java.lang.Object node)
node
- an ELEMENT node
public java.lang.Object getNamedAttribute(java.lang.Object node, ExpandedName nameTestExpandedName)
ExpandedName.getNamespaceURI()
returns null and ExpandedName.getLocalPart()
is a name.ExpandedName.getNamespaceURI()
returns non-null and ExpandedName.getLocalPart()
is a name.
node
- the ELEMENT to searchnameTestExpandedName
- the expanded name of the attribute to find
null
if not found.public boolean createAttribute(java.lang.Object node, java.lang.String attributeName, java.lang.String value)
This method is optional. If not implemented, inspectors should throw UnsupportedOperationException
.
node
- attributeName
- value
-
true
if the attribute could create the attribute, false
otherwise.public java.lang.Object addElement(java.lang.Object node, ExpandedName elementName, java.lang.Object addBeforeThisSibling) throws SimpleElementRequiresValueException, InvalidChildException
node
- a the ELEMENT under which the new element will be createdelementName
- the expanded name for the new element.addBeforeThisSibling
- a child of contextNode
or null
.
If non-null, then the new element is inserted immediately before this element.
If null
, the new element will be added at the end of the appropriate collection
of element children.
This method is optional. If not implemented, inspectors should throw UnsupportedOperationException
.
null
if the element could not be created.
SimpleElementRequiresValueException
InvalidChildException
public void removeElement(java.lang.Object node)
This method is optional. If not implemented, inspectors should throw UnsupportedOperationException
.
node
- the ELEMENT which is to be removed.public java.lang.Object copyElement(java.lang.Object tgtParent, java.lang.Object srcElement, java.lang.String name, boolean recursive) throws CopyElementException
srcElement
under tgtParent
with the specified name.
The implementation should check that tgtParent
and srcElement
are in the compatible meta-models.
This method is optional. If not implemented, inspectors should throw UnsupportedOperationException
.
tgtParent
- srcElement
- name
- recursive
-
CopyElementException
- if the copy cannot be successfully performed.public java.lang.Object addTextElement(java.lang.Object parentElement, java.lang.String name, java.lang.String bodyContent, boolean asCData) throws AddElementException
parentElement
with the specified
name and content.
This method is optional. If not implemented, inspectors should throw UnsupportedOperationException
.
parentElement
- name
- bodyContent
- asCData
- if true
, add as a CDATA section
AddElementException
public void removeAttribute(java.lang.Object node, java.lang.String name)
This method is optional. If not implemented, inspectors should throw UnsupportedOperationException
.
node
- name
-
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |