smacs.tree
Class NodeReferenceAttribute
java.lang.Object
org.dom4j.tree.AbstractNode
org.dom4j.tree.AbstractAttribute
org.dom4j.tree.FlyweightAttribute
org.dom4j.tree.DefaultAttribute
smacs.tree.NodeDefaultAttribute
smacs.tree.NodeExtendedAttribute
smacs.tree.NodeReferenceAttribute
- All Implemented Interfaces:
- Attribute, Cloneable, EventListener, GetSimpleNode, HasNodeHandler, IsaNodeReferenceAttribute, IsaNodeReferenceChildListener, IsaNodeReferenceListener, Node, Serializable
- Direct Known Subclasses:
- InputNode
- public class NodeReferenceAttribute
- extends NodeExtendedAttribute
- implements IsaNodeReferenceAttribute, HasNodeHandler, IsaNodeReferenceChildListener, IsaNodeReferenceListener
special refer attribute.
* It is possible to create a NodeReferenceAttribute that links directly to a
NodeReferenceId in the attribute list of another node by means of a java
objects refeference. When the name of the id-tag changes in the referenced node
than it will be reflected in the xml serialization of the NodeReferenceAttribute
as it does pickup the new name automatically via the object reference.
- Author:
- Copyright (C) 2004, Guido Draheim. All rights reserved. Part of SMACS project.
- See Also:
- Serialized Form
| 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 |
| Methods inherited from class org.dom4j.tree.AbstractAttribute |
accept, asXML, createXPathResult, getData, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQualifiedName, getText, getUniquePath, setData, setNamespace, setText, toString, write |
| Methods inherited from class org.dom4j.tree.AbstractNode |
asXPathResult, clone, createPattern, createXPath, createXPathFilter, detach, getDocument, getDocumentFactory, getNodeTypeName, getPath, getStringValue, getUniquePath, hasContent, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, valueOf |
| Methods inherited from interface org.dom4j.Node |
accept, asXML, asXPathResult, clone, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getStringValue, getText, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write |
referenced
protected IsaNodeReferenceId referenced
nodehandler
protected NodeHandler nodehandler
NodeReferenceAttribute
public NodeReferenceAttribute(String name,
IsaNodeReferenceId node)
NodeReferenceAttribute
public NodeReferenceAttribute(String name,
IsaNodeReferenceId node,
NodeHandler def)
setHandler
public void setHandler(NodeHandler handler)
- you can set the NodeHandler in the attribute instance. which overrides the one from
the referenced node - in other words the original node is not modified.
getHandler
public NodeHandler getHandler()
- returns the NodeHandler of the node. This is per default the one from
the referenced node unless it is overridden via the local {#setHandler}
- Specified by:
getHandler in interface HasNodeHandler
getSimpleNode
public SimpleNode getSimpleNode()
- Description copied from interface:
IsaNodeReferenceAttribute
- return the referenced node.
- Specified by:
getSimpleNode in interface IsaNodeReferenceAttribute
getId
public String getId()
- the Id of the referenced node.
- Specified by:
getId in interface IsaNodeReferenceAttribute
getValue
public String getValue()
- the value is the Id-number.
overridde attribute.getValue() with attribute.node().getId().
That allows you to change the Id on the referenced Element-node
and all ref-ids will change automatically.
- Specified by:
getValue in interface Attribute
onNodeReferenceChildHasChanged
public void onNodeReferenceChildHasChanged(SimpleNode node)
- per default, tell the referenced node that this attribute points to.
- Specified by:
onNodeReferenceChildHasChanged in interface IsaNodeReferenceChildListener
onNodeReferenceHasChanged
public void onNodeReferenceHasChanged(SimpleNode node)
- per default, tell the parenting node of this reference attribute.
- Specified by:
onNodeReferenceHasChanged in interface IsaNodeReferenceListener
destroy
public void destroy()
toAttrXML
public String toAttrXML(String prefix)
- Description copied from class:
NodeExtendedAttribute
- currently: nothing
- Overrides:
toAttrXML in class NodeExtendedAttribute