public class BeanElement extends DefaultElement
BeanElement
uses a Java Bean to store its attributes.
USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING
DEFAULT_CONTENT_LIST_SIZE
NODE_TYPE_NAMES
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 and Description |
---|
BeanElement(QName qname) |
BeanElement(QName qname,
java.lang.Object bean) |
BeanElement(java.lang.String name,
Namespace namespace,
java.lang.Object bean) |
BeanElement(java.lang.String name,
java.lang.Object bean) |
Modifier and Type | Method and Description |
---|---|
Element |
addAttribute(QName qName,
java.lang.String value)
Adds the attribute value of the given fully qualified name.
|
Element |
addAttribute(java.lang.String name,
java.lang.String value)
Adds the attribute value of the given local name.
|
BeanAttribute |
attribute(QName qname)
DOCUMENT ME!
|
BeanAttribute |
attribute(java.lang.String name)
Returns the attribute with the given name
|
protected java.util.List<Attribute> |
createAttributeList()
A Factory Method pattern which lazily creates a List implementation used
to store content
|
protected java.util.List<Attribute> |
createAttributeList(int size)
A Factory Method pattern which creates a List implementation used to
store attributes
|
protected BeanAttributeList |
getBeanAttributeList() |
java.lang.Object |
getData()
DOCUMENT ME!
|
protected DocumentFactory |
getDocumentFactory() |
void |
setAttributes(org.xml.sax.Attributes attributes,
NamespaceStack namespaceStack,
boolean noNamespaceAttributes)
This method provides a more optimal way of setting all the attributes on
an Element particularly for use in
SAXReader . |
void |
setAttributes(java.util.List<Attribute> attributes)
Sets the attributes that this element contains
|
void |
setData(java.lang.Object data)
Sets the data value of this element if this element supports data binding
or calls
Node.setText(java.lang.String) if it doesn't |
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, supportsParent
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, 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, childAdded, childRemoved, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributeValue, setAttributeValue, setName, setNamespace, setText, toString, write
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTextTrim
addElement, addElement, appendContent, content, elementByID, setProcessingInstructions
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf
public BeanElement(java.lang.String name, java.lang.Object bean)
public BeanElement(java.lang.String name, Namespace namespace, java.lang.Object bean)
public BeanElement(QName qname, java.lang.Object bean)
public BeanElement(QName qname)
public java.lang.Object getData()
getData
in interface Element
getData
in class AbstractElement
public void setData(java.lang.Object data)
Element
Node.setText(java.lang.String)
if it doesn'tsetData
in interface Element
setData
in class AbstractElement
data
- DOCUMENT ME!public BeanAttribute attribute(java.lang.String name)
Element
attribute
in interface Element
attribute
in class DefaultElement
name
- DOCUMENT ME!public BeanAttribute attribute(QName qname)
Element
attribute
in interface Element
attribute
in class DefaultElement
qname
- is the fully qualified namepublic Element addAttribute(java.lang.String name, java.lang.String value)
Element
addAttribute
in interface Element
addAttribute
in class AbstractElement
name
- is the name of the attribute whose value is to be added or
updatedvalue
- is the attribute's valueElement
instance.public Element addAttribute(QName qName, java.lang.String value)
Element
addAttribute
in interface Element
addAttribute
in class AbstractElement
qName
- is the fully qualified name of the attribute whose value is to
be added or updatedvalue
- is the attribute's valueElement
instance.public void setAttributes(java.util.List<Attribute> attributes)
Element
setAttributes
in interface Element
setAttributes
in class DefaultElement
attributes
- DOCUMENT ME!public void setAttributes(org.xml.sax.Attributes attributes, NamespaceStack namespaceStack, boolean noNamespaceAttributes)
AbstractElement
SAXReader
.setAttributes
in class AbstractElement
attributes
- DOCUMENT ME!namespaceStack
- DOCUMENT ME!noNamespaceAttributes
- DOCUMENT ME!protected DocumentFactory getDocumentFactory()
getDocumentFactory
in class DefaultElement
protected BeanAttributeList getBeanAttributeList()
protected java.util.List<Attribute> createAttributeList()
createAttributeList
in class AbstractElement
protected java.util.List<Attribute> createAttributeList(int size)
AbstractElement
createAttributeList
in class AbstractElement
size
- DOCUMENT ME!