| Methods from org.dom4j.tree.AbstractElement: |
|---|
|
accept, add, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addNewNode, addNode, addNode, addProcessingInstruction, addProcessingInstruction, addText, additionalNamespaces, additionalNamespaces, appendAttributes, asXML, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributeValue, attributeValue, attributeValue, attributeValue, attributes, childAdded, childRemoved, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, declaredNamespaces, element, element, element, elementIterator, elementIterator, elementIterator, elementIterator, elementText, elementText, elementTextTrim, elementTextTrim, elements, elements, elements, elements, ensureAttributesCapacity, getData, getDocumentFactory, getName, getNamespace, getNamespaceForPrefix, getNamespaceForURI, getNamespacePrefix, getNamespaceURI, getNamespacesForURI, getNodeType, getPath, getQName, getQualifiedName, getStringValue, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, indexOf, isRootElement, isTextOnly, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, remove, remove, remove, remove, remove, removeNode, removeProcessingInstruction, setAttributeValue, setAttributeValue, setAttributes, setData, setName, setNamespace, setText, toString, write |
| Method from org.dom4j.bean.BeanElement Detail: |
public Element addAttribute(String name,
String value) {
Attribute attribute = attribute(name);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
|
public Element addAttribute(QName qName,
String value) {
Attribute attribute = attribute(qName);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
|
public Attribute attribute(String name) {
return getBeanAttributeList().attribute(name);
}
|
public Attribute attribute(QName qname) {
return getBeanAttributeList().attribute(qname);
}
|
protected List createAttributeList() {
return new BeanAttributeList(this);
}
A Factory Method pattern which lazily creates a List implementation used
to store content |
protected List createAttributeList(int size) {
return new BeanAttributeList(this);
}
|
protected BeanAttributeList getBeanAttributeList() {
return (BeanAttributeList) attributeList();
}
|
public Object getData() {
return bean;
}
|
protected DocumentFactory getDocumentFactory() {
return DOCUMENT_FACTORY;
}
|
public void setAttributes(List attributes) {
throw new UnsupportedOperationException("Not implemented yet.");
}
|
public void setAttributes(Attributes attributes,
NamespaceStack namespaceStack,
boolean noNamespaceAttributes) {
String className = attributes.getValue("class");
if (className != null) {
try {
Class beanClass = Class.forName(className, true,
BeanElement.class.getClassLoader());
this.setData(beanClass.newInstance());
for (int i = 0; i < attributes.getLength(); i++) {
String attributeName = attributes.getLocalName(i);
if (!"class".equalsIgnoreCase(attributeName)) {
addAttribute(attributeName, attributes.getValue(i));
}
}
} catch (Exception ex) {
// What to do here?
((BeanDocumentFactory) this.getDocumentFactory())
.handleException(ex);
}
} else {
super.setAttributes(attributes, namespaceStack,
noNamespaceAttributes);
}
}
|
public void setData(Object data) {
this.bean = data;
// force the attributeList to be lazily
// created next time an attribute related
// method is called again.
setAttributeList(null);
}
|