|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.dom4j.bean 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:
- Branch, Cloneable, Element, Node, Serializable
- public class BeanElement
- extends DefaultElement
BeanElement
uses a Java Bean to store its attributes.
- Version:
- $Revision: 1.15 $
- Author:
- James Strachan
- See Also:
- Serialized Form
Field Summary |
Fields inherited from class org.dom4j.tree.AbstractElement |
EMPTY_ITERATOR, EMPTY_LIST, USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING |
Fields inherited from class org.dom4j.tree.AbstractBranch |
DEFAULT_CONTENT_LIST_SIZE |
Fields inherited from class org.dom4j.tree.AbstractNode |
NODE_TYPE_NAMES |
Fields inherited from interface org.dom4j.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 | |
BeanElement(QName qname)
|
|
BeanElement(QName qname,
Object bean)
|
|
BeanElement(String name,
Namespace namespace,
Object bean)
|
|
BeanElement(String name,
Object bean)
|
Method Summary | |
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)
DOCUMENT ME! |
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 List |
createAttributeList(int size)
A Factory Method pattern which creates a List implementation used to store attributes |
protected BeanAttributeList |
getBeanAttributeList()
|
Object |
getData()
DOCUMENT ME! |
protected DocumentFactory |
getDocumentFactory()
|
void |
setAttributes(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(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 AbstractElement.setText(java.lang.String) if it doesn't |
Methods inherited from class org.dom4j.tree.AbstractBranch |
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions |
Methods inherited from class org.dom4j.tree.AbstractNode |
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.dom4j.Element |
getTextTrim |
Methods inherited from interface org.dom4j.Branch |
addElement, addElement, appendContent, content, elementByID, setProcessingInstructions |
Methods inherited from interface org.dom4j.Node |
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf |
Constructor Detail |
BeanElement
public BeanElement(String name, Object bean)
BeanElement
public BeanElement(String name, Namespace namespace, Object bean)
BeanElement
public BeanElement(QName qname, Object bean)
BeanElement
public BeanElement(QName qname)
Method Detail |
getData
public Object getData()
- DOCUMENT ME!
- Specified by:
getData
in interfaceElement
- Overrides:
getData
in classAbstractElement
- Returns:
- the JavaBean associated with this element
setData
public void setData(Object data)
- Description copied from interface:
Element
- Sets the data value of this element if this element supports data binding
or calls
Node.setText(java.lang.String)
if it doesn't - Specified by:
setData
in interfaceElement
- Overrides:
setData
in classAbstractElement
attribute
public Attribute attribute(String name)
- Description copied from interface:
Element
- Returns the attribute with the given name
- Specified by:
attribute
in interfaceElement
- Overrides:
attribute
in classDefaultElement
attribute
public Attribute attribute(QName qname)
- Description copied from interface:
Element
- DOCUMENT ME!
- Specified by:
attribute
in interfaceElement
- Overrides:
attribute
in classDefaultElement
addAttribute
public Element addAttribute(String name, String value)
- Description copied from interface:
Element
Adds 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:
addAttribute
in interfaceElement
- Overrides:
addAttribute
in classAbstractElement
addAttribute
public Element addAttribute(QName qName, String value)
- Description copied from interface:
Element
Adds 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:
addAttribute
in interfaceElement
- Overrides:
addAttribute
in classAbstractElement
setAttributes
public void setAttributes(List attributes)
- Description copied from interface:
Element
- Sets the attributes that this element contains
- Specified by:
setAttributes
in interfaceElement
- Overrides:
setAttributes
in classDefaultElement
setAttributes
public void setAttributes(Attributes attributes, NamespaceStack namespaceStack, boolean noNamespaceAttributes)
- Description copied from class:
AbstractElement
- This method provides a more optimal way of setting all the attributes on
an Element particularly for use in
SAXReader
. - Overrides:
setAttributes
in classAbstractElement
- Parameters:
attributes
- DOCUMENT ME!namespaceStack
- DOCUMENT ME!noNamespaceAttributes
- DOCUMENT ME!
getDocumentFactory
protected DocumentFactory getDocumentFactory()
- Overrides:
getDocumentFactory
in classDefaultElement
getBeanAttributeList
protected BeanAttributeList getBeanAttributeList()
createAttributeList
protected List createAttributeList()
- A Factory Method pattern which lazily creates a List implementation used
to store content
- Overrides:
createAttributeList
in classAbstractElement
- Returns:
- DOCUMENT ME!
createAttributeList
protected List createAttributeList(int size)
- Description copied from class:
AbstractElement
- A Factory Method pattern which creates a List implementation used to
store attributes
- Overrides:
createAttributeList
in classAbstractElement
- Parameters:
size
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2005 MetaStuff Ltd.. All Rights Reserved.