planet.commonapi.factory
Interface NodeFactory

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
NodeFactoryImpl

public interface NodeFactory
extends java.io.Serializable

It's a factory for Nodes abstraction. It pretends build Nodes of any class using the factory method pattern design.

Any future implementation must contain the no argument constructor.

Author:
Jordi Pujol 07-jul-2005
See Also:
Node

Method Summary
 Node buildNode()
          Builds a Node using the default IdFactory and the default Class for him.
 Node buildNode(Id id)
          Builds a Node using the Id that appears in parameter, using the default Class for him.
 NodeFactory setValues(IdFactory idFactory, java.lang.Class nodeClass)
          Sets the initial values for this NodeFactory.
 

Method Detail

setValues

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

Parameters:
idFactory - IdFactory to use to build all required Ids.
nodeClass - 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.

buildNode

public Node buildNode()
               throws InitializationException
Builds a Node using the default IdFactory and the default Class for him.

Returns:
A new instance of the default Node.
Throws:
InitializationException

buildNode

public Node buildNode(Id id)
               throws InitializationException
Builds a Node using the Id that appears in parameter, using the default Class for him.

Parameters:
id -
Returns:
A new instance of the default Node with the specified Id.
Throws:
InitializationException