public class BeanElement extends DefaultElement
BeanElement
uses a Java Bean to store its attributes.
Modifier and Type | Field and Description |
---|---|
private Object |
bean
The JavaBean which defines my attributes
|
private static DocumentFactory |
DOCUMENT_FACTORY
The
DocumentFactory instance used by default |
EMPTY_ITERATOR, EMPTY_LIST, USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING
DEFAULT_CONTENT_LIST_SIZE, outputFormat
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,
Object bean) |
BeanElement(String name,
Namespace namespace,
Object bean) |
BeanElement(String name,
Object bean) |
Modifier and Type | Method and Description |
---|---|
Element |
addAttribute(QName qName,
String value)
Adds the attribute value of the given fully qualified name.
|
Element |
addAttribute(String name,
String value)
Adds the attribute value of the given local name.
|
Attribute |
attribute(QName qname) |
Attribute |
attribute(String name)
Returns the attribute with the given name
|
protected List |
createAttributeList()
A Factory Method pattern which lazily creates
a List implementation used to store content
|
protected BeanAttributeList |
getBeanAttributeList() |
Object |
getData()
Accesses the data of this element which may implement data typing
bindings such as XML Schema or
Java Bean bindings or will return the same value as
Element.getText() |
protected DocumentFactory |
getDocumentFactory() |
void |
setAttributes(List attributes)
Sets the attributes that this element contains
|
void |
setData(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, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, 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, addNode, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, asXML, attributeValue, attributeValue, attributeValue, attributeValue, childAdded, childRemoved, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, 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
private static final DocumentFactory DOCUMENT_FACTORY
DocumentFactory
instance used by defaultpublic BeanElement(String name, Object bean)
public BeanElement(String name, Namespace namespace, Object bean)
public BeanElement(QName qname, Object bean)
public BeanElement(QName qname)
public Object getData()
Element
Element.getText()
getData
in interface Element
getData
in class AbstractElement
public void setData(Object data)
Element
Node.setText(java.lang.String)
if it doesn'tsetData
in interface Element
setData
in class AbstractElement
public Attribute attribute(String name)
Element
attribute
in interface Element
attribute
in class DefaultElement
public Attribute attribute(QName qname)
attribute
in interface Element
attribute
in class DefaultElement
public Element addAttribute(String name, String value)
Element
Adds the attribute value of the given local name. If an attribute already exists for the given name it will be replaced.
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, String value)
Element
Adds the attribute value of the given fully qualified name. If an attribute already exists for the given name it will be replaced.
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(List attributes)
Element
setAttributes
in interface Element
setAttributes
in class DefaultElement
protected DocumentFactory getDocumentFactory()
getDocumentFactory
in class DefaultElement
protected BeanAttributeList getBeanAttributeList()
protected List createAttributeList()
createAttributeList
in class AbstractElement
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses