|
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
fr.gael.drb.impl.DrbNodeImpl
fr.gael.drb.xsd.XsdNodeImpl
public class XsdNodeImpl
A XML-Schema validator wrapper for DrbNodes.
| Field Summary | |
|---|---|
protected DrbNode |
baseNode
The baseNode node. |
| Fields inherited from interface fr.gael.drb.DrbItem |
|---|
ATTRIBUTE_ITEM, NODE_ITEM, UNDEFINED_ITEM, VALUE_ITEM |
| Constructor Summary | |
|---|---|
protected |
XsdNodeImpl(XsdNodeImpl parent,
DrbNode base,
XsdType type)
Build an DrbNodeFilter instance. |
| Method Summary | |
|---|---|
DrbNode |
appendChild(DrbNode node)
Appends a child at the end of the children list. |
void |
close(boolean deep)
Closes this node and releases any system resources associated with the pointed file. |
DrbAttribute |
getAttribute(String name)
Returns an attribute matching a specific name. |
DrbAttributeList |
getAttributes()
The attributes of the nodes. |
DrbNode |
getBase()
Returns the DrbNode baseNode. |
DrbNode |
getChildAt(int index)
Reference to a specific child. |
DrbNode |
getChildAt(int index)
Reference to a specific child of the current node (directory). |
DrbNodeList |
getChildren()
The list of children of the current node. |
DrbNodeList |
getChildren()
The list of children of the current node. |
int |
getChildrenCount()
Number of children. |
int |
getChildrenCount()
Number of files or directory hold by the current node (directory). |
DrbSequence |
getContent()
The content of the current node. |
DrbNode |
getFirstChild()
Reference to the first child of the current node. |
DrbNode |
getFirstChild()
Reference to the first child of the current node (directory). |
Object |
getImpl(Class api)
Returns a specific implementation. |
int |
getIndex()
Index of the node. |
int |
getIndex()
Index of the node. |
protected fr.gael.drb.xsd.DrbNodeFilter |
getInstance(DrbNode node)
Builds a XSD implementation from a base node. |
static XsdNode |
getInstance(DrbNode base,
XsdType type)
Create an XsdNode instance. |
DrbNode |
getLastChild()
Reference to the last child of the current node. |
DrbNode |
getLastChild()
Reference to the last child of the current node (directory). |
String |
getName()
Name of the node. |
String |
getName()
Name of the node. |
DrbNode |
getNamedChild(String name,
int occurence)
Returns an occurrence of child matching a specific name. |
DrbNode |
getNamedChild(String name,
int occurence)
Returns an occurence of child matching a specific name. |
Namespace |
getNamespaceBindings()
Get the namespace bindings. |
String |
getNamespaceURI()
Get namespace URI. |
String |
getNamespaceURI()
Get namespace URI. |
DrbNode |
getNextSibling()
Next sibling of the current file or directory. |
DrbNode |
getParent()
The parent of this node. |
String |
getPath()
The full path of the node. |
String |
getPath()
The full path of the node. |
DrbNode |
getPreviousSibling()
Previous sibling of the current file or directory. |
DrbNode |
getRoot()
Root node. |
XsdType |
getType()
Returns the type of this node or null if it is unknown. |
Value |
getValue()
The value of the node. |
Value |
getValue()
The value of the node. |
int |
getValueType()
The value type of the node. |
int |
getValueType()
The value type of the node. |
protected String |
getXPathName()
Name of the node. |
boolean |
hasChild()
Checks if current node is parent of at least one child. |
boolean |
hasChild()
Checks if any child exists. |
boolean |
hasImpl(Class api)
Tests if a specific interface can be provided. |
DrbNode |
insertChild(DrbNode node,
int index)
Inserts a child at a given position. |
XsdInvalid |
isDeepValid()
Check the conformance of a node and its children to its type. |
XsdInvalid |
isValid()
Check the conformance of a node to its type. |
static void |
main(String[] args)
Makes this class runnable for testing. |
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 |
setNamespaceURI(String namespace_uri)
Sets a namespace resource identifier. |
Value |
setValue(Value value)
Changes the value of the node. |
String |
toString()
This object (which is already a string!) is itself returned. |
| Methods inherited from class fr.gael.drb.impl.DrbNodeImpl |
|---|
createAttribute, createNode, flush, getProvider |
| Methods inherited from class fr.gael.drb.DrbAbstractNode |
|---|
allowsMultiOccurrence, appendReference, equals, getAttribute, getItemType, getOccurrence, getRoot, getXPathName, setNamespaceBindings |
| 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 |
| Methods inherited from interface fr.gael.drb.DrbNode |
|---|
appendChild, insertChild, removeChild, replaceChild, setAttributes, setNamespaceURI |
| Methods inherited from interface fr.gael.drb.DrbItem |
|---|
getItemType, rename |
| Field Detail |
|---|
protected DrbNode baseNode
| Constructor Detail |
|---|
protected XsdNodeImpl(XsdNodeImpl parent,
DrbNode base,
XsdType type)
parent - the parent nodebase - the base nodetype - XsdType| Method Detail |
|---|
public static XsdNode getInstance(DrbNode base,
XsdType type)
base - the base nodetype - XsdType
public XsdType getType()
public XsdInvalid isValid()
isValid in interface XsdNodepublic XsdInvalid isDeepValid()
public DrbAttributeList getAttributes()
public DrbNode getParent()
protected fr.gael.drb.xsd.DrbNodeFilter getInstance(DrbNode node)
node - the node
public final DrbNode getPreviousSibling()
public final DrbNode getNextSibling()
public String toString()
toString in class DrbAbstractNode
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 static void main(String[] args)
throws Exception
args - String[]
Exceptionpublic String getName()
getName in interface DrbItempublic int getIndex()
public DrbNode getRoot()
public String getPath()
public String getNamespaceURI()
getNamespaceURI in interface DrbItempublic int getValueType()
public Value getValue()
getValue in interface DrbItempublic DrbAttribute getAttribute(String name)
name - The name to match.
public DrbNodeList getChildren()
public boolean hasChild()
true if current node has at least one child,
false otherwise.
public DrbNode getNamedChild(String name,
int occurence)
name - The name to match.occurence - The occurrence number of the desired child.
null if not found.public DrbNode getFirstChild()
public DrbNode getLastChild()
public DrbNode getChildAt(int index)
index - The position of the node to retrieve starting from 0 and not
greater or equal to the number of children.
public int getChildrenCount()
public DrbNode getBase()
public void close(boolean deep)
close in class DrbNodeImpldeep - if this flag is disabled,the implementation shall not release
the ressources shared with the descendants.public String getName()
getName in class DrbAbstractNodeprotected String getXPathName()
getXPathName in class DrbAbstractNodepublic 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.
getPath in class DrbAbstractNodepublic int getIndex()
getIndex in class DrbAbstractNodepublic String getNamespaceURI()
getNamespaceURI in class DrbAbstractNodepublic Namespace getNamespaceBindings()
getNamespaceBindings in class DrbAbstractNodepublic int getValueType()
getValueType in class DrbAbstractNodepublic Value getValue()
getValue in class DrbAbstractNodepublic final boolean hasChild()
hasChild in class DrbAbstractNode
public DrbNode getNamedChild(String name,
int occurence)
getNamedChild in class DrbAbstractNodename - The name to match.occurence - The occurence number of the desired child.
public final DrbNode getFirstChild()
getFirstChild in class DrbAbstractNodepublic final DrbNode getLastChild()
getLastChild in class DrbAbstractNodepublic final DrbNode getChildAt(int index)
getChildAt in class DrbAbstractNodeindex - The position of the node to retreive starting from 0 and not
greater or equal to the number of children.
public DrbNodeList getChildren()
getChildren in class DrbAbstractNodepublic DrbSequence getContent()
getContent in class DrbAbstractNodepublic final int getChildrenCount()
getChildrenCount in class DrbAbstractNode
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.
rename in class DrbAbstractNodename - 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 void setAttributes(DrbAttributeList attributes)
throws NullPointerException,
UnsupportedOperationException
Warning: The input attributes may be 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 DrbNodesetAttributes in class DrbAbstractNodeattributes - 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 DrbNodesetNamespaceURI in class DrbAbstractNodenamespace_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 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 DrbNodeinsertChild in class DrbAbstractNodenode - 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 DrbNodeappendChild in class DrbAbstractNodenode - 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() of the listeners.
replaceChild in interface DrbNodereplaceChild in class DrbAbstractNodeindex - 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 DrbNoderemoveChild in class DrbAbstractNodeindex - 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 boolean hasImpl(Class api)
hasImpl in class DrbNodeImplapi - The class type to test.
public Object getImpl(Class api)
getImpl in class DrbNodeImplapi - The interface (or class) to be provided.
|
Data Request Broker - DRB API® 2-3-release |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||