|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.entry.NodeImpl
com.ibm.di.entry.Attribute
public class Attribute
The Attribute class is used in conjunction with the Entry object to store information about an attribute. The attribute has a name and a list of zero or more values. Each value can be any type of Java object so you can add values of any kind to the attribute.
This class has various methods which manipulates wrapped or unwrapped values. In this context 'unwrap' means to get an Object value at specified position, cast it to AttributeValue object, and call getValue() method on it. 'Wrapped' value simply means that the object is used as it is - an AttributeValue object.
Since IBM Tivoli Directory Integrator 7.0 an Attribute object could be treated as an array of objects (Object[]), the following script illustrates this:
// let's say that the work entry have an Attribute called "demo" defined like this: // create the Attribute; work.demo = new com.ibm.di.entry.Attribute(); // add values to the attribute; work.demo[0] = "val1"; work.demo[1] = new java.lang.Integer("5"); work.demo[2] = "thirdValue"; // From a performance point of view it is better to get a reference to the Attribute if we are going to use that object multiple times. // This will not make the Script Engine look up the "demo" attribute each time from the work entry. // The above lines "work.demo[x]" are not a good practice, this one is better: var attr = work.demo; // now the "demo" attribute have 3 values and we need to use each one of them. We could do that by using the [] notation just like we would do with an array. var val1 = attr[0]; var val2 = attr[1]; var val3 = attr[2]; // or we could cycle through each of the Attribute's values like this: for (val in attr.getValues()) main.logmsg(val); // The result of this is that each value is being printed in the log. // something like this: // val1 // 5.0 // thirdValue // Note that we use the getValues() method. // If we have done this: for (val in attr) main.logmsg(val); // Then the val variable would have a reference to the "demo" Attribute, // thus the log would contain a single line that is the string representation of the "demo" Attribute. // something like this: // demo:val1|5.0|thirdValue // This is because the toString() method of that Attribute is used implicitly.
Field Summary | |
---|---|
static char |
ATTRIBUTE_ADD
Add value |
static char |
ATTRIBUTE_DELETE
Delete value |
static char |
ATTRIBUTE_MOD
Values modified |
static char |
ATTRIBUTE_REPLACE
Replace value |
static char |
ATTRIBUTE_UNCHANGED
Unchanged |
static java.lang.String[] |
OPER
Array holding the string representation of the character fields: [0] = ATTRIBUTE_REPLACE [1] = ATTRIBUTE_ADD [2] = ATTRIBUTE_DELETE [3] = ATTRIBUTE_UNCHANGED [4] = ATTRIBUTE_MOD |
Fields inherited from class com.ibm.di.entry.NodeImpl |
---|
parent |
Fields inherited from interface org.w3c.dom.Node |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
---|---|
Attribute()
Initialize this attribute with no name, no values and the operation code set to ATTRIBUTE_REPLACE. |
|
Attribute(java.lang.String name)
Initializes this attribute with no values and the operation code set to ATTRIBUTE_REPLACE, the name is set to name. |
|
Attribute(java.lang.String name,
java.lang.Object value)
Initializes this attribute with operation code set to ATTRIBUTE_REPLACE, the name is set to name and the value value is added to the list of values. |
|
Attribute(java.lang.String qualifiedName,
java.lang.String namespaceURI,
boolean protect)
Initializes this attribute with operation code set to ATTRIBUTE_REPLACE, the name is set to the provided name and is marked to belong to the provided namespace URI. |
Method Summary | |
---|---|
void |
addValue(int position,
java.lang.Object val)
Adds the specified object as Attribute's value at the specified position. |
void |
addValue(int position,
java.lang.Object p1,
int valueOper)
Adds the specified object into this Attribute at the specified location. |
void |
addValue(java.lang.Object val)
Adds a value to the attribute's list of values. |
void |
addValue(java.lang.Object p1,
int valueOper)
Adds a value to this Attribute's list of values. |
Attribute |
addValues(Attribute attr)
Add the values in another Attribute to this Attribute. |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Appends the new child to the end of the list of values. |
void |
clear()
Removes all values from this attribute and sets the operation to ATTRIBUTE_REPLACE. |
Attribute |
clone()
Returns a clone of this object. |
Attribute |
cloneNode(boolean deep)
This method clones the Attribute object receiving the call. |
boolean |
contains(java.lang.Object value)
Checks if a value is contained in this Attribute. |
static java.lang.String |
escapeName(java.lang.String name)
Scans for characters that need to be escaped and returns a string with those characters escaped. |
java.lang.String |
getAttribute(java.lang.String name)
|
Property |
getAttributeNode(java.lang.String name)
|
Property |
getAttributeNodeNS(java.lang.String namespaceURI,
java.lang.String localName)
|
java.lang.String |
getAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
|
org.w3c.dom.NamedNodeMap |
getAttributes()
|
org.w3c.dom.NodeList |
getCDATASections()
This is a convenient method that will gather all the CDATASection
children and will return them as a NodeList object. |
org.w3c.dom.NodeList |
getChildNodes()
This is the internal list of DOM children this Attribute have. |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String tagname)
|
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
|
org.w3c.dom.Node |
getFirstChild()
|
org.w3c.dom.Node |
getLastChild()
|
java.lang.String |
getLocalName()
|
java.lang.String |
getName()
Returns this Attribute's name without stripping it off the escape characters the name might has. |
java.lang.String |
getNamespaceURI()
|
java.lang.String |
getNodeName()
|
short |
getNodeType()
|
java.lang.String |
getNodeValue()
This method will return the result of concatenation of all the AttributeText nodes this Attribute have. |
char |
getOper()
Returns the operation type of this Attribute. |
java.lang.String |
getOperation()
Returns the operation type of this Attribute as a String. |
Entry |
getOwnerDocument()
|
java.lang.String |
getPrefix()
|
boolean |
getProtected()
Returns the protected value of this Attribute |
org.w3c.dom.TypeInfo |
getSchemaTypeInfo()
Not implemented! |
java.lang.String |
getTagName()
|
org.w3c.dom.NodeList |
getTextSections()
This is a convenient method that will gather all the Text
children and will return them as a NodeList object. |
java.lang.String |
getValue()
Returns the first value, if any, as a String object. |
java.lang.Object |
getValue(int index)
Returns the value at the position given by index. |
java.lang.Object |
getValueAV(int index)
Returns the object at the given index. |
int |
getValueOper(int index)
Returns the value operation code at a specified index as an integer. |
java.lang.String |
getValueOperation(int index)
Returns the operation code as a string (add, delete, unchanged) for a given index. |
java.lang.Object[] |
getValues()
Returns this attribute's values as an array of objects. |
java.lang.Object[] |
getValuesAV()
Returns this Attribute's values as an array of objects. |
java.util.Vector |
getValuesVector()
Returns this Attribute's values as a Vector. |
boolean |
hasAttribute(java.lang.String name)
|
boolean |
hasAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
Checks to see if a property with the specified localName and Attribute exists. |
boolean |
hasAttributes()
|
boolean |
hasChildNodes()
|
boolean |
hasValue(java.lang.Object value)
Checks if a value is contained in this Attribute. |
boolean |
hasValueIC(java.lang.String value)
Checks if a string value is contained in this attribute. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Inserts the new child before the reference child. |
void |
internalGetElementsByTagName(java.lang.String tagname,
java.util.List<NodeImpl> attList)
|
void |
internalGetElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName,
java.util.List<NodeImpl> attList)
|
protected java.lang.String |
internalLookupPrefix(java.lang.String namespaceURI)
Searches for the first prefix that is matched to the provided namespaceURI. |
protected java.lang.String |
internalNSLookup(java.lang.String prefix)
Contains Attribute specific logic for looking up a NameSpace using the provided prefix. |
boolean |
isEqualNode(org.w3c.dom.Node other)
First calls super isEqualNode(Node) and if it returns true then
the following checks are done: checks whether the other object is instance of the
Attribute class compares each Properties both Attributes have
compares the operations of both Attributes
If at least one of the above checks do not pass then the two Attributes
are considered different. |
protected void |
merge(Attribute a)
Merges the children/properties of another attribute to this attribute. |
static java.lang.String |
normalizeName(java.lang.String name)
Strips down the escape characters from the provided String. |
void |
removeAttribute(java.lang.String name)
Removes the Property found by the specified name (e.g. |
org.w3c.dom.Attr |
removeAttributeNode(org.w3c.dom.Attr oldAttr)
Removes the specified Property from this Attribute node. |
void |
removeAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
Removes the Property found by the specified local name and namespace. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Removes the specified Node from this Attribute. |
boolean |
removeValue(java.lang.Object p1)
Removes all instances of a value from the attribute's list of values. |
java.lang.Object |
removeValueAt(int index)
Removes a value at a given index. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replaces an existing node with a new node. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
|
org.w3c.dom.Attr |
setAttributeNode(org.w3c.dom.Attr newAttr)
|
org.w3c.dom.Attr |
setAttributeNodeNS(org.w3c.dom.Attr newAttr)
|
void |
setAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName,
java.lang.String value)
|
void |
setIdAttribute(java.lang.String name,
boolean isId)
IDs are not supported! |
void |
setIdAttributeNode(org.w3c.dom.Attr idAttr,
boolean isId)
IDs are not supported! |
void |
setIdAttributeNS(java.lang.String namespaceURI,
java.lang.String localName,
boolean isId)
IDs are not supported! |
void |
setName(java.lang.String name)
Sets this Attribute's name. |
void |
setNodeValue(java.lang.String nodeValue)
This method will remove all the child nodes of type Text this Attribute might have. |
void |
setOper(char operation)
Sets the operation type of this Attribute. |
void |
setOperation(java.lang.String operation)
Sets the operation type of this Attribute. |
void |
setPrefix(java.lang.String prefix)
|
Attribute |
setProtected(boolean protect)
Deprecated. use setProtected(boolean, boolean) instead. |
void |
setProtected(boolean protect,
boolean deep)
Marks this Attribute as protected and prevents its String values to be written when toString() or toDeltaString() are called. |
void |
setValue(int index,
java.lang.Object val)
Sets the attribute's value at a specific position to the value specified. |
void |
setValue(int position,
java.lang.Object p2,
int valueOper)
Sets the attribute's value at a specific position to the value specified. |
void |
setValue(java.lang.Object val)
Sets this Attribute's value at position 0 to the value specified. |
void |
setValue(java.lang.Object p1,
int valueOper)
Sets this Attribute's value at position 0 to the value specified. |
void |
setValueOper(int index,
int valueOper)
Sets the value operation code. |
void |
setValueOperation(int index,
java.lang.String valueOper)
Sets the value operation code for a specified index. |
void |
setValues(java.util.List<? extends java.lang.Object> values)
Sets this Attribute's values using the List passed to it. |
void |
setValues(java.lang.Object[] values)
Sets the Attribute's values to the array of objects provided by values. |
int |
size()
Returns the number of values contained in this Attribute. |
java.lang.String |
toDeltaString()
Returns the Delta string representation of this Attribute. |
org.w3c.dom.Element |
toDOM(org.w3c.dom.Document doc)
Converts an Attribute to a custom DOM implementation. |
java.lang.String |
toString()
Returns the string representation of this attribute. |
Methods inherited from class com.ibm.di.entry.NodeImpl |
---|
compareDocumentPosition, getBaseURI, getFeature, getNextSibling, getParentNode, getPreviousSibling, getTextContent, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, setTextContent, setUserData |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
---|
compareDocumentPosition, getBaseURI, getFeature, getNextSibling, getParentNode, getPreviousSibling, getTextContent, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, setTextContent, setUserData |
Field Detail |
---|
public static final char ATTRIBUTE_REPLACE
public static final char ATTRIBUTE_ADD
public static final char ATTRIBUTE_DELETE
public static final char ATTRIBUTE_UNCHANGED
public static final char ATTRIBUTE_MOD
public static final java.lang.String[] OPER
ATTRIBUTE_REPLACE
ATTRIBUTE_ADD
ATTRIBUTE_DELETE
ATTRIBUTE_UNCHANGED
ATTRIBUTE_MOD
Constructor Detail |
---|
public Attribute()
public Attribute(java.lang.String name)
name
- The attribute namepublic Attribute(java.lang.String name, java.lang.Object value)
name
- The attribute namevalue
- The attribute valuepublic Attribute(java.lang.String qualifiedName, java.lang.String namespaceURI, boolean protect)
qualifiedName
- this is the raw name (escaped appropriately) to set to the
attribute the.namespaceURI
- the namespace this Attribute belongs toprotect
- marks the Attribute as protected, by default is falseMethod Detail |
---|
public Attribute clone()
clone
in class java.lang.Object
cloneNode(boolean)
public void clear()
Example:
var entry = input.getConnector.getNextEntry(); var attrlist = entry.getAttributeNames(); for (i = 0; i < attrlist.length; i++) { var attr = entry.getAttribute(attrlist[i]); if (system.startsWithIC(attrlist[i], "del")) { attr.clear(); } } // print the results where all attributes with names starting // with 'del' are cleared task.dumpEntry(entry);The Properties of the Attribute are not changed.
public boolean hasValue(java.lang.Object value)
value
- The value to check for
contains(java.lang.Object)
public boolean hasValueIC(java.lang.String value)
Example:
if (conn.hasValueIC("this value")) { task.logmsg("It is there"); }
value
- The string value to check for
public boolean contains(java.lang.Object value)
Example:
var entry = input.getConnector().getNextEntry(); var attrlist = entry.getAttributeNames(); for (i = 0; i < attrlist.length; i++) { var attr = entry.getAttribute(attrlist[i]); if (attrlist[i].equals("name") && attr.contains("John") && attr.contains("Smith")) { task.logmsg("Another John Smith coming..."); } }
value
- The value to check for
public java.lang.String getValue()
public java.lang.Object getValue(int index)
Example:
var v = conn.getAttribute("attrname").getValue ( 0 ); task.logmsg( "Java class of v is: " + v.getClass().getName() ); task.logmsg( "String representation: " + v.toString() ); if ( v.getClass().getName() == "java.util.Date" ) { task.logmsg("Date object: " + v.getMonth(); }
index
- The position
size()
public java.lang.Object getValueAV(int index)
AttributeValue.AV_REPLACE
. In this case the actual value of the
attribute is returned. If the AttributeValue's operation code is
different from the above, the whole AttributeValue object is returned
instead of the actual value. Note: if you want to access each
value as an AttributeValue object (disregarding the operation code), use
the DOM API.task.logmsg("Attribute: " + myAttr); //attribute var index = 2; //value's index var nodeList = work.getAttribute(attr).getChildNodes(); var internalIndex = 0; var value = null; for(node in nodeList) { // The nodeList may contain Attribute objects. In order to get the correct // index of the value we need to increase the internalIndex only when an // AttributeValue is found. if(!(node instanceof com.ibm.di.entry.Attribute) && internalIndex++ == index) { value = node; break; } task.logmsg("Value(" + index + ")= " + value);
index
- the position
public java.lang.Object[] getValues()
Example:
// get values of attribute of conn object; var vallist = conn.getAttribute("name").getValues(); // cycle through each of the Attribute's values and print them for (val in vallist) main.logmsg(val); // or you could print them like this for (i = 0; i < vallist.length; i++) { main.logmsg(vallist[i]); }
public java.util.Vector getValuesVector()
Example:
// get values of attribute of conn object; var vallist = conn.getAttribute("name").getValuesVector(); // cycle through each of the Attribute's values and print them for (i = 0; i < vallist.size(); i++) { main.logmsg(vallist.get(i)); }
getValues()
public java.lang.Object[] getValuesAV()
AttributeValue.AV_REPLACE
. Otherwise no unwrapping is performed
and the AttributeValue objects are returned. The array may be empty if
the attribute has no values (e.g. arr.length == 0).Note: if you
need an array where all the values are wrapped (as AttributeValue
objects) you must use the DOM API instead.task.logmsg("Attribute: " + myAttr); //attribute var nodeList = work.getAttribute(attr).getChildNodes(); var array = new Array(); var i = 0; for(node in nodeList) { if(!(node instanceof com.ibm.di.entry.Attribute)) array[i++] = node; } //the 'array' holds AttributeValue objects only
getValues()
public void setValues(java.util.List<? extends java.lang.Object> values)
values
- The new values listpublic void setValues(java.lang.Object[] values)
Example:
// suppose work entry has attribute 'changenumbers' // with int values we want to sort var attr = work.getAttribute("changenumbers"); var vlist = attr.getValues(); // sort values of attribute 'changenumbers' java.util.Arrays.sort(vlist); // update sorted values to entry attribute attr.setValues(vlist);
values
- The new value arraypublic void setValue(java.lang.Object val)
Example:
var entry = input.getConnector.getNextEntry(); var attrlist = entry.getAttributeNames(); for (i = 0; i < attrlist.length; i++) { var attr = entry.getAttribute(attrlist[i]); attr.setValue("firstValue") }
val
- The new valuepublic void addValue(java.lang.Object val)
Example:
// create the Attribute; var attr = new com.ibm.di.entry.Attribute(); // add values to the attribute; attr.addValue("one"); attr.addValue(2); attr.addValue('3'); // cycle through each of the Attribute's values and print them for (val in attr.getValues()) main.logmsg(val); // The result is: // one // 2.0 // 3
val
- The new valuepublic void setValue(int index, java.lang.Object val)
index
- The positionval
- The value
java.lang.ArrayIndexOutOfBoundsException
- if the index was invalid.public boolean removeValue(java.lang.Object p1)
p1
- The value to remove
public java.lang.Object removeValueAt(int index)
index
- The index of the value to remove
public java.lang.String getName()
getNodeName()
instead.
public void setName(java.lang.String name)
name
- The new name of this Attributepublic char getOper()
public java.lang.String getOperation()
public void setOper(char operation)
operation
- The operation type as a charpublic void setOperation(java.lang.String operation)
operation
- The operation type as a stringpublic int size()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toDeltaString()
public void setValue(java.lang.Object p1, int valueOper)
p1
- The new valuevalueOper
- The value operation codesetValue(Object)
public void setValue(int position, java.lang.Object p2, int valueOper)
position
- The positionp2
- The valuevalueOper
- The value operation code
java.lang.ArrayIndexOutOfBoundsException
- if the position was invalid.public void addValue(java.lang.Object p1, int valueOper)
Example:
// suppose work entry has 'lowercasestring' attribute with some string values var attr = work.newAttribute("lowercasestring"); // add new values to the attribute attr.addValue("Mamut", com.ibm.di.entry.AttributeValue.AV_ADD); attr.addValue("APPC", com.ibm.di.entry.AttributeValue.AV_ADD); main.logmsg("Before validation:"); task.dumpEntry(work); // find all newly added values and make them lowercase for (i = 0; i < attr.size(); i++) { if (attr.getValueOper(i) == com.ibm.di.entry.AttributeValue.AV_ADD) { var str = attr.getValue(i).toLowerCase(); attr.setValue(i, str); } } // print result main.logmsg("After validation:"); task.dumpEntry(work);
p1
- The new valuevalueOper
- The value operation codepublic void addValue(int position, java.lang.Object val)
Example:
// suppose work entry has attribute 'changenumbers' // with int values in ascending order which we want to keep var vlist = attr.getValues(); // value we want to insert into 'changenumbers' attribute var insertval = 5; //insert value keeping ascending order of attribute's values for (i = 0; i < vlist.length; i++) { main.logmsg(vlist[i]); if (insertval >= vlist[i] && insertval <= vlist[i + 1]) { main.logmsg("Found place to insert "); attr.addValue(i + 1, insertval); break; } } main.dumpEntry(work);
position
- the index at which to insert the elementval
- the object to insert in this Vector
java.lang.ArrayIndexOutOfBoundsException
- when location < 0 || > size()
public void addValue(int position, java.lang.Object p1, int valueOper)
position
- the index at which to insert the elementp1
- the object to insert in this VectorvalueOper
- The value operation code
java.lang.ArrayIndexOutOfBoundsException
- when location < 0 || > size()
addValue(Object, int)
public void setValueOper(int index, int valueOper)
index
- The value indexvalueOper
- The value operation codepublic int getValueOper(int index)
Example:
// suppose work entry has 'lowercasestring' attribute with some values var attr = work.newAttribute("lowercasestring"); // add new values to the attribute attr.addValue("Mamut", com.ibm.di.entry.AttributeValue.AV_ADD); attr.addValue("APPC", com.ibm.di.entry.AttributeValue.AV_ADD); main.logmsg("Before validation:"); task.dumpEntry(work); // find all newly added values and make them lowercase for (i = 0; i < attr.size(); i++) { if (attr.getValueOper(i) == com.ibm.di.entry.AttributeValue.AV_ADD) { var str = attr.getValue(i).toLowerCase(); attr.setValue(i, str); } } // print result main.logmsg("After validation:"); task.dumpEntry(work);
index
- The value index
public void setValueOperation(int index, java.lang.String valueOper)
index
- The new valuevalueOper
- The string-version operation codepublic java.lang.String getValueOperation(int index)
index
- The index@Deprecated public Attribute setProtected(boolean protect)
setProtected(boolean, boolean)
instead.
protect
- - If true, try to protect the Attribute values by not dumping
them in log files
public void setProtected(boolean protect, boolean deep)
toString()
or toDeltaString()
are called.
protect
- specify the state of the flag.deep
- specify whether the provided state of the flag will be applied
for all the children in the sub-tree.public boolean getProtected()
public Attribute addValues(Attribute attr)
Example:
// create one Attribute; var attr1 = new com.ibm.di.entry.Attribute(); // add values to the attribute; attr1.addValue("one"); attr1.addValue('2'); attr1.addValue(3); var attr2 = work.attr2.addValues(attr1); //the result is that attr2 now have 3 values: 'one' '2' '3.0'
attr
- The Attribute from which values are collected
public static final java.lang.String normalizeName(java.lang.String name)
name
- the name to remove the escape characters from.
public static final java.lang.String escapeName(java.lang.String name)
name
- the name to escape.
public org.w3c.dom.Element toDOM(org.w3c.dom.Document doc) throws javax.xml.parsers.ParserConfigurationException
AttributeCDATA
and
AttributeText
), the rest are ignored.
doc
- - the document implementation to use
javax.xml.parsers.ParserConfigurationException
protected void merge(Attribute a)
a
- the Attribute to merge values frompublic org.w3c.dom.NodeList getTextSections()
Text
children and will return them as a NodeList object.
public org.w3c.dom.NodeList getCDATASections()
CDATASection
children and will return them as a NodeList object.
public Entry getOwnerDocument()
getOwnerDocument
in interface org.w3c.dom.Node
getOwnerDocument
in class NodeImpl
public Attribute cloneNode(boolean deep)
clone()
is called.
cloneNode
in interface org.w3c.dom.Node
deep
- specifies whether a deep clone should be done or not.
public java.lang.String getLocalName()
getLocalName
in interface org.w3c.dom.Node
public short getNodeType()
getNodeType
in interface org.w3c.dom.Node
Node.ELEMENT_NODE
public java.lang.String getNodeValue()
getNodeValue
in interface org.w3c.dom.Node
public void setNodeValue(java.lang.String nodeValue)
setNodeValue
in interface org.w3c.dom.Node
nodeValue
- the text of the text node that will be appended to the values
list.
DOMException
- if an error occurs while removing Text nodes.public java.lang.String getNamespaceURI()
getNamespaceURI
in interface org.w3c.dom.Node
public java.lang.String getAttribute(java.lang.String name)
getAttribute
in interface org.w3c.dom.Element
public java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
getAttributeNS
in interface org.w3c.dom.Element
public Property getAttributeNode(java.lang.String name)
getAttributeNode
in interface org.w3c.dom.Element
public Property getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
getAttributeNodeNS
in interface org.w3c.dom.Element
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
getElementsByTagName
in interface org.w3c.dom.Element
public void internalGetElementsByTagName(java.lang.String tagname, java.util.List<NodeImpl> attList)
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
getElementsByTagNameNS
in interface org.w3c.dom.Element
public void internalGetElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName, java.util.List<NodeImpl> attList)
public org.w3c.dom.TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo
in interface org.w3c.dom.Element
public java.lang.String getTagName()
getTagName
in interface org.w3c.dom.Element
public boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
hasAttributes
in class NodeImpl
public boolean hasAttribute(java.lang.String name)
hasAttribute
in interface org.w3c.dom.Element
public boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName) throws DOMException
hasAttributeNS
in interface org.w3c.dom.Element
localName
- the local name of the PropertynamespaceURI
- the namespace of the Property
DOMException
public void removeAttribute(java.lang.String name)
removeAttribute
in interface org.w3c.dom.Element
name
- the name of the property to look for.public void removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
removeAttributeNS
in interface org.w3c.dom.Element
namespaceURI
- the namespace the property to remove belongs tolocalName
- the local name of the property to be removedpublic org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
null
. If the Property has a parent but it is different than
this Attribute then a DOMException
is thrown.
removeAttributeNode
in interface org.w3c.dom.Element
oldAttr
- the property to remove from this attribute.
public void setAttribute(java.lang.String name, java.lang.String value)
setAttribute
in interface org.w3c.dom.Element
public void setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)
setAttributeNS
in interface org.w3c.dom.Element
public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
setAttributeNode
in interface org.w3c.dom.Element
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
setAttributeNodeNS
in interface org.w3c.dom.Element
public void setIdAttribute(java.lang.String name, boolean isId)
setIdAttribute
in interface org.w3c.dom.Element
name
- isId
-
DOMException
- - neverpublic void setIdAttributeNS(java.lang.String namespaceURI, java.lang.String localName, boolean isId)
setIdAttributeNS
in interface org.w3c.dom.Element
namespaceURI
- localName
- isId
-
DOMException
- - neverpublic void setIdAttributeNode(org.w3c.dom.Attr idAttr, boolean isId)
setIdAttributeNode
in interface org.w3c.dom.Element
idAttr
- isId
-
DOMException
- - neverpublic boolean isEqualNode(org.w3c.dom.Node other)
isEqualNode(Node)
and if it returns true then
the following checks are done: other
object is instance of the
Attribute class
isEqualNode
in interface org.w3c.dom.Node
isEqualNode
in class NodeImpl
other
- the node to compare this Attribute to
protected java.lang.String internalNSLookup(java.lang.String prefix)
internalNSLookup
in class NodeImpl
prefix
- the prefix mapped to the namespace.
protected java.lang.String internalLookupPrefix(java.lang.String namespaceURI)
internalLookupPrefix
in class NodeImpl
namespaceURI
- specifies the namespace to look for.
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
appendChild
in interface org.w3c.dom.Node
appendChild
in class NodeImpl
newChild
- the new child node to append.
public org.w3c.dom.NamedNodeMap getAttributes()
getAttributes
in interface org.w3c.dom.Node
getAttributes
in class NodeImpl
public org.w3c.dom.NodeList getChildNodes()
getChildNodes
in interface org.w3c.dom.Node
getChildNodes
in class NodeImpl
public org.w3c.dom.Node getFirstChild()
getFirstChild
in interface org.w3c.dom.Node
getFirstChild
in class NodeImpl
public org.w3c.dom.Node getLastChild()
getLastChild
in interface org.w3c.dom.Node
getLastChild
in class NodeImpl
public boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
hasChildNodes
in class NodeImpl
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
insertBefore
in interface org.w3c.dom.Node
insertBefore
in class NodeImpl
newChild
- the new child node to inserted.refChild
- the reference child before which the new child will be
inserted.
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
removeChild
in interface org.w3c.dom.Node
removeChild
in class NodeImpl
oldChild
- the node to remove.
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
replaceChild
in interface org.w3c.dom.Node
replaceChild
in class NodeImpl
newChild
- the node to replace the old node witholdChild
- then node that will be replaced
public void setPrefix(java.lang.String prefix) throws DOMException
setPrefix
in interface org.w3c.dom.Node
DOMException
public java.lang.String getPrefix()
getPrefix
in interface org.w3c.dom.Node
public java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
getNodeName
in class NodeImpl
getName()
method, because it does not contain
escaped characters. For example if this method returns
node.name it will defer from the other name which would be
node\.name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |