|
Data Request Broker 2-3-release |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.gael.drb.DrbDefaultNodesChangeProducer
fr.gael.drb.DrbAbstractNode
public abstract class DrbAbstractNode
This class provides a skeletal implementation of the DrbNode interface, to minimize the effort required to implement this interface. The class is also a node change producer so its possible to monitor the changed performed on each instance.
| Field Summary |
|---|
| Fields inherited from interface fr.gael.drb.DrbItem |
|---|
ATTRIBUTE_ITEM, NODE_ITEM, UNDEFINED_ITEM, VALUE_ITEM |
| Constructor Summary | |
|---|---|
DrbAbstractNode()
|
|
| Method Summary | |
|---|---|
boolean |
allowsMultiOccurrence()
Check if this node may have multiple occurrence |
DrbNode |
appendChild(DrbNode node)
Appends a child at the end of the children list. |
DrbNode |
appendReference(DrbNode node)
Append a child reference at the end of the children list. |
boolean |
equals(Object obj)
Indicates whether this node is "equal to" to another node. |
DrbAttribute |
getAttribute(String name)
Returns an attribute matching a specific name. |
DrbAttributeList |
getAttributes()
The attributes of the nodes. |
DrbNode |
getChildAt(int index)
Reference to a specific child. |
abstract DrbNodeList |
getChildren()
The list of children of the current node. |
int |
getChildrenCount()
Number of children. |
DrbSequence |
getContent()
The content of the current node. |
DrbNode |
getFirstChild()
Reference to the first child of the current node. |
int |
getIndex()
Index of the node. |
int |
getItemType()
A code representing the type of the underlying object, as defined above. |
DrbNode |
getLastChild()
Reference to the last child of the current node. |
String |
getName()
Name of the node. |
DrbNode |
getNamedChild(String name,
int occurence)
Returns an occurence of the node matching the specified name. |
Namespace |
getNamespaceBindings()
Get the namespace bindings. |
String |
getNamespaceURI()
Get namespace URI. |
DrbNode |
getNextSibling()
Next sibling of the current node. |
int |
getOccurrence()
Occurrence of the node. |
abstract DrbNode |
getParent()
The parent of this node. |
String |
getPath()
The full path of the node. |
DrbNode |
getPreviousSibling()
Previous sibling of the current node. |
DrbNode |
getRoot()
Returns the root node. |
Value |
getValue()
The value of the node. |
int |
getValueType()
The value type of the node. |
protected String |
getXPathName()
Name of the node. |
protected String |
getXPathName(DrbAbstractNode node)
Name of the node. |
boolean |
hasChild()
Checks if child any child exists. |
DrbNode |
insertChild(DrbNode node,
int index)
Inserts a child at a given position. |
void |
removeChild(int index)
Removes an existing child. |
void |
rename(String name)
Changes the name of the node. |
DrbNode |
replaceChild(int index,
DrbNode new_node)
Replaces a child of the current node. |
void |
setAttributes(DrbAttributeList attributes)
Set the attribute list of a node. |
void |
setNamespaceBindings(Namespace bindings)
Set the namespace bindings. |
void |
setNamespaceURI(String namespace_uri)
Sets a namespace resource identifier. |
Value |
setValue(Value value)
Changes the value of the node. |
String |
toString()
Returns the node as a string. |
| Methods inherited from class fr.gael.drb.DrbDefaultNodesChangeProducer |
|---|
addNodesChangeListener, getListenerList, nodesChanged, nodesInserted, nodesRemoved, removeNodesChangeListener, setListenerList, structureChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DrbAbstractNode()
| Method Detail |
|---|
public boolean equals(Object obj)
equals in class Objectobj - another value.
public int getItemType()
public String getName()
protected String getXPathName()
protected final String getXPathName(DrbAbstractNode node)
node - node
public int getIndex()
public int getOccurrence()
public boolean allowsMultiOccurrence()
public DrbNode getRoot()
public String getPath()
Warning: Because the occurence number of the current node is not known in the parent, the occurence qualifier is not support by the current implementation.A possible algorithm shall be to search a reference to the current node in the list of children of the parent.
If no parent have already been set no absolute path is considered. A path considering the current node has a root node is not valid for the factory and is therefore not significant in the current implementation.
public String getNamespaceURI()
public Namespace getNamespaceBindings()
public int getValueType()
public Value getValue()
public DrbAttributeList getAttributes()
public DrbAttribute getAttribute(String name)
name - The name to match.
public abstract DrbNode getParent()
public abstract DrbNodeList getChildren()
public DrbSequence getContent()
public boolean hasChild()
public DrbNode getNamedChild(String name,
int occurence)
name - the Stringoccurence - int
public DrbNode getFirstChild()
public DrbNode getLastChild()
public DrbNode getChildAt(int index)
index - The position of the node to retreive starting from 0 and not
greater or equal to the number of children.
public int getChildrenCount()
public DrbNode getPreviousSibling()
public DrbNode getNextSibling()
public void rename(String name)
throws NullPointerException,
UnsupportedOperationException
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the current standing also as the source of the event. The called opetation is the nodesChanged() of the listeners.
name - Reference to the new name.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested rename for any
reason (e.g. specific case or general incapability).
NullPointerException - This exception is raised when the passed name
is a null reference.This exception may be overriden by an
UnsupportedOperationException.
public Value setValue(Value value)
throws NullPointerException,
ClassCastException,
UnsupportedOperationException
Important note: The implementation of the node is not supposed to accept value changes. For instance it may not be possible to change the value of a file directory that has no immediate signification.
Events: This operation fires a node changed event when the implementation is a node change producer. The node affected by the change is the current node as well as the source node. The called operation is the nodesChanged() of the listeners.
setValue in interface DrbNodevalue - The new value of the node. This value shall not be null.
NullPointerException - This exception is raised when the passed
reference to the value is null. This exception may be overriden
by an UnsupportedOperationException.
ClassCastException - This exception is raised when the
implementation has not succeeded to cast the input value in a
type compatible with the current node.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested assignment for
any reason.
public void setAttributes(DrbAttributeList attributes)
throws NullPointerException,
UnsupportedOperationException
Warning: The input attributes maybe duplicated or re-instanciated according to the targetted implementation. References to the effectively inserted attributes can be reteived from the getAttributes() operation of the DrbNode. It is highly recommended to discard the references to the input attribuets if not mandatory.
Important note: The implementation of the node is not supposed to accept attribute changes. For instance it may not be possible to change the size attribute of a file through this operation with would meant a effective file resize that is not really relevant without additional data.
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the current node as well as the source node.The called operation is the nodesChanged() of the listeners.
setAttributes in interface DrbNodeattributes - A reference to the new attribute list.
NullPointerException - This exception is raised when the passed
reference to the attribute list is null. This exception may be
overriden by an UnsupportedOperationException.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested attribute changes
for any reason.
public void setNamespaceURI(String namespace_uri)
throws NullPointerException,
UnsupportedOperationException
Important note: The implementation of the node is not supposed to accept namespace changes. For instance it may not be possible to change the namespace of a file that is basically fixed.
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the current node as well as the source node.The called operation is the nodesChanged() of the listeners.
setNamespaceURI in interface DrbNodenamespace_uri - A reference to the new namespace identifier.
NullPointerException - This exception is raised when the passed
reference to the new namespace identifier is null.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested namespace change
for any reason (e.g. by definition or in the specific case).
public void setNamespaceBindings(Namespace bindings)
throws UnsupportedOperationException
bindings - The namespace bindings.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested namespace change
for any reason (e.g. by definition or in the specific case).
public DrbNode insertChild(DrbNode node,
int index)
throws NullPointerException,
UnsupportedOperationException,
IndexOutOfBoundsException
If the node has been inserted within the children list, the next sibling indicies are increased of one. In addition the assiociations between the inserted node and it previous and next siblings are updated (if any).
Warning: The inserted node may be duplicated or re-instanciated according to the targetted implementation. A reference to the effectively inserted node is returned by the operation. It is highly recommended to discard the reference to the input node if not mandatory and to reference the returned node.
Important note: The implementation of the node is not supposed to accept any kind of node For instance it may not be possible to insert a node wrapping a file in an XML document. The documentation of the implementation shall describe its specific strategy.
Case of unordered or specifically ordered implementations: If the implementation does not support ordered children or has specific ordering rules, the node is inserted without taking into account the requested index passed in parameter. For instance it may not be possible to impose the file order in a directory: it generally depends on the lexicographical order of the node names or their creation date.
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the inserted node and the source is the current node. The called operation is the nodesInserted() of the listeners.
insertChild in interface DrbNodenode - A reference to the node to be inserted.index - The expected index of the node after the insertion.
NullPointerException - This exception is raised when the passed node
a null reference.This exception may be overriden by an
UnsupportedOperationException.
IndexOutOfBoundsException - This exception is raised when the passed
index is less than zero or if it is greater or equal to the
number of children in the number of children prior the call
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested insertion for any
reason(e.g. impossible in this current specific case or in
general).
public DrbNode appendChild(DrbNode node)
throws NullPointerException,
UnsupportedOperationException
Warning: The appended node may be duplicated or re-instanciated according to the targetted implementation. A reference to the effectively appended node is returned by the operation. It is highly recommended to discard the reference to the input node if not mandatory and to reference the returned node.
Important note: The implementation of the node is not supposed to accept any kind of node For instance it may not be possible to append a node wrapping a file in an XML document. The documentation of the implementation shall describe its specific strategy.
Case of unordered or specifically ordered implementations: If the implementation does not support ordered children or has specific ordering rules, the node may not be appended but only inserted according to these rules. For instance it may not be possible to impose the file order in a directory: it generally depends on the lexicographical order of the node names or their creation date.
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the appended node and the source is the current node. The called operation is the nodesInserted() of the listeners.
appendChild in interface DrbNodenode - A reference to the node to be appended.
NullPointerException - This exception is raised when the passed node
a null reference.This exception may be overriden by an
UnsupportedOperationException.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested append for any
reason (e.g. impossible in this current specific case or in
general).
public DrbNode replaceChild(int index,
DrbNode new_node)
throws NullPointerException,
IndexOutOfBoundsException,
UnsupportedOperationException
Warning: The replacing node may be duplicated or re-instanciated according to the targetted implementation.A reference to the effectively replacing node is returned by the operation. It is highly recommended to discard the reference to the input node if not mandatory and to reference the returned one.
Important note: The implementation of the node is not supposed to accept any kind of node For instance it may not be possible to insert a node wrapping a file in an XML document. The documentation of the implementation shall describe its specific strategy.
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the new node and the source is the current node.The called operation is the structureChanged() structureChanged() of the listeners.
replaceChild in interface DrbNodeindex - Index of the node to be replaced. This index starts at 0 and
shall be less than the number of children.new_node - A reference to the node that replaces the old one.
NullPointerException - This exception is raised when the reference
to the new node is null. This exception may be overriden by a
UnsupportedOperationException.
IndexOutOfBoundsException - This exception is raised when the passed
index is less than zero or greater or equal to the current
number of children.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested replace for any
reason. In addition if the old_node is not retreived in the
current children list, this exception is also raised.
public void removeChild(int index)
throws IndexOutOfBoundsException,
UnsupportedOperationException
This operation takes into account the removal by updating the sibling associations of the children nodes prior and next to the removed one. The indicies of the nodes next to the removed one are decresed of one. Their parents as well as their contents are left unchanged.
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the removed node and the source is the current node. The called operation is the nodesRemoved() of the listeners.
removeChild in interface DrbNodeindex - Index of the child to be removed.
IndexOutOfBoundsException - This exception is raised when the passed
index is less than zero or greater or equal to the current
number of children.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested removal for any
reason.
public DrbNode appendReference(DrbNode node)
throws NullPointerException,
UnsupportedOperationException
Case of unordered or specifically ordered implementations: If the implementation does not support ordered children or has specific ordering rules, the node may not be appended but only inserted according to these rules. For instance it may not be possible to impose the file order in a directory: it generally depends on the lexicographical order of the node names or their creation date.
Events: This operation fires a node change event when the implementation is a node change producer. The node affected by the change is the appended node and the source is the current node. The called operation is the nodesInserted() of the listeners.
node - A reference a node.
NullPointerException - This exception is raised when the passed node
a null reference.This exception may be overriden by an
UnsupportedOperationException.
UnsupportedOperationException - This exception is raised when the
implementation does not support the requested append for any
reason (e.g. impossible in this current specific case or in
general).public String toString()
toString in class Object
|
Data Request Broker - DRB API® 2-3-release |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||