|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xmlpull.v1.builder.adapter.XmlElementAdapter
public class XmlElementAdapter
| Field Summary |
|---|
| Fields inherited from interface org.xmlpull.v1.builder.XmlElement |
|---|
NO_NAMESPACE |
| Constructor Summary | |
|---|---|
XmlElementAdapter(XmlElement target)
|
|
| 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 type,
XmlNamespace namespace,
java.lang.String name,
java.lang.String value)
Method addAttribute |
XmlAttribute |
addAttribute(java.lang.String type,
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 pos,
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 child)
Method addElement |
XmlElement |
addElement(java.lang.String name)
Method addElement |
XmlElement |
addElement(XmlElement child)
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 attributeNamespaceName,
java.lang.String attributeName)
Find attribute that matches given name or namespace Returns null if not found. |
java.util.Iterator |
attributes()
Return Iterator |
static XmlElementAdapter |
castOrWrap(XmlElement el,
java.lang.Class adapterClass)
|
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 namespace)
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 attributeNamespaceName,
java.lang.String attributeName)
Find attribute that matches given name or namespace Returns null if not found. |
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!!!) |
XmlElement |
getTarget()
|
XmlElementAdapter |
getTopAdapter()
|
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 namespaceName,
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 |
void |
setTopAdapter(XmlElementAdapter adapter)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XmlElementAdapter(XmlElement target)
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
XmlElement
clone in interface XmlElementclone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic XmlElement getTarget()
public XmlElementAdapter getTopAdapter()
public void setTopAdapter(XmlElementAdapter adapter)
public static XmlElementAdapter castOrWrap(XmlElement el,
java.lang.Class adapterClass)
public 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 XmlContainer
public XmlNamespace newNamespace(java.lang.String prefix,
java.lang.String namespaceName)
XmlElement
newNamespace in interface XmlElementpublic XmlAttribute attribute(java.lang.String attributeName)
XmlElement
attribute in interface XmlElement
public XmlAttribute attribute(XmlNamespace attributeNamespaceName,
java.lang.String attributeName)
XmlElement
attribute in interface XmlElement
public XmlAttribute findAttribute(java.lang.String attributeNamespaceName,
java.lang.String attributeName)
XmlElement
findAttribute in interface XmlElementpublic java.util.Iterator attributes()
XmlElement
attributes in interface XmlElementpublic void removeAllChildren()
XmlElement
removeAllChildren in interface XmlElement
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 java.lang.String getAttributeValue(java.lang.String attributeNamespaceName,
java.lang.String attributeName)
XmlElement
getAttributeValue in interface XmlElementattributeName - a String
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 java.lang.String getNamespaceName()
XmlElement
getNamespaceName in interface XmlElementpublic void ensureChildrenCapacity(int minCapacity)
XmlElement
ensureChildrenCapacity in interface XmlElementminCapacity - an intpublic java.util.Iterator namespaces()
XmlElement
namespaces in interface XmlElementpublic void removeAllAttributes()
XmlElement
removeAllAttributes in interface XmlElementpublic XmlNamespace getNamespace()
XmlElement
getNamespace in interface XmlElementpublic java.lang.String getBaseUri()
XmlElement
getBaseUri 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 void removeAllNamespaceDeclarations()
XmlElement
removeAllNamespaceDeclarations in interface XmlElementpublic boolean hasAttributes()
XmlElement
hasAttributes in interface XmlElement
public XmlAttribute addAttribute(java.lang.String type,
XmlNamespace namespace,
java.lang.String name,
java.lang.String value,
boolean specified)
XmlElement
addAttribute in interface XmlElementtype - a Stringnamespace - a XmlNamespacename - a Stringvalue - a Stringspecified - a boolean
public XmlNamespace declareNamespace(XmlNamespace namespace)
XmlElement
declareNamespace in interface XmlElement
public XmlAttribute addAttribute(java.lang.String name,
java.lang.String value)
XmlElement
addAttribute in interface XmlElementname - a Stringvalue - a String
public boolean hasNamespaceDeclarations()
XmlElement
hasNamespaceDeclarations in interface XmlElementpublic XmlNamespace lookupNamespaceByName(java.lang.String namespaceName)
XmlElement
lookupNamespaceByName in interface XmlElementpublic XmlNamespace lookupNamespaceByPrefix(java.lang.String namespacePrefix)
XmlElement
lookupNamespaceByPrefix in interface XmlElementpublic XmlNamespace newNamespace(java.lang.String namespaceName)
XmlElement
newNamespace in interface XmlElementpublic void setBaseUri(java.lang.String baseUri)
XmlElement
setBaseUri in interface XmlElementbaseUri - a Stringpublic void setNamespace(XmlNamespace namespace)
XmlElement
setNamespace in interface XmlElementpublic void ensureNamespaceDeclarationsCapacity(int minCapacity)
XmlElement
ensureNamespaceDeclarationsCapacity in interface XmlElementminCapacity - an intpublic java.lang.String getName()
XmlElement
getName in interface XmlElementpublic void setName(java.lang.String name)
XmlElement
setName in interface XmlElementname - a String
public XmlAttribute addAttribute(java.lang.String type,
XmlNamespace namespace,
java.lang.String name,
java.lang.String value)
XmlElement
addAttribute in interface XmlElementtype - a Stringnamespace - a XmlNamespacename - a Stringvalue - a String
public void ensureAttributeCapacity(int minCapacity)
XmlElement
ensureAttributeCapacity in interface XmlElementminCapacity - an intpublic XmlAttribute addAttribute(XmlAttribute attributeValueToAdd)
XmlElement
addAttribute in interface XmlElementattributeValueToAdd - a XmlAttribute
public XmlElement element(int position)
XmlElement
element in interface XmlElement
public XmlElement requiredElement(XmlNamespace n,
java.lang.String name)
XmlElement
requiredElement in interface XmlElement
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 XmlElement
public XmlElement findElementByName(java.lang.String name,
XmlElement elementToStartLooking)
findElementByName in interface XmlElement
public XmlElement newElement(XmlNamespace namespace,
java.lang.String name)
XmlElement
newElement in interface XmlElementnamespace - a XmlNamespacename - a String
public XmlElement addElement(XmlElement child)
XmlElement
addElement in interface XmlElement
public XmlElement addElement(int pos,
XmlElement child)
XmlElement
addElement in interface XmlElementpos - an int (starting from 0)child - a XmlElement
public XmlElement addElement(java.lang.String name)
XmlElement
addElement in interface XmlElementname - a String
public XmlElement findElementByName(java.lang.String namespaceName,
java.lang.String name)
findElementByName in interface XmlElementpublic void addChild(java.lang.Object child)
XmlElement
addChild in interface XmlElement
public void insertChild(int pos,
java.lang.Object childToInsert)
insertChild 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 XmlElementpublic void removeChild(java.lang.Object child)
XmlElement
removeChild in interface XmlElementchild - an Objectpublic java.util.Iterator children()
XmlElementpublic Iterable requiredElementContent()
XmlElement
requiredElementContent in interface XmlElementpublic java.lang.String requiredTextContent()
XmlElement
requiredTextContent in interface XmlElementpublic boolean hasChild(java.lang.Object child)
XmlElement
hasChild in interface XmlElementchild - an Object
public XmlElement newElement(java.lang.String namespaceName,
java.lang.String name)
XmlElement
newElement in interface XmlElementnamespaceName - a Stringname - a String
public XmlElement addElement(XmlNamespace namespace,
java.lang.String name)
XmlElement
addElement in interface XmlElementnamespace - a XmlNamespacename - a String
public boolean hasChildren()
XmlElement
hasChildren in interface XmlElement
public void addChild(int pos,
java.lang.Object child)
XmlElement
addChild in interface XmlElementpos - an int (starting from 0)child - an Object
public void replaceChild(java.lang.Object newChild,
java.lang.Object oldChild)
XmlElement
replaceChild in interface XmlElementnewChild - an ObjectoldChild - an Objectpublic XmlElement newElement(java.lang.String name)
XmlElement
newElement in interface XmlElementpublic 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 | ||||||||