Class BeanElement
java.lang.Object
org.dom4j.tree.AbstractNode
org.dom4j.tree.AbstractBranch
org.dom4j.tree.AbstractElement
org.dom4j.tree.DefaultElement
org.dom4j.bean.BeanElement
- All Implemented Interfaces:
Serializable, Cloneable, Branch, Element, Node
BeanElement uses a Java Bean to store its attributes.
- Version:
- $Revision: 1.15 $
- Author:
- James Strachan
- See Also:
-
Field Summary
Fields inherited from class AbstractElement
USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRINGFields inherited from class AbstractBranch
DEFAULT_CONTENT_LIST_SIZEFields inherited from class AbstractNode
NODE_TYPE_NAMESFields inherited from interface Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE -
Constructor Summary
ConstructorsConstructorDescriptionBeanElement(String name, Object bean) BeanElement(String name, Namespace namespace, Object bean) BeanElement(QName qname) BeanElement(QName qname, Object bean) -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(String name, String value) Adds the attribute value of the given local name.addAttribute(QName qName, String value) Adds the attribute value of the given fully qualified name.Returns the attribute with the given nameDOCUMENT ME!A Factory Method pattern which lazily creates a List implementation used to store contentcreateAttributeList(int size) A Factory Method pattern which creates a List implementation used to store attributesprotected BeanAttributeListgetData()DOCUMENT ME!protected DocumentFactoryvoidsetAttributes(List<Attribute> attributes) Sets the attributes that this element containsvoidsetAttributes(Attributes attributes, NamespaceStack namespaceStack, boolean noNamespaceAttributes) This method provides a more optimal way of setting all the attributes on an Element particularly for use inSAXReader.voidSets the data value of this element if this element supports data binding or callsNode.setText(String)if it doesn'tMethods inherited from class DefaultElement
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, clone, contentList, declaredNamespaces, element, element, element, getDocument, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setContent, setDocument, setParent, setQName, supportsParentMethods inherited from class AbstractElement
accept, add, add, add, add, add, add, add, add, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addNode, addNode, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, asXML, attributeValue, attributeValue, attributeValue, attributeValue, childAdded, childRemoved, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getName, getNamespace, getNamespacePrefix, getNamespacesForURI, getNamespaceURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributeValue, setAttributeValue, setName, setNamespace, setText, toString, writeMethods inherited from class AbstractBranch
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructionsMethods inherited from class AbstractNode
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOfMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Branch
addElement, addElement, appendContent, content, elementByID, setProcessingInstructionsMethods inherited from interface Element
getTextTrimMethods inherited from interface Node
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
-
Constructor Details
-
BeanElement
-
BeanElement
-
BeanElement
-
BeanElement
-
-
Method Details
-
getData
DOCUMENT ME!- Specified by:
getDatain interfaceElement- Overrides:
getDatain classAbstractElement- Returns:
- the JavaBean associated with this element
-
setData
Description copied from interface:ElementSets the data value of this element if this element supports data binding or callsNode.setText(String)if it doesn't- Specified by:
setDatain interfaceElement- Overrides:
setDatain classAbstractElement- Parameters:
data- DOCUMENT ME!
-
attribute
Description copied from interface:ElementReturns the attribute with the given name- Specified by:
attributein interfaceElement- Overrides:
attributein classDefaultElement- Parameters:
name- DOCUMENT ME!- Returns:
- the attribute for the given local name in any namespace. If there are more than one attributes with the given local name in different namespaces then the first one is returned.
-
attribute
Description copied from interface:ElementDOCUMENT ME!- Specified by:
attributein interfaceElement- Overrides:
attributein classDefaultElement- Parameters:
qname- is the fully qualified name- Returns:
- the attribute for the given fully qualified name or null if it could not be found.
-
addAttribute
Description copied from interface:ElementAdds the attribute value of the given local name. If an attribute already exists for the given name it will be replaced. Attributes with null values are silently ignored. If the value of the attribute is null then this method call will remove any attributes with the given name.- Specified by:
addAttributein interfaceElement- Overrides:
addAttributein classAbstractElement- Parameters:
name- is the name of the attribute whose value is to be added or updatedvalue- is the attribute's value- Returns:
- this
Elementinstance.
-
addAttribute
Description copied from interface:ElementAdds the attribute value of the given fully qualified name. If an attribute already exists for the given name it will be replaced. Attributes with null values are silently ignored. If the value of the attribute is null then this method call will remove any attributes with the given name.- Specified by:
addAttributein interfaceElement- Overrides:
addAttributein classAbstractElement- Parameters:
qName- is the fully qualified name of the attribute whose value is to be added or updatedvalue- is the attribute's value- Returns:
- this
Elementinstance.
-
setAttributes
Description copied from interface:ElementSets the attributes that this element contains- Specified by:
setAttributesin interfaceElement- Overrides:
setAttributesin classDefaultElement- Parameters:
attributes- DOCUMENT ME!
-
setAttributes
public void setAttributes(Attributes attributes, NamespaceStack namespaceStack, boolean noNamespaceAttributes) Description copied from class:AbstractElementThis method provides a more optimal way of setting all the attributes on an Element particularly for use inSAXReader.- Overrides:
setAttributesin classAbstractElement- Parameters:
attributes- DOCUMENT ME!namespaceStack- DOCUMENT ME!noNamespaceAttributes- DOCUMENT ME!
-
getDocumentFactory
- Overrides:
getDocumentFactoryin classDefaultElement
-
getBeanAttributeList
-
createAttributeList
A Factory Method pattern which lazily creates a List implementation used to store content- Overrides:
createAttributeListin classAbstractElement- Returns:
- DOCUMENT ME!
-
createAttributeList
Description copied from class:AbstractElementA Factory Method pattern which creates a List implementation used to store attributes- Overrides:
createAttributeListin classAbstractElement- Parameters:
size- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-