クラス XmlElementImpl
- java.lang.Object
-
- org.xmlpull.v1.builder.impl.XmlElementImpl
-
- すべての実装されたインタフェース:
Cloneable,XmlContained,XmlContainer,XmlElement
public class XmlElementImpl extends Object implements XmlElement
This is implementation if XML Infoset Element Information Item.- バージョン:
- $Revision: 1.41 $
- 作成者:
- Aleksander Slominski
-
-
フィールドの概要
-
インタフェースから継承されたフィールド org.xmlpull.v1.builder.XmlElement
NO_NAMESPACE
-
-
メソッドの概要
すべてのメソッド インスタンス・メソッド concreteメソッド 推奨されていないメソッド 修飾子とタイプ メソッド 説明 XmlAttributeaddAttribute(String name, String value)addAttributeXmlAttributeaddAttribute(String attributeType, String attributePrefix, String attributeNamespace, String attributeName, String attributeValue, boolean specified)Method addAttributeXmlAttributeaddAttribute(String attributeType, XmlNamespace namespace, String name, String value)Method addAttributeXmlAttributeaddAttribute(String attributeType, XmlNamespace namespace, String name, String value, boolean specified)Method addAttributeXmlAttributeaddAttribute(XmlAttribute attributeValueToAdd)Add attribute (adds it to the XML Infoset [namespace attributes] set) Attribute mistXmlAttributeaddAttribute(XmlNamespace namespace, String name, String value)Method addAttributevoidaddChild(int index, Object child)Method addChildvoidaddChild(Object child)NOTE: =child added is _not_ checked if it XmlContainer, caller must manually fix parent in child by calling setParent() !!!!XmlElementaddElement(int pos, XmlElement element)Method addElementXmlElementaddElement(String name)Method addElementXmlElementaddElement(XmlElement element)NOTE: the child element must unattached to be added (it is atttached if it is XmlContainer of recognized type and getParent() !XmlElementaddElement(XmlNamespace namespace, String name)Method addElementXmlAttributeattribute(String attributeName)Find attribute that matches given name or namespace Returns null if not found.XmlAttributeattribute(XmlNamespace attributeNamespace, String attributeName)Find attribute that matches given name or namespace Returns null if not found.Iteratorattributes()Return Iterator- null is never returned if there is no children then iteraotr over empty collection is returned Iteratorchildren()Return IteratorObjectclone()Method cloneXmlNamespacedeclareNamespace(String prefix, String namespaceName)Create new namespace with prefix and namespace name (both must be not null) and add it to current element.XmlNamespacedeclareNamespace(XmlNamespace n)Add namespace to current element (both prefix and namespace name must be not null)XmlElementelement(int position)return element at poition (0..count-1) or IndexOutOfBoundsException if positon incorrectXmlElementelement(XmlNamespace n, String name)find first element with name and namespace (if namespace is null it is ignored in search)XmlElementelement(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 returnedIterableelements(XmlNamespace n, String name)Return all elements that has namespace and name (null is never returned but empty iteraotr)voidensureAttributeCapacity(int minCapacity)Method ensureAttributeCapacityvoidensureChildrenCapacity(int minCapacity)Method ensureChildrenCapacityvoidensureNamespaceDeclarationsCapacity(int minCapacity)Method ensureNamespaceDeclarationsCapacityXmlAttributefindAttribute(String attributeNamespace, String attributeName)推奨されていません。XmlElementfindElementByName(String name)XmlElementfindElementByName(String namespaceName, String name)XmlElementfindElementByName(String namespaceName, String name, XmlElement elementToStartLooking)XmlElementfindElementByName(String name, XmlElement elementToStartLooking)StringgetAttributeValue(String attributeNamespaceName, String attributeName)Method getAttributeValueStringgetBaseUri()XML Infoset [base URI] propertyStringgetName()XML Infoset [local name] property.XmlNamespacegetNamespace()Return namespace of current element (XML Infoset [namespace name] and [prefix] properties combined) null is only returned if element was created without namespaceStringgetNamespaceName()Return namespace name (XML Infoset [namespace name]property or null if element has no namespaceXmlContainergetParent()XML Infoset [parent] property.XmlContainergetRoot()Get top most container that is either XmlDocument or XmlElement (may be event this element!!!)booleanhasAttributes()Method hasAttributesbooleanhasChild(Object child)Method hasChildbooleanhasChildren()Method hasChildrenbooleanhasNamespaceDeclarations()Method hasNamespaceDeclarationsvoidinsertChild(int pos, Object childToInsert)XmlNamespacelookupNamespaceByName(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).XmlNamespacelookupNamespaceByPrefix(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.Iteratornamespaces()Return Iterator- null is never returned if there is no children then iteraotr over empty collection is returned XmlElementnewElement(String name)Create unattached elementXmlElementnewElement(String namespace, String name)Method newElementXmlElementnewElement(XmlNamespace namespace, String name)Method newElementXmlNamespacenewNamespace(String namespaceName)Create new namespace with null prefix (namespace name must be not null).XmlNamespacenewNamespace(String prefix, String namespaceName)Create new namespace with prefix and namespace name (both must be not null).voidremoveAllAttributes()Method removeAllAttributesvoidremoveAllChildren()Removes all children - every child that was implementing XmlNode will have set parent to null.voidremoveAllNamespaceDeclarations()Method removeAllNamespaceDeclarationsvoidremoveAttribute(XmlAttribute attr)Method removeAttributevoidremoveChild(Object child)Method removeChildvoidreplaceChild(Object newChild, Object oldChild)Method replaceChildvoidreplaceChildrenWithText(String textContent)Remove all children and then add this text as only child.XmlElementrequiredElement(XmlNamespace n, String name)call element(n, name) and if null was returnedthrow XmlBuilderExceptionIterablerequiredElementContent()Return Iterator- that represents all XmlElement content. StringrequiredTextContent()return children content as text - if there are any no text children throw exceptionvoidsetBaseUri(String baseUri)XML Infoset [base URI] propertyvoidsetName(String name)XML Infoset [local name] property.voidsetNamespace(XmlNamespace namespace)Set namespace ot use for theis element.voidsetParent(XmlContainer parent)Method setParentStringtoString()
-
-
-
メソッドの詳細
-
clone
public Object clone() throws CloneNotSupportedException
インタフェースからコピーされた説明:XmlElementMethod clone- 定義:
cloneインタフェース内XmlElement- オーバーライド:
cloneクラス内Object- 戻り値:
- an Object
- 例外:
CloneNotSupportedException
-
getRoot
public XmlContainer getRoot()
インタフェースからコピーされた説明:XmlElementGet top most container that is either XmlDocument or XmlElement (may be event this element!!!)- 定義:
getRootインタフェース内XmlElement
-
getParent
public XmlContainer getParent()
インタフェースからコピーされた説明:XmlElementXML Infoset [parent] property. If current element is not child of containing parent XmlElement or XmlDocument then builder exception will be thrown- 定義:
getParentインタフェース内XmlContained- 定義:
getParentインタフェース内XmlElement
-
setParent
public void setParent(XmlContainer parent)
インタフェースからコピーされた説明:XmlElementMethod setParent- 定義:
setParentインタフェース内XmlContained- 定義:
setParentインタフェース内XmlElement- パラメータ:
parent- a XmlContainer
-
getNamespace
public XmlNamespace getNamespace()
インタフェースからコピーされた説明:XmlElementReturn namespace of current element (XML Infoset [namespace name] and [prefix] properties combined) null is only returned if element was created without namespace- 定義:
getNamespaceインタフェース内XmlElement
-
getNamespaceName
public String getNamespaceName()
インタフェースからコピーされた説明:XmlElementReturn namespace name (XML Infoset [namespace name]property or null if element has no namespace- 定義:
getNamespaceNameインタフェース内XmlElement
-
setNamespace
public void setNamespace(XmlNamespace namespace)
インタフェースからコピーされた説明:XmlElementSet namespace ot use for theis element. Note: namespace prefix is always ignored.- 定義:
setNamespaceインタフェース内XmlElement
-
getName
public String getName()
インタフェースからコピーされた説明:XmlElementXML Infoset [local name] property.- 定義:
getNameインタフェース内XmlElement- 戻り値:
- a String
-
setName
public void setName(String name)
インタフェースからコピーされた説明:XmlElementXML Infoset [local name] property.- 定義:
setNameインタフェース内XmlElement- パラメータ:
name- a String
-
getBaseUri
public String getBaseUri()
インタフェースからコピーされた説明:XmlElementXML Infoset [base URI] property- 定義:
getBaseUriインタフェース内XmlElement- 戻り値:
- a String
-
setBaseUri
public void setBaseUri(String baseUri)
インタフェースからコピーされた説明:XmlElementXML Infoset [base URI] property- 定義:
setBaseUriインタフェース内XmlElement- パラメータ:
baseUri- a String
-
attributes
public Iterator attributes()
インタフェースからコピーされた説明:XmlElementReturn Iterator- null is never returned if there is no children then iteraotr over empty collection is returned - 定義:
attributesインタフェース内XmlElement
-
addAttribute
public XmlAttribute addAttribute(XmlAttribute attributeValueToAdd)
インタフェースからコピーされた説明:XmlElementAdd attribute (adds it to the XML Infoset [namespace attributes] set) Attribute mist- 定義:
addAttributeインタフェース内XmlElement- パラメータ:
attributeValueToAdd- a XmlAttribute- 戻り値:
- a XmlAttribute
-
addAttribute
public XmlAttribute addAttribute(XmlNamespace namespace, String name, String value)
インタフェースからコピーされた説明:XmlElementMethod addAttribute- 定義:
addAttributeインタフェース内XmlElement- パラメータ:
namespace- a XmlNamespacename- a Stringvalue- a String- 戻り値:
- a XmlAttribute
-
addAttribute
public XmlAttribute addAttribute(String name, String value)
インタフェースからコピーされた説明:XmlElementaddAttribute- 定義:
addAttributeインタフェース内XmlElement- パラメータ:
name- a Stringvalue- a String- 戻り値:
- a XmlAttribute
-
addAttribute
public XmlAttribute addAttribute(String attributeType, XmlNamespace namespace, String name, String value)
インタフェースからコピーされた説明:XmlElementMethod addAttribute- 定義:
addAttributeインタフェース内XmlElement- パラメータ:
attributeType- a Stringnamespace- a XmlNamespacename- a Stringvalue- a String- 戻り値:
- a XmlAttribute
-
addAttribute
public XmlAttribute addAttribute(String attributeType, XmlNamespace namespace, String name, String value, boolean specified)
インタフェースからコピーされた説明:XmlElementMethod addAttribute- 定義:
addAttributeインタフェース内XmlElement- パラメータ:
attributeType- a Stringnamespace- a XmlNamespacename- a Stringvalue- a Stringspecified- a boolean- 戻り値:
- a XmlAttribute
-
addAttribute
public XmlAttribute addAttribute(String attributeType, String attributePrefix, String attributeNamespace, String attributeName, String attributeValue, boolean specified)
インタフェースからコピーされた説明:XmlElementMethod addAttribute- 定義:
addAttributeインタフェース内XmlElement- パラメータ:
attributeType- a StringattributePrefix- a StringattributeNamespace- a StringattributeName- a StringattributeValue- a Stringspecified- a boolean- 戻り値:
- a XmlAttribute
-
ensureAttributeCapacity
public void ensureAttributeCapacity(int minCapacity)
インタフェースからコピーされた説明:XmlElementMethod ensureAttributeCapacity- 定義:
ensureAttributeCapacityインタフェース内XmlElement- パラメータ:
minCapacity- an int
-
getAttributeValue
public String getAttributeValue(String attributeNamespaceName, String attributeName)
インタフェースからコピーされた説明:XmlElementMethod getAttributeValue- 定義:
getAttributeValueインタフェース内XmlElementattributeName- a String- 戻り値:
- a String
-
hasAttributes
public boolean hasAttributes()
インタフェースからコピーされた説明:XmlElementMethod hasAttributes- 定義:
hasAttributesインタフェース内XmlElement- 戻り値:
- a boolean
-
attribute
public XmlAttribute attribute(String attributeName)
インタフェースからコピーされた説明:XmlElementFind attribute that matches given name or namespace Returns null if not found. Will match only attribute that have no namesapce.- 定義:
attributeインタフェース内XmlElement
-
attribute
public XmlAttribute attribute(XmlNamespace attributeNamespace, String attributeName)
インタフェースからコピーされた説明:XmlElementFind attribute that matches given name or namespace Returns null if not found. NOTE: if namespace is null in this case it will match only attributes that have no namespace.- 定義:
attributeインタフェース内XmlElement
-
findAttribute
public XmlAttribute findAttribute(String attributeNamespace, String attributeName)
推奨されていません。インタフェースからコピーされた説明:XmlElementFind attribute that matches given name or namespace Returns null if not found. NOTE: if namespace is null in this case it will match only attributes that has no namespace.- 定義:
findAttributeインタフェース内XmlElement
-
removeAllAttributes
public void removeAllAttributes()
インタフェースからコピーされた説明:XmlElementMethod removeAllAttributes- 定義:
removeAllAttributesインタフェース内XmlElement
-
removeAttribute
public void removeAttribute(XmlAttribute attr)
インタフェースからコピーされた説明:XmlElementMethod removeAttribute- 定義:
removeAttributeインタフェース内XmlElement- パラメータ:
attr- a XmlAttribute
-
declareNamespace
public XmlNamespace declareNamespace(String prefix, String namespaceName)
インタフェースからコピーされた説明:XmlElementCreate new namespace with prefix and namespace name (both must be not null) and add it to current element.- 定義:
declareNamespaceインタフェース内XmlElement
-
declareNamespace
public XmlNamespace declareNamespace(XmlNamespace n)
インタフェースからコピーされた説明:XmlElementAdd namespace to current element (both prefix and namespace name must be not null)- 定義:
declareNamespaceインタフェース内XmlElement
-
hasNamespaceDeclarations
public boolean hasNamespaceDeclarations()
インタフェースからコピーされた説明:XmlElementMethod hasNamespaceDeclarations- 定義:
hasNamespaceDeclarationsインタフェース内XmlElement- 戻り値:
- a boolean
-
lookupNamespaceByPrefix
public XmlNamespace lookupNamespaceByPrefix(String namespacePrefix)
インタフェースからコピーされた説明:XmlElementFind 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.- 定義:
lookupNamespaceByPrefixインタフェース内XmlElement
-
lookupNamespaceByName
public XmlNamespace lookupNamespaceByName(String namespaceName)
インタフェースからコピーされた説明:XmlElementFind 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). and so on.- 定義:
lookupNamespaceByNameインタフェース内XmlElement
-
namespaces
public Iterator namespaces()
インタフェースからコピーされた説明:XmlElementReturn Iterator- null is never returned if there is no children then iteraotr over empty collection is returned - 定義:
namespacesインタフェース内XmlElement
-
newNamespace
public XmlNamespace newNamespace(String namespaceName)
インタフェースからコピーされた説明:XmlElementCreate new namespace with null prefix (namespace name must be not null).- 定義:
newNamespaceインタフェース内XmlElement
-
newNamespace
public XmlNamespace newNamespace(String prefix, String namespaceName)
インタフェースからコピーされた説明:XmlElementCreate new namespace with prefix and namespace name (both must be not null).- 定義:
newNamespaceインタフェース内XmlElement
-
ensureNamespaceDeclarationsCapacity
public void ensureNamespaceDeclarationsCapacity(int minCapacity)
インタフェースからコピーされた説明:XmlElementMethod ensureNamespaceDeclarationsCapacity- 定義:
ensureNamespaceDeclarationsCapacityインタフェース内XmlElement- パラメータ:
minCapacity- an int
-
removeAllNamespaceDeclarations
public void removeAllNamespaceDeclarations()
インタフェースからコピーされた説明:XmlElementMethod removeAllNamespaceDeclarations- 定義:
removeAllNamespaceDeclarationsインタフェース内XmlElement
-
addChild
public void addChild(Object child)
インタフェースからコピーされた説明:XmlElementNOTE: =child added is _not_ checked if it XmlContainer, caller must manually fix parent in child by calling setParent() !!!!- 定義:
addChildインタフェース内XmlElement
-
addChild
public void addChild(int index, Object child)インタフェースからコピーされた説明:XmlElementMethod addChild- 定義:
addChildインタフェース内XmlElement- パラメータ:
index- an int (starting from 0)child- an Object
-
addElement
public XmlElement addElement(XmlElement element)
インタフェースからコピーされた説明:XmlElementNOTE: the child element must unattached to be added (it is atttached if it is XmlContainer of recognized type and getParent() != null)- 定義:
addElementインタフェース内XmlElement
-
addElement
public XmlElement addElement(int pos, XmlElement element)
インタフェースからコピーされた説明:XmlElementMethod addElement- 定義:
addElementインタフェース内XmlElement- パラメータ:
pos- an int (starting from 0)element- a XmlElement- 戻り値:
- a XmlElement
-
addElement
public XmlElement addElement(XmlNamespace namespace, String name)
インタフェースからコピーされた説明:XmlElementMethod addElement- 定義:
addElementインタフェース内XmlElement- パラメータ:
namespace- a XmlNamespacename- a String- 戻り値:
- a XmlElement
-
addElement
public XmlElement addElement(String name)
インタフェースからコピーされた説明:XmlElementMethod addElement- 定義:
addElementインタフェース内XmlElement- パラメータ:
name- a String- 戻り値:
- a XmlElement
-
children
public Iterator children()
インタフェースからコピーされた説明:XmlElementReturn Iterator- 定義:
childrenインタフェース内XmlElement
-
requiredElementContent
public Iterable requiredElementContent()
インタフェースからコピーされた説明:XmlElementReturn Iterator- that represents all XmlElement content. When used exception will be thrown if non white space children are found (as expected no mixed content!). - 定義:
requiredElementContentインタフェース内XmlElement
-
requiredTextContent
public String requiredTextContent()
インタフェースからコピーされた説明:XmlElementreturn children content as text - if there are any no text children throw exception- 定義:
requiredTextContentインタフェース内XmlElement
-
ensureChildrenCapacity
public void ensureChildrenCapacity(int minCapacity)
インタフェースからコピーされた説明:XmlElementMethod ensureChildrenCapacity- 定義:
ensureChildrenCapacityインタフェース内XmlElement- パラメータ:
minCapacity- an int
-
element
public XmlElement element(int position)
インタフェースからコピーされた説明:XmlElementreturn element at poition (0..count-1) or IndexOutOfBoundsException if positon incorrect- 定義:
elementインタフェース内XmlElement
-
requiredElement
public XmlElement requiredElement(XmlNamespace n, String name) throws XmlBuilderException
インタフェースからコピーされた説明:XmlElementcall element(n, name) and if null was returnedthrow XmlBuilderException- 定義:
requiredElementインタフェース内XmlElement- 例外:
XmlBuilderException
-
element
public XmlElement element(XmlNamespace n, String name)
インタフェースからコピーされた説明:XmlElementfind first element with name and namespace (if namespace is null it is ignored in search)- 定義:
elementインタフェース内XmlElement
-
element
public XmlElement element(XmlNamespace n, String name, boolean create)
インタフェースからコピーされた説明:XmlElementfind 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- 定義:
elementインタフェース内XmlElement
-
elements
public Iterable elements(XmlNamespace n, String name)
インタフェースからコピーされた説明:XmlElementReturn all elements that has namespace and name (null is never returned but empty iteraotr)- 定義:
elementsインタフェース内XmlElement
-
findElementByName
public XmlElement findElementByName(String name)
- 定義:
findElementByNameインタフェース内XmlElement
-
findElementByName
public XmlElement findElementByName(String namespaceName, String name, XmlElement elementToStartLooking)
- 定義:
findElementByNameインタフェース内XmlElement
-
findElementByName
public XmlElement findElementByName(String name, XmlElement elementToStartLooking)
- 定義:
findElementByNameインタフェース内XmlElement
-
findElementByName
public XmlElement findElementByName(String namespaceName, String name)
- 定義:
findElementByNameインタフェース内XmlElement
-
hasChild
public boolean hasChild(Object child)
インタフェースからコピーされた説明:XmlElementMethod hasChild- 定義:
hasChildインタフェース内XmlElement- パラメータ:
child- an Object- 戻り値:
- a boolean
-
hasChildren
public boolean hasChildren()
インタフェースからコピーされた説明:XmlElementMethod hasChildren- 定義:
hasChildrenインタフェース内XmlElement- 戻り値:
- a boolean
-
insertChild
public void insertChild(int pos, Object childToInsert)- 定義:
insertChildインタフェース内XmlElement
-
newElement
public XmlElement newElement(String name)
インタフェースからコピーされた説明:XmlElementCreate unattached element- 定義:
newElementインタフェース内XmlElement
-
newElement
public XmlElement newElement(String namespace, String name)
インタフェースからコピーされた説明:XmlElementMethod newElement- 定義:
newElementインタフェース内XmlElement- パラメータ:
namespace- a Stringname- a String- 戻り値:
- a XmlElement
-
newElement
public XmlElement newElement(XmlNamespace namespace, String name)
インタフェースからコピーされた説明:XmlElementMethod newElement- 定義:
newElementインタフェース内XmlElement- パラメータ:
namespace- a XmlNamespacename- a String- 戻り値:
- a XmlElement
-
replaceChild
public void replaceChild(Object newChild, Object oldChild)
インタフェースからコピーされた説明:XmlElementMethod replaceChild- 定義:
replaceChildインタフェース内XmlElement- パラメータ:
newChild- an ObjectoldChild- an Object
-
removeAllChildren
public void removeAllChildren()
インタフェースからコピーされた説明:XmlElementRemoves all children - every child that was implementing XmlNode will have set parent to null.- 定義:
removeAllChildrenインタフェース内XmlElement
-
removeChild
public void removeChild(Object child)
インタフェースからコピーされた説明:XmlElementMethod removeChild- 定義:
removeChildインタフェース内XmlElement- パラメータ:
child- an Object
-
replaceChildrenWithText
public void replaceChildrenWithText(String textContent)
インタフェースからコピーされた説明:XmlElementRemove all children and then add this text as only child.- 定義:
replaceChildrenWithTextインタフェース内XmlElement
-
-