All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.xml.parser.TXElement
java.lang.Object
|
+----com.ibm.xml.parser.Child
|
+----com.ibm.xml.parser.Parent
|
+----com.ibm.xml.parser.TXElement
- public class TXElement
- extends Parent
- implements Element
-
TXElement(String)
- Make new Element instance.
-
TXElement(String, String, String)
- Make new Element instance.
-
clone()
- Clone this object and children.
-
cloneWithoutChildren()
- Clone this object without children.
-
elementAt(int)
- Return a child at specified position.
-
getAttribute(String)
- Return value of specified attribute name.
-
getAttributeArray()
- Return array of Attribute.
-
getAttributeInstance(String)
- Return an attribute instance.
-
getAttributes()
- [DOM]
-
getLanguage()
- Return language ID (value of
xml:lang
attribute).
-
getName()
- Return a name of this element.
-
getNameSpace()
- Return namespace.
-
getNodeType()
- [DOM] Return
Node.NodeType.ELEMENT
-
getQName()
- Return qualified name.
-
getTagName()
- [DOM] Return a name of this element.
-
getText()
- Make a string consisted of all child text.
-
getUserData()
- Return user data.
-
isEmpty()
- Return if this element is empty.
-
isPreserveSpace()
- Return if parser preserves spaces of texts and print() preserves spaces.
-
print(PrintWriter, int)
- Print to Writer.
-
print(PrintWriter, String, int)
- Print to Writer.
-
ripen()
- Called by DefaultElementFactory.
-
searchAncestors(String)
- Search ancestors for an element.
-
searchChildren(String)
- Search children for an element.
-
searchChildrenAll(String)
- Search children for elements.
-
setAttribute(Attribute)
- [DOM] Set an attribute.
-
setAttribute(String, String)
- Add an attribute.
-
setAttribute(TXAttribute)
- Add an attribute.
-
setAttributes(AttributeList)
- [DOM]
-
setPreserveSpace(boolean)
- Set if parser preserves spaces of texts and print() preserves spaces.
-
setTagName(String)
- [DOM]
-
setUserData(Object)
- Set user data.
-
size()
- Return number of children.
-
toString()
- Make a string representation of this instance.
TXElement
public TXElement(String name)
- Make new Element instance.
TXElement
public TXElement(String qname,
String ns,
String n)
- Make new Element instance.
getNodeType
public int getNodeType()
- [DOM] Return
Node.NodeType.ELEMENT
- Overrides:
- getNodeType in class Child
setTagName
public void setTagName(String tagName)
- [DOM]
getTagName
public String getTagName()
- [DOM] Return a name of this element.
getName
public String getName()
- Return a name of this element.
setAttributes
public void setAttributes(AttributeList attributes)
- [DOM]
getAttributes
public AttributeList getAttributes()
- [DOM]
setAttribute
public void setAttribute(Attribute newAttr)
- [DOM] Set an attribute.
getQName
public String getQName()
- Return qualified name.
This is the same of getName() when the Element has no namespace.
getNameSpace
public String getNameSpace()
- Return namespace.
- Returns:
- null when the element has no namespace.
isEmpty
public boolean isEmpty()
- Return if this element is empty.
`Empty' means that the element has no child.
elementAt
public Child elementAt(int i)
- Return a child at specified position.
size
public int size()
- Return number of children.
setPreserveSpace
public void setPreserveSpace(boolean f)
- Set if parser preserves spaces of texts and print() preserves spaces.
isPreserveSpace
public boolean isPreserveSpace()
- Return if parser preserves spaces of texts and print() preserves spaces.
clone
public synchronized Object clone()
- Clone this object and children.
- Overrides:
- clone in class Child
cloneWithoutChildren
public synchronized TXElement cloneWithoutChildren()
- Clone this object without children.
getAttributeArray
public TXAttribute[] getAttributeArray()
- Return array of Attribute.
getAttribute
public String getAttribute(String key)
- Return value of specified attribute name.
- Parameters:
- key - qualified name
- Returns:
- null if the element doesn't have specified attribute.
getAttributeInstance
public Attribute getAttributeInstance(String key)
- Return an attribute instance.
- Parameters:
- key - qualified name
- Returns:
- null if the element doesn't have specified attribute.
setAttribute
public void setAttribute(String key,
String value)
- Add an attribute.
This method doesn't support namespace.
setAttribute
public void setAttribute(TXAttribute a)
- Add an attribute.
getText
public String getText()
- Make a string consisted of all child text.
- Returns:
- "" if isEmpty() is true
- Overrides:
- getText in class Child
toString
public String toString()
- Make a string representation of this instance.
`<name att="value">...</name>'.
- Overrides:
- toString in class Object
print
public void print(PrintWriter pw,
int indent)
- Print to Writer.
- Overrides:
- print in class Child
print
public void print(PrintWriter pw,
String enc,
int indent)
- Print to Writer.
- Overrides:
- print in class Child
searchAncestors
public TXElement searchAncestors(String ename)
- Search ancestors for an element.
searchChildren
public TXElement searchChildren(String ename)
- Search children for an element.
Do not search grandchildren.
- Returns:
- first found element, null when not found
searchChildrenAll
public TXElement[] searchChildrenAll(String ename)
- Search children for elements.
Do not search grandchildren.
- Returns:
- all matched elements, never null
getLanguage
public String getLanguage()
- Return language ID (value of
xml:lang
attribute).
This method is not equivalent to getAttribute("xml:lang")
.
This method looks up parents of this element when this element has no language ID.
- Returns:
- null when this element and all of its parents have no language ID.
setUserData
public void setUserData(Object o)
- Set user data.
The parser doesn't touch this value.
getUserData
public Object getUserData()
- Return user data.
ripen
public void ripen()
- Called by DefaultElementFactory.
All Packages Class Hierarchy This Package Previous Next Index