|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xmlpull.v1.builder.impl.XmlElementImpl
public class XmlElementImpl
This is implementation if XML Infoset Element Information Item.
| Field Summary |
|---|
| Fields inherited from interface org.xmlpull.v1.builder.XmlElement |
|---|
NO_NAMESPACE |
| Method Summary | |
|---|---|
XmlAttribute |
addAttribute(java.lang.String name,
java.lang.String value)
addAttribute |
XmlAttribute |
addAttribute(java.lang.String attributeType,
java.lang.String attributePrefix,
java.lang.String attributeNamespace,
java.lang.String attributeName,
java.lang.String attributeValue,
boolean specified)
Method addAttribute |
XmlAttribute |
addAttribute(java.lang.String attributeType,
XmlNamespace namespace,
java.lang.String name,
java.lang.String value)
Method addAttribute |
XmlAttribute |
addAttribute(java.lang.String attributeType,
XmlNamespace namespace,
java.lang.String name,
java.lang.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,
java.lang.String name,
java.lang.String value)
Method addAttribute |
void |
addChild(int index,
java.lang.Object child)
Method addChild |
void |
addChild(java.lang.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(java.lang.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() ! |
XmlElement |
addElement(XmlNamespace namespace,
java.lang.String name)
Method addElement |
XmlAttribute |
attribute(java.lang.String attributeName)
Find attribute that matches given name or namespace Returns null if not found. |
XmlAttribute |
attribute(XmlNamespace attributeNamespace,
java.lang.String attributeName)
Find attribute that matches given name or namespace Returns null if not found. |
java.util.Iterator |
attributes()
Return Iterator |
java.util.Iterator |
children()
Return Iterator |
java.lang.Object |
clone()
Method clone |
XmlNamespace |
declareNamespace(java.lang.String prefix,
java.lang.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,
java.lang.String name)
find first element with name and namespace (if namespace is null it is ignored in search) |
XmlElement |
element(XmlNamespace n,
java.lang.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,
java.lang.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(java.lang.String attributeNamespace,
java.lang.String attributeName)
Deprecated. |
XmlElement |
findElementByName(java.lang.String name)
|
XmlElement |
findElementByName(java.lang.String namespaceName,
java.lang.String name)
|
XmlElement |
findElementByName(java.lang.String namespaceName,
java.lang.String name,
XmlElement elementToStartLooking)
|
XmlElement |
findElementByName(java.lang.String name,
XmlElement elementToStartLooking)
|
java.lang.String |
getAttributeValue(java.lang.String attributeNamespaceName,
java.lang.String attributeName)
Method getAttributeValue |
java.lang.String |
getBaseUri()
XML Infoset [base URI] property |
java.lang.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 |
java.lang.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(java.lang.Object child)
Method hasChild |
boolean |
hasChildren()
Method hasChildren |
boolean |
hasNamespaceDeclarations()
Method hasNamespaceDeclarations |
void |
insertChild(int pos,
java.lang.Object childToInsert)
|
XmlNamespace |
lookupNamespaceByName(java.lang.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(java.lang.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. |
java.util.Iterator |
namespaces()
Return Iterator |
XmlElement |
newElement(java.lang.String name)
Create unattached element |
XmlElement |
newElement(java.lang.String namespace,
java.lang.String name)
Method newElement |
XmlElement |
newElement(XmlNamespace namespace,
java.lang.String name)
Method newElement |
XmlNamespace |
newNamespace(java.lang.String namespaceName)
Create new namespace with null prefix (namespace name must be not null). |
XmlNamespace |
newNamespace(java.lang.String prefix,
java.lang.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(java.lang.Object child)
Method removeChild |
void |
replaceChild(java.lang.Object newChild,
java.lang.Object oldChild)
Method replaceChild |
void |
replaceChildrenWithText(java.lang.String textContent)
Remove all children and then add this text as only child. |
XmlElement |
requiredElement(XmlNamespace n,
java.lang.String name)
call element(n, name) and if null was returnedthrow XmlBuilderException |
Iterable |
requiredElementContent()
Return Iterator |
java.lang.String |
requiredTextContent()
return children content as text - if there are any no text children throw exception |
void |
setBaseUri(java.lang.String baseUri)
XML Infoset [base URI] property |
void |
setName(java.lang.String name)
XML Infoset [local name] property. |
void |
setNamespace(XmlNamespace namespace)
Set namespace ot use for theis element. |
void |
setParent(XmlContainer parent)
Method setParent |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
XmlElement
clone in interface XmlElementclone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic XmlContainer getRoot()
XmlElement
getRoot in interface XmlElementpublic XmlContainer getParent()
XmlElement
getParent in interface XmlContainedgetParent in interface XmlElementpublic void setParent(XmlContainer parent)
XmlElement
setParent in interface XmlContainedsetParent in interface XmlElementparent - a XmlContainerpublic XmlNamespace getNamespace()
XmlElement
getNamespace in interface XmlElementpublic java.lang.String getNamespaceName()
XmlElement
getNamespaceName in interface XmlElementpublic void setNamespace(XmlNamespace namespace)
XmlElement
setNamespace in interface XmlElementpublic java.lang.String getName()
XmlElement
getName in interface XmlElementpublic void setName(java.lang.String name)
XmlElement
setName in interface XmlElementname - a Stringpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getBaseUri()
XmlElement
getBaseUri in interface XmlElementpublic void setBaseUri(java.lang.String baseUri)
XmlElement
setBaseUri in interface XmlElementbaseUri - a Stringpublic java.util.Iterator attributes()
XmlElement
attributes in interface XmlElementpublic XmlAttribute addAttribute(XmlAttribute attributeValueToAdd)
XmlElement
addAttribute in interface XmlElementattributeValueToAdd - a XmlAttribute
public XmlAttribute addAttribute(XmlNamespace namespace,
java.lang.String name,
java.lang.String value)
XmlElement
addAttribute in interface XmlElementnamespace - a XmlNamespacename - a Stringvalue - a String
public XmlAttribute addAttribute(java.lang.String name,
java.lang.String value)
XmlElement
addAttribute in interface XmlElementname - a Stringvalue - a String
public XmlAttribute addAttribute(java.lang.String attributeType,
XmlNamespace namespace,
java.lang.String name,
java.lang.String value)
XmlElement
addAttribute in interface XmlElementattributeType - a Stringnamespace - a XmlNamespacename - a Stringvalue - a String
public XmlAttribute addAttribute(java.lang.String attributeType,
XmlNamespace namespace,
java.lang.String name,
java.lang.String value,
boolean specified)
XmlElement
addAttribute in interface XmlElementattributeType - a Stringnamespace - a XmlNamespacename - a Stringvalue - a Stringspecified - a boolean
public XmlAttribute addAttribute(java.lang.String attributeType,
java.lang.String attributePrefix,
java.lang.String attributeNamespace,
java.lang.String attributeName,
java.lang.String attributeValue,
boolean specified)
XmlElement
addAttribute in interface XmlElementattributeType - a StringattributePrefix - a StringattributeNamespace - a StringattributeName - a StringattributeValue - a Stringspecified - a boolean
public void ensureAttributeCapacity(int minCapacity)
XmlElement
ensureAttributeCapacity in interface XmlElementminCapacity - an int
public java.lang.String getAttributeValue(java.lang.String attributeNamespaceName,
java.lang.String attributeName)
XmlElement
getAttributeValue in interface XmlElementattributeName - a String
public boolean hasAttributes()
XmlElement
hasAttributes in interface XmlElementpublic XmlAttribute attribute(java.lang.String attributeName)
XmlElement
attribute in interface XmlElement
public XmlAttribute attribute(XmlNamespace attributeNamespace,
java.lang.String attributeName)
XmlElement
attribute in interface XmlElement
public XmlAttribute findAttribute(java.lang.String attributeNamespace,
java.lang.String attributeName)
XmlElement
findAttribute in interface XmlElementpublic void removeAllAttributes()
XmlElement
removeAllAttributes in interface XmlElementpublic void removeAttribute(XmlAttribute attr)
XmlElement
removeAttribute in interface XmlElementattr - a XmlAttribute
public XmlNamespace declareNamespace(java.lang.String prefix,
java.lang.String namespaceName)
XmlElement
declareNamespace in interface XmlElementpublic XmlNamespace declareNamespace(XmlNamespace n)
XmlElement
declareNamespace in interface XmlElementpublic boolean hasNamespaceDeclarations()
XmlElement
hasNamespaceDeclarations in interface XmlElementpublic XmlNamespace lookupNamespaceByPrefix(java.lang.String namespacePrefix)
XmlElement
lookupNamespaceByPrefix in interface XmlElementpublic XmlNamespace lookupNamespaceByName(java.lang.String namespaceName)
XmlElement
lookupNamespaceByName in interface XmlElementpublic java.util.Iterator namespaces()
XmlElement
namespaces in interface XmlElementpublic XmlNamespace newNamespace(java.lang.String namespaceName)
XmlElement
newNamespace in interface XmlElement
public XmlNamespace newNamespace(java.lang.String prefix,
java.lang.String namespaceName)
XmlElement
newNamespace in interface XmlElementpublic void ensureNamespaceDeclarationsCapacity(int minCapacity)
XmlElement
ensureNamespaceDeclarationsCapacity in interface XmlElementminCapacity - an intpublic void removeAllNamespaceDeclarations()
XmlElement
removeAllNamespaceDeclarations in interface XmlElementpublic void addChild(java.lang.Object child)
XmlElement
addChild in interface XmlElement
public void addChild(int index,
java.lang.Object child)
XmlElement
addChild in interface XmlElementindex - an int (starting from 0)child - an Objectpublic XmlElement addElement(XmlElement element)
XmlElement
addElement in interface XmlElement
public XmlElement addElement(int pos,
XmlElement element)
XmlElement
addElement in interface XmlElementpos - an int (starting from 0)element - a XmlElement
public XmlElement addElement(XmlNamespace namespace,
java.lang.String name)
XmlElement
addElement in interface XmlElementnamespace - a XmlNamespacename - a String
public XmlElement addElement(java.lang.String name)
XmlElement
addElement in interface XmlElementname - a String
public java.util.Iterator children()
XmlElementpublic Iterable requiredElementContent()
XmlElement
requiredElementContent in interface XmlElementpublic java.lang.String requiredTextContent()
XmlElement
requiredTextContent in interface XmlElementpublic void ensureChildrenCapacity(int minCapacity)
XmlElement
ensureChildrenCapacity in interface XmlElementminCapacity - an intpublic XmlElement element(int position)
XmlElement
element in interface XmlElement
public XmlElement requiredElement(XmlNamespace n,
java.lang.String name)
throws XmlBuilderException
XmlElement
requiredElement in interface XmlElementXmlBuilderException
public XmlElement element(XmlNamespace n,
java.lang.String name)
XmlElement
element in interface XmlElement
public XmlElement element(XmlNamespace n,
java.lang.String name,
boolean create)
XmlElement
element in interface XmlElement
public Iterable elements(XmlNamespace n,
java.lang.String name)
XmlElement
elements in interface XmlElementpublic XmlElement findElementByName(java.lang.String name)
findElementByName in interface XmlElement
public XmlElement findElementByName(java.lang.String namespaceName,
java.lang.String name,
XmlElement elementToStartLooking)
findElementByName in interface XmlElement
public XmlElement findElementByName(java.lang.String name,
XmlElement elementToStartLooking)
findElementByName in interface XmlElement
public XmlElement findElementByName(java.lang.String namespaceName,
java.lang.String name)
findElementByName in interface XmlElementpublic boolean hasChild(java.lang.Object child)
XmlElement
hasChild in interface XmlElementchild - an Object
public boolean hasChildren()
XmlElement
hasChildren in interface XmlElement
public void insertChild(int pos,
java.lang.Object childToInsert)
insertChild in interface XmlElementpublic XmlElement newElement(java.lang.String name)
XmlElement
newElement in interface XmlElement
public XmlElement newElement(java.lang.String namespace,
java.lang.String name)
XmlElement
newElement in interface XmlElementnamespace - a Stringname - a String
public XmlElement newElement(XmlNamespace namespace,
java.lang.String name)
XmlElement
newElement in interface XmlElementnamespace - a XmlNamespacename - a String
public void replaceChild(java.lang.Object newChild,
java.lang.Object oldChild)
XmlElement
replaceChild in interface XmlElementnewChild - an ObjectoldChild - an Objectpublic void removeAllChildren()
XmlElement
removeAllChildren in interface XmlElementpublic void removeChild(java.lang.Object child)
XmlElement
removeChild in interface XmlElementchild - an Objectpublic void replaceChildrenWithText(java.lang.String textContent)
XmlElement
replaceChildrenWithText in interface XmlElement
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||