org.jbind.xml.dom3.core
Class DomElement
java.lang.Object
org.jbind.xml.dom3.core.DomObject
org.jbind.xml.dom3.core.DomNode
org.jbind.xml.dom3.core.DomAttrOrElm
org.jbind.xml.dom3.core.DomElement
- All Implemented Interfaces:
- org.w3c.dom.Element, IDataImpl, IDomAttrOrElm, IDomElement, IDomNode, IDomObject, IDomParent, IElementImpl, IHasLocation, IImpl, IImplChild, IImplContainer, IImplWithText, org.w3c.dom.Node
- public class DomElement
- extends DomAttrOrElm
- implements IDomElement
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
|
Method Summary |
void |
accept(IDataImplVisitor aVisitor)
|
IAttributeImpl |
addAttribute(java.lang.String aNamespace,
java.lang.String aQName,
ITextContentProvider aProvider,
boolean anIsDefault,
ILocation aLocation)
|
IAttributeImpl |
addAttribute(java.lang.String aNamespace,
java.lang.String aQName,
java.lang.String aValue,
boolean anIsDefault,
ILocation aLocation)
Adds an attribute. |
org.w3c.dom.Node |
cloneNode(boolean aDeep)
|
protected void |
doAfterAccept(IDomVisitor aDomVisitor)
|
protected void |
doBeforeAccept(IDomVisitor aDomVisitor)
|
protected IDomNodeList |
doCloneChildNodes(IDomNodeList aDomNodeList,
boolean aDeep)
Hook method for cloning the child nodes. |
java.lang.String |
getAttribute(java.lang.String aName)
|
IAnyTypeData |
getAttributeData(java.lang.String aNamespace,
java.lang.String aName)
Gets the data object of an attribute. |
IAttributeImpl |
getAttributeImpl(java.lang.String aNamespace,
java.lang.String aLocalName)
Gets an attribute implementation. |
org.w3c.dom.Attr |
getAttributeNode(java.lang.String aName)
|
org.w3c.dom.Attr |
getAttributeNodeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
|
java.lang.String |
getAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
|
org.w3c.dom.NamedNodeMap |
getAttributes()
|
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String aName)
|
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
|
short |
getNodeType()
|
java.lang.String |
getNodeValue()
|
java.lang.String |
getTagName()
|
boolean |
hasAttribute(java.lang.String aName)
|
boolean |
hasAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
|
boolean |
hasAttributes()
|
boolean |
hasTextContent()
Checks if the implementation has textual content. |
boolean |
isNil()
Indicates if the data implementation was assigned "nil". |
java.util.Iterator |
iterAttributeImpls()
Iterates the attribute implementations. |
java.util.Iterator |
iterAttributes(java.lang.String aNamespace,
java.lang.String aName)
Iterates the attribute data objects for the specified namespace and name. |
java.util.ListIterator |
iterElementData(java.lang.String aNamespace,
java.lang.String aLocalName)
Iterates the data objects for the specified namespace and element name. |
void |
removeAttribute(java.lang.String aName)
|
void |
removeAttribute(java.lang.String aNamespace,
java.lang.String aName)
|
org.w3c.dom.Attr |
removeAttributeNode(org.w3c.dom.Attr oldAttr)
|
void |
removeAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
|
void |
setAttribute(java.lang.String aName,
java.lang.String aValue)
|
org.w3c.dom.Attr |
setAttributeNode(org.w3c.dom.Attr newAttr)
|
org.w3c.dom.Attr |
setAttributeNodeNS(org.w3c.dom.Attr newAttr)
|
void |
setAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aQName,
java.lang.String aValue)
|
void |
setDefaultAttrCreator(IDefaultAttrCreator aCreator)
|
void |
setDefaultTextContent(java.lang.String aString)
|
void |
setNodeValue(java.lang.String aString)
|
| Methods inherited from class org.jbind.xml.dom3.core.DomAttrOrElm |
getData, getLocalName, getNamespace, getNamespaceURI, getNodeName, getPartName, getPrefix, getTextContent, isDefault, setData, setPrefix |
| Methods inherited from class org.jbind.xml.dom3.core.DomNode |
accept, addElement, addElement, addText, appendChild, collectTextContent, collectTextContent, compareTreePosition, getAncestor, getBaseURI, getChild, getChildByClass, getChildNodes, getFirstChild, getInterface, getLastChild, getLocation, getNamespaceForPrefix, getNbChildren, getNextSibling, getNonDefaultedNbChildren, getParentImpl, getParentNode, getPrefixForNamespace, getPrefixToNamespaceMapping, getPreviousSibling, getUserData, hasChildNodes, insertAfter, insertBefore, isEqualNode, isSameNode, isSupported, iterChildren, lookupNamespacePrefix, lookupNamespaceURI, normalize, removeChild, replaceChild, restoreTextContent, saveTextContent, setChildNodes, setLocation, setPrefixToNamespaceMapping, setTextContent, setTextContent, visitChildren |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
appendChild, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setPrefix |
DomElement
public DomElement(IDomDocument aDomDocument,
java.lang.String aNamespaceUri,
java.lang.String aQName)
DomElement
public DomElement(IDomDocument aDomDocument,
java.lang.String aName)
DomElement
protected DomElement(IDomElement aDomElement,
boolean aDeep)
cloneNode
public org.w3c.dom.Node cloneNode(boolean aDeep)
- Specified by:
cloneNode in interface org.w3c.dom.Node
doCloneChildNodes
protected IDomNodeList doCloneChildNodes(IDomNodeList aDomNodeList,
boolean aDeep)
- Description copied from class:
DomNode
- Hook method for cloning the child nodes.
- Specified by:
doCloneChildNodes in class DomNode
getAttribute
public java.lang.String getAttribute(java.lang.String aName)
- Specified by:
getAttribute in interface org.w3c.dom.Element
getAttributeNS
public java.lang.String getAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
- Specified by:
getAttributeNS in interface org.w3c.dom.Element
getAttributeNode
public org.w3c.dom.Attr getAttributeNode(java.lang.String aName)
- Specified by:
getAttributeNode in interface org.w3c.dom.Element
getAttributeNodeNS
public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
- Specified by:
getAttributeNodeNS in interface org.w3c.dom.Element
getAttributes
public org.w3c.dom.NamedNodeMap getAttributes()
- Specified by:
getAttributes in interface org.w3c.dom.Node
getNodeType
public short getNodeType()
- Specified by:
getNodeType in interface org.w3c.dom.Node
getTagName
public java.lang.String getTagName()
- Specified by:
getTagName in interface org.w3c.dom.Element
hasAttribute
public boolean hasAttribute(java.lang.String aName)
- Specified by:
hasAttribute in interface org.w3c.dom.Element
hasAttributeNS
public boolean hasAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
- Specified by:
hasAttributeNS in interface org.w3c.dom.Element
hasAttributes
public boolean hasAttributes()
- Specified by:
hasAttributes in interface org.w3c.dom.Node
removeAttribute
public void removeAttribute(java.lang.String aName)
throws DomException
- Specified by:
removeAttribute in interface org.w3c.dom.Element
- Throws:
DomException
removeAttributeNS
public void removeAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
throws DomException
- Specified by:
removeAttributeNS in interface org.w3c.dom.Element
- Throws:
DomException
removeAttributeNode
public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
throws DomException
- Specified by:
removeAttributeNode in interface org.w3c.dom.Element
- Throws:
DomException
setAttribute
public void setAttribute(java.lang.String aName,
java.lang.String aValue)
throws DomException
- Specified by:
setAttribute in interface org.w3c.dom.Element
- Throws:
DomException
setAttributeNS
public void setAttributeNS(java.lang.String aNamespaceUri,
java.lang.String aQName,
java.lang.String aValue)
throws DomException
- Specified by:
setAttributeNS in interface org.w3c.dom.Element
- Throws:
DomException
setAttributeNode
public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr)
throws DomException
- Specified by:
setAttributeNode in interface org.w3c.dom.Element
- Throws:
DomException
setAttributeNodeNS
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
throws DomException
- Specified by:
setAttributeNodeNS in interface org.w3c.dom.Element
- Throws:
DomException
getNodeValue
public java.lang.String getNodeValue()
throws DomException
- Specified by:
getNodeValue in interface org.w3c.dom.Node
- Throws:
DomException
setNodeValue
public void setNodeValue(java.lang.String aString)
throws DomException
- Specified by:
setNodeValue in interface org.w3c.dom.Node
- Throws:
DomException
getElementsByTagName
public org.w3c.dom.NodeList getElementsByTagName(java.lang.String aName)
- Specified by:
getElementsByTagName in interface org.w3c.dom.Element
getElementsByTagNameNS
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String aNamespaceUri,
java.lang.String aLocalName)
- Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Element
doBeforeAccept
protected void doBeforeAccept(IDomVisitor aDomVisitor)
- Specified by:
doBeforeAccept in class DomNode
doAfterAccept
protected void doAfterAccept(IDomVisitor aDomVisitor)
- Specified by:
doAfterAccept in class DomNode
isNil
public boolean isNil()
- Description copied from interface:
IImpl
- Indicates if the data implementation was assigned "nil".
- Specified by:
isNil in interface IImpl
- Returns:
- Returns
true iff the data implementation was assigned
"nil".
getAttributeData
public IAnyTypeData getAttributeData(java.lang.String aNamespace,
java.lang.String aName)
- Description copied from interface:
IImpl
- Gets the data object of an attribute.
- Specified by:
getAttributeData in interface IImpl
- Parameters:
aNamespace - (required).aName - (required).
- Returns:
- (optional).
iterAttributes
public java.util.Iterator iterAttributes(java.lang.String aNamespace,
java.lang.String aName)
- Description copied from interface:
IDataImpl
- Iterates the attribute data objects for the specified namespace and name.
- Specified by:
iterAttributes in interface IDataImpl
- Parameters:
aNamespace - (optional).aName - (optional).
- Returns:
- (required). An iterator of
IAnyTypeData.
getAttributeImpl
public IAttributeImpl getAttributeImpl(java.lang.String aNamespace,
java.lang.String aLocalName)
- Description copied from interface:
IElementImpl
- Gets an attribute implementation.
- Specified by:
getAttributeImpl in interface IElementImpl
- Parameters:
aNamespace - (required).aLocalName - (required).
- Returns:
- (optional).
iterAttributeImpls
public java.util.Iterator iterAttributeImpls()
- Description copied from interface:
IElementImpl
- Iterates the attribute implementations.
- Specified by:
iterAttributeImpls in interface IElementImpl
- Returns:
- (required). An iterator of
IAttributeImpl.
addAttribute
public IAttributeImpl addAttribute(java.lang.String aNamespace,
java.lang.String aQName,
java.lang.String aValue,
boolean anIsDefault,
ILocation aLocation)
- Description copied from interface:
IElementImpl
- Adds an attribute.
- Specified by:
addAttribute in interface IElementImpl
- Parameters:
aNamespace - (required).aQName - (required).aValue - (required).aLocation - (optional).
- Returns:
- (required).
addAttribute
public IAttributeImpl addAttribute(java.lang.String aNamespace,
java.lang.String aQName,
ITextContentProvider aProvider,
boolean anIsDefault,
ILocation aLocation)
- Specified by:
addAttribute in interface IElementImpl
iterElementData
public java.util.ListIterator iterElementData(java.lang.String aNamespace,
java.lang.String aLocalName)
- Description copied from interface:
IImpl
- Iterates the data objects for the specified namespace and element name.
- Specified by:
iterElementData in interface IImpl
- Parameters:
aNamespace - (required).aLocalName - (required).
- Returns:
- (required). An iterator of
IAnyTypeData.
setDefaultAttrCreator
public void setDefaultAttrCreator(IDefaultAttrCreator aCreator)
- Specified by:
setDefaultAttrCreator in interface IElementImpl
setDefaultTextContent
public void setDefaultTextContent(java.lang.String aString)
- Specified by:
setDefaultTextContent in interface IElementImpl
hasTextContent
public boolean hasTextContent()
- Description copied from interface:
IImplWithText
- Checks if the implementation has textual content. This method is used
to decide if a default value should be used or not.
Attribute implementations will always return true because
attributes take their default values only if they are not present in the
instance.
Element implementation will return true iff their text content
is null or equal to the empty string. In other words the default
value of an element is used when the element is empty.
(cf. the note at W3C XML-Schema-Structure specification section 3.1.1).
- Specified by:
hasTextContent in interface IImplWithText
- Returns:
- Returns
true iff there is textual content.
removeAttribute
public void removeAttribute(java.lang.String aNamespace,
java.lang.String aName)
throws XmlException
- Specified by:
removeAttribute in interface IElementImpl
- Throws:
XmlException
accept
public void accept(IDataImplVisitor aVisitor)
throws XmlException
- Specified by:
accept in interface IImpl
- Throws:
XmlException