Data Request Broker
2-3-release

fr.gael.drb.impl
Class DrbNodeImpl

java.lang.Object
  extended by fr.gael.drb.DrbDefaultNodesChangeProducer
      extended by fr.gael.drb.DrbAbstractNode
          extended by fr.gael.drb.impl.DrbNodeImpl
All Implemented Interfaces:
DrbMutableNode, DrbNode, DrbNodesChangeListener, DrbNodesChangeProducer, EventListener
Direct Known Subclasses:
DrbDefaultMutableNode, fr.gael.drb.impl.spi.DrbNodeSpi, FileNode, URLNode, XmlDocument, XmlNode, XsdNodeImpl, ZipFileNode, ZipNode

public abstract class DrbNodeImpl
extends DrbAbstractNode

DrbNode implementation. This interface allows to perform "implementation specific" operations.


Field Summary
 
Fields inherited from interface fr.gael.drb.DrbItem
ATTRIBUTE_ITEM, NODE_ITEM, UNDEFINED_ITEM, VALUE_ITEM
 
Constructor Summary
DrbNodeImpl()
           
 
Method Summary
 void close(boolean deep)
          Closes this node and releases any system resources associated with the implementation.
 DrbAttribute createAttribute(String name)
          Create a node with the specified name.
 DrbNode createNode(String name)
          Create a node with the specified name.
 void flush()
          Performs any pending changes.
 Object getImpl(Class api)
          Returns a specific implementation.
 DrbProvider getProvider()
          Returns the provider of this node.
 boolean hasImpl(Class api)
          Tests if a specific interface can be provided.
 
Methods inherited from class fr.gael.drb.DrbAbstractNode
allowsMultiOccurrence, appendChild, appendReference, equals, getAttribute, getAttributes, getChildAt, getChildren, getChildrenCount, getContent, getFirstChild, getIndex, getItemType, getLastChild, getName, getNamedChild, getNamespaceBindings, getNamespaceURI, getNextSibling, getOccurrence, getParent, getPath, getPreviousSibling, getRoot, getValue, getValueType, getXPathName, getXPathName, hasChild, insertChild, removeChild, rename, replaceChild, setAttributes, setNamespaceBindings, setNamespaceURI, setValue, toString
 
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

DrbNodeImpl

public DrbNodeImpl()
Method Detail

close

public void close(boolean deep)
Closes this node and releases any system resources associated with the implementation. A closed node cannot perform input or output operations and cannot be reopened.

Parameters:
deep - if this flag is disabled, the implementation shall not release the ressources shared with the descendants. WARNING: This parameter is not fully supported.

flush

public void flush()
Performs any pending changes. This methods forces the underlying implementation to perform all changes. The current node may use a buffer for caching input/output operations. In that case, this method will write the node to the system ressource.


hasImpl

public boolean hasImpl(Class api)
Tests if a specific interface can be provided. This operations tests with a minimum of time and memory consumption if the current implementation can provide a specific interface. It important to consider that hasImpl() provides information about the ability to provide such interface in general cases but not focused on the current instance. It may therefore be impossible to get a specific implementation from a node whereas hasImpl() operation returns true.

Parameters:
api - The class type to test.
Returns:
true if an implementation of the interface can be provided and false otherwise.

getImpl

public Object getImpl(Class api)
Returns a specific implementation. This operation returns a reference to an object implementing a specific interface. This mean is useful to benefit by a specific and direct API instead of using the DrbNode interface. The provided object shall represent the current node such as it is possible after a call to this operation, to dismiss the reference to the node. For instance, a file is usually wrapped as a drb.imple.file.File class and thanks to this operation can be seen as a InputStream anabling direct access to the handled file.

Parameters:
api - The interface (or class) to be provided.
Returns:
A reference to the object implementing the interface or a null reference otherwise.

createNode

public DrbNode createNode(String name)
Create a node with the specified name.

Parameters:
name - The expected name of the node.
Returns:
A reference to the new node.
Throws:
NullPointerException - This exception is raised when the name provided in parameter is null.
UnsupportedOperationException - This exception is raised when the implementation is not able to create a node.

createAttribute

public DrbAttribute createAttribute(String name)
Create a node with the specified name.

Parameters:
name - the name of the node
Returns:
DrbAttribute the attribute of the node

getProvider

public DrbProvider getProvider()
Returns the provider of this node.

Returns:
DrbProvider the provider node

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .