planet.generic.commonapi.factory
Class NodeFactoryImpl

java.lang.Object
  extended byplanet.generic.commonapi.factory.NodeFactoryImpl
All Implemented Interfaces:
NodeFactory, java.io.Serializable

public class NodeFactoryImpl
extends java.lang.Object
implements NodeFactory

This is a specific implementation of NodeFactory that permits build any class of Node with any type of Id.

Author:
Jordi Pujol 07-jul-2005
See Also:
Serialized Form

Constructor Summary
NodeFactoryImpl()
          Builds an uninitialized NodeFactoryImpl.
 
Method Summary
 Node buildNode()
          Builds a NodeImpl with the actual IdFactory and class for the nodes.
 Node buildNode(Id id)
          Builds a node with the actual implementation class of NodeImpl and the specified id.
 NodeFactory setValues(IdFactory idFactory, java.lang.Class node)
          Sets the initial values for this NodeFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeFactoryImpl

public NodeFactoryImpl()
Builds an uninitialized NodeFactoryImpl. Does nothing. Requires the setValues(...) method invokation.

Method Detail

setValues

public NodeFactory setValues(IdFactory idFactory,
                             java.lang.Class node)
                      throws InitializationException
Sets the initial values for this NodeFactory.

Specified by:
setValues in interface NodeFactory
Parameters:
idFactory - IdFactory to use to build all required Ids.
node - Class reference of the current Node implementation.
Returns:
The same instance once it has been updated.
Throws:
InitializationException - if some error occurs during the initialization process.
See Also:
NodeFactory.setValues(planet.commonapi.factory.IdFactory, java.lang.Class)

buildNode

public Node buildNode()
               throws InitializationException
Builds a NodeImpl with the actual IdFactory and class for the nodes.

Specified by:
buildNode in interface NodeFactory
Returns:
A new instance of the default Node.
Throws:
InitializationException
See Also:
NodeFactory.buildNode(), IdFactory, Id, Node

buildNode

public Node buildNode(Id id)
               throws InitializationException
Builds a node with the actual implementation class of NodeImpl and the specified id.

Specified by:
buildNode in interface NodeFactory
Parameters:
id - Id to assign to the new instance of NodeImpl.
Returns:
An instance of actual implementation class of NodeImpl.
Throws:
InitializationException
See Also:
NodeFactory.buildNode(planet.commonapi.Id), IdFactory, Id, Node