public class XmlElementImpl extends Object implements XmlElement
NO_NAMESPACE| Modifier and Type | Method and Description |
|---|---|
XmlAttribute |
addAttribute(String name,
String value)
addAttribute
|
XmlAttribute |
addAttribute(String attributeType,
String attributePrefix,
String attributeNamespace,
String attributeName,
String attributeValue,
boolean specified)
Method addAttribute
|
XmlAttribute |
addAttribute(String attributeType,
XmlNamespace namespace,
String name,
String value)
Method addAttribute
|
XmlAttribute |
addAttribute(String attributeType,
XmlNamespace namespace,
String name,
String value,
boolean specified)
Method addAttribute
|
XmlAttribute |
addAttribute(XmlAttribute attributeValueToAdd)
Add attribute (adds it to the XML Infoset [namespace attributes] set)
Attribute mist
|
XmlAttribute |
addAttribute(XmlNamespace namespace,
String name,
String value)
Method addAttribute
|
void |
addChild(int index,
Object child)
Method addChild
|
void |
addChild(Object child)
NOTE: =child added is _not_ checked if it XmlContainer, caller must manually fix
parent in child by calling setParent() !!!!
|
XmlElement |
addElement(int pos,
XmlElement element)
Method addElement
|
XmlElement |
addElement(String name)
Method addElement
|
XmlElement |
addElement(XmlElement element)
NOTE: the child element must unattached to be added
(it is atttached if it is XmlContainer of recognized type and getParent() != null)
|
XmlElement |
addElement(XmlNamespace namespace,
String name)
Method addElement
|
XmlAttribute |
attribute(String attributeName)
Find attribute that matches given name or namespace
Returns null if not found.
|
XmlAttribute |
attribute(XmlNamespace attributeNamespace,
String attributeName)
Find attribute that matches given name or namespace
Returns null if not found.
|
Iterator |
attributes()
Return Iterator
|
Iterator |
children()
Return Iterator
|
Object |
clone()
Method clone
|
XmlNamespace |
declareNamespace(String prefix,
String namespaceName)
Create new namespace with prefix and namespace name (both must be not null)
and add it to current element.
|
XmlNamespace |
declareNamespace(XmlNamespace n)
Add namespace to current element (both prefix and namespace name must be not null)
|
XmlElement |
element(int position)
return element at poition (0..count-1) or IndexOutOfBoundsException if positon incorrect
|
XmlElement |
element(XmlNamespace n,
String name)
find first element with name and namespace (if namespace is null it is ignored in search)
|
XmlElement |
element(XmlNamespace n,
String name,
boolean create)
find first element with name and namespace (if namespace is null it is ignored in search)
if no matching element is found then new element is created, appended to children, and returned
|
Iterable |
elements(XmlNamespace n,
String name)
Return all elements that has namespace and name (null is never returned but empty iteraotr)
|
void |
ensureAttributeCapacity(int minCapacity)
Method ensureAttributeCapacity
|
void |
ensureChildrenCapacity(int minCapacity)
Method ensureChildrenCapacity
|
void |
ensureNamespaceDeclarationsCapacity(int minCapacity)
Method ensureNamespaceDeclarationsCapacity
|
XmlAttribute |
findAttribute(String attributeNamespace,
String attributeName)
Deprecated.
|
XmlElement |
findElementByName(String name) |
XmlElement |
findElementByName(String namespaceName,
String name) |
XmlElement |
findElementByName(String namespaceName,
String name,
XmlElement elementToStartLooking) |
XmlElement |
findElementByName(String name,
XmlElement elementToStartLooking) |
String |
getAttributeValue(String attributeNamespaceName,
String attributeName)
Method getAttributeValue
|
String |
getBaseUri()
XML Infoset [base URI] property
|
String |
getName()
XML Infoset [local name] property.
|
XmlNamespace |
getNamespace()
Return namespace of current element
(XML Infoset [namespace name] and [prefix] properties combined)
null is only returned if
element was created without namespace
|
String |
getNamespaceName()
Return namespace name (XML Infoset [namespace name]property
or null if element has no namespace
|
XmlContainer |
getParent()
XML Infoset [parent] property.
|
XmlContainer |
getRoot()
Get top most container that is either XmlDocument or XmlElement (may be event this element!!!)
|
boolean |
hasAttributes()
Method hasAttributes
|
boolean |
hasChild(Object child)
Method hasChild
|
boolean |
hasChildren()
Method hasChildren
|
boolean |
hasNamespaceDeclarations()
Method hasNamespaceDeclarations
|
void |
insertChild(int pos,
Object childToInsert) |
XmlNamespace |
lookupNamespaceByName(String namespaceName)
Find namespace (will have non empty prefix) corresponding to namespace name
checking first current elemen and if not found continue in parent (if element has parent).
|
XmlNamespace |
lookupNamespaceByPrefix(String namespacePrefix)
Find namespace (will have non empty prefix) corresponding to namespace prefix
checking first current elemen and if not found continue in parent (if element has parent)
and so on.
|
Iterator |
namespaces()
Return Iterator
|
XmlElement |
newElement(String name)
Create unattached element
|
XmlElement |
newElement(String namespace,
String name)
Method newElement
|
XmlElement |
newElement(XmlNamespace namespace,
String name)
Method newElement
|
XmlNamespace |
newNamespace(String namespaceName)
Create new namespace with null prefix (namespace name must be not null).
|
XmlNamespace |
newNamespace(String prefix,
String namespaceName)
Create new namespace with prefix and namespace name (both must be not null).
|
void |
removeAllAttributes()
Method removeAllAttributes
|
void |
removeAllChildren()
Removes all children - every child that was
implementing XmlNode will have set parent to null.
|
void |
removeAllNamespaceDeclarations()
Method removeAllNamespaceDeclarations
|
void |
removeAttribute(XmlAttribute attr)
Method removeAttribute
|
void |
removeChild(Object child)
Method removeChild
|
void |
replaceChild(Object newChild,
Object oldChild)
Method replaceChild
|
void |
replaceChildrenWithText(String textContent)
Remove all children and then add this text as only child.
|
XmlElement |
requiredElement(XmlNamespace n,
String name)
call element(n, name) and if null was returnedthrow XmlBuilderException
|
Iterable |
requiredElementContent()
Return Iterator
|
String |
requiredTextContent()
return children content as text - if there are any no text children throw exception
|
void |
setBaseUri(String baseUri)
XML Infoset [base URI] property
|
void |
setName(String name)
XML Infoset [local name] property.
|
void |
setNamespace(XmlNamespace namespace)
Set namespace ot use for theis element.
|
void |
setParent(XmlContainer parent)
Method setParent
|
String |
toString() |
public Object clone() throws CloneNotSupportedException
XmlElementclone in interface XmlElementclone in class ObjectCloneNotSupportedExceptionpublic XmlContainer getRoot()
XmlElementgetRoot in interface XmlElementpublic XmlContainer getParent()
XmlElementgetParent in interface XmlContainedgetParent in interface XmlElementpublic void setParent(XmlContainer parent)
XmlElementsetParent in interface XmlContainedsetParent in interface XmlElementparent - a XmlContainerpublic XmlNamespace getNamespace()
XmlElementgetNamespace in interface XmlElementpublic String getNamespaceName()
XmlElementgetNamespaceName in interface XmlElementpublic void setNamespace(XmlNamespace namespace)
XmlElementsetNamespace in interface XmlElementpublic String getName()
XmlElementgetName in interface XmlElementpublic void setName(String name)
XmlElementsetName in interface XmlElementname - a Stringpublic String getBaseUri()
XmlElementgetBaseUri in interface XmlElementpublic void setBaseUri(String baseUri)
XmlElementsetBaseUri in interface XmlElementbaseUri - a Stringpublic Iterator attributes()
XmlElementattributes in interface XmlElementpublic XmlAttribute addAttribute(XmlAttribute attributeValueToAdd)
XmlElementaddAttribute in interface XmlElementattributeValueToAdd - a XmlAttributepublic XmlAttribute addAttribute(XmlNamespace namespace, String name, String value)
XmlElementaddAttribute in interface XmlElementnamespace - a XmlNamespacename - a Stringvalue - a Stringpublic XmlAttribute addAttribute(String name, String value)
XmlElementaddAttribute in interface XmlElementname - a Stringvalue - a Stringpublic XmlAttribute addAttribute(String attributeType, XmlNamespace namespace, String name, String value)
XmlElementaddAttribute in interface XmlElementattributeType - a Stringnamespace - a XmlNamespacename - a Stringvalue - a Stringpublic XmlAttribute addAttribute(String attributeType, XmlNamespace namespace, String name, String value, boolean specified)
XmlElementaddAttribute in interface XmlElementattributeType - a Stringnamespace - a XmlNamespacename - a Stringvalue - a Stringspecified - a booleanpublic XmlAttribute addAttribute(String attributeType, String attributePrefix, String attributeNamespace, String attributeName, String attributeValue, boolean specified)
XmlElementaddAttribute in interface XmlElementattributeType - a StringattributePrefix - a StringattributeNamespace - a StringattributeName - a StringattributeValue - a Stringspecified - a booleanpublic void ensureAttributeCapacity(int minCapacity)
XmlElementensureAttributeCapacity in interface XmlElementminCapacity - an intpublic String getAttributeValue(String attributeNamespaceName, String attributeName)
XmlElementgetAttributeValue in interface XmlElementattributeNamespaceName - a StringattributeName - a Stringpublic boolean hasAttributes()
XmlElementhasAttributes in interface XmlElementpublic XmlAttribute attribute(String attributeName)
XmlElementattribute in interface XmlElementpublic XmlAttribute attribute(XmlNamespace attributeNamespace, String attributeName)
XmlElementattribute in interface XmlElementpublic XmlAttribute findAttribute(String attributeNamespace, String attributeName)
XmlElementfindAttribute in interface XmlElementpublic void removeAllAttributes()
XmlElementremoveAllAttributes in interface XmlElementpublic void removeAttribute(XmlAttribute attr)
XmlElementremoveAttribute in interface XmlElementattr - a XmlAttributepublic XmlNamespace declareNamespace(String prefix, String namespaceName)
XmlElementdeclareNamespace in interface XmlElementpublic XmlNamespace declareNamespace(XmlNamespace n)
XmlElementdeclareNamespace in interface XmlElementpublic boolean hasNamespaceDeclarations()
XmlElementhasNamespaceDeclarations in interface XmlElementpublic XmlNamespace lookupNamespaceByPrefix(String namespacePrefix)
XmlElementlookupNamespaceByPrefix in interface XmlElementpublic XmlNamespace lookupNamespaceByName(String namespaceName)
XmlElementlookupNamespaceByName in interface XmlElementpublic Iterator namespaces()
XmlElementnamespaces in interface XmlElementpublic XmlNamespace newNamespace(String namespaceName)
XmlElementnewNamespace in interface XmlElementpublic XmlNamespace newNamespace(String prefix, String namespaceName)
XmlElementnewNamespace in interface XmlElementpublic void ensureNamespaceDeclarationsCapacity(int minCapacity)
XmlElementensureNamespaceDeclarationsCapacity in interface XmlElementminCapacity - an intpublic void removeAllNamespaceDeclarations()
XmlElementremoveAllNamespaceDeclarations in interface XmlElementpublic void addChild(Object child)
XmlElementaddChild in interface XmlElementpublic void addChild(int index,
Object child)
XmlElementaddChild in interface XmlElementindex - an int (starting from 0)child - an Objectpublic XmlElement addElement(XmlElement element)
XmlElementaddElement in interface XmlElementpublic XmlElement addElement(int pos, XmlElement element)
XmlElementaddElement in interface XmlElementpos - an int (starting from 0)element - a XmlElementpublic XmlElement addElement(XmlNamespace namespace, String name)
XmlElementaddElement in interface XmlElementnamespace - a XmlNamespacename - a Stringpublic XmlElement addElement(String name)
XmlElementaddElement in interface XmlElementname - a Stringpublic Iterator children()
XmlElementchildren in interface XmlElementpublic Iterable requiredElementContent()
XmlElementrequiredElementContent in interface XmlElementpublic String requiredTextContent()
XmlElementrequiredTextContent in interface XmlElementpublic void ensureChildrenCapacity(int minCapacity)
XmlElementensureChildrenCapacity in interface XmlElementminCapacity - an intpublic XmlElement element(int position)
XmlElementelement in interface XmlElementpublic XmlElement requiredElement(XmlNamespace n, String name) throws XmlBuilderException
XmlElementrequiredElement in interface XmlElementXmlBuilderExceptionpublic XmlElement element(XmlNamespace n, String name)
XmlElementelement in interface XmlElementpublic XmlElement element(XmlNamespace n, String name, boolean create)
XmlElementelement in interface XmlElementpublic Iterable elements(XmlNamespace n, String name)
XmlElementelements in interface XmlElementpublic XmlElement findElementByName(String name)
findElementByName in interface XmlElementpublic XmlElement findElementByName(String namespaceName, String name, XmlElement elementToStartLooking)
findElementByName in interface XmlElementpublic XmlElement findElementByName(String name, XmlElement elementToStartLooking)
findElementByName in interface XmlElementpublic XmlElement findElementByName(String namespaceName, String name)
findElementByName in interface XmlElementpublic boolean hasChild(Object child)
XmlElementhasChild in interface XmlElementchild - an Objectpublic boolean hasChildren()
XmlElementhasChildren in interface XmlElementpublic void insertChild(int pos,
Object childToInsert)
insertChild in interface XmlElementpublic XmlElement newElement(String name)
XmlElementnewElement in interface XmlElementpublic XmlElement newElement(String namespace, String name)
XmlElementnewElement in interface XmlElementnamespace - a Stringname - a Stringpublic XmlElement newElement(XmlNamespace namespace, String name)
XmlElementnewElement in interface XmlElementnamespace - a XmlNamespacename - a Stringpublic void replaceChild(Object newChild, Object oldChild)
XmlElementreplaceChild in interface XmlElementnewChild - an ObjectoldChild - an Objectpublic void removeAllChildren()
XmlElementremoveAllChildren in interface XmlElementpublic void removeChild(Object child)
XmlElementremoveChild in interface XmlElementchild - an Objectpublic void replaceChildrenWithText(String textContent)
XmlElementreplaceChildrenWithText in interface XmlElementCopyright © 2013. All Rights Reserved.