|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.datanode.factory.DataNodeBuilder
uk.ac.starlink.datanode.factory.SimpleDataNodeBuilder
public abstract class SimpleDataNodeBuilder
An abstract DataNodeBuilder providing a template for builders which build nodes from instances of a given class. This class doesn't do anything clever, it's just a convenience for subclasses.
Constructor Summary | |
---|---|
protected |
SimpleDataNodeBuilder(Class nodeClass,
Class argClass)
Construct a new builder which will turn out DataNode of a given class from objects of a given class. |
protected |
SimpleDataNodeBuilder(String name,
Class argClass)
Construct a new builder which will turn out DataNodes from objects of a given class (or its subclasses). |
Method Summary | |
---|---|
abstract DataNode |
buildNode(Object obj)
Builds a DataNode from a given object. |
Class |
getNodeClass()
Returns the class which all nodes returned by the DataNodeBuilder.buildNode(java.lang.Object)
method will belong to. |
boolean |
suitable(Class objClass)
Determine whether this builder can be used to work on an object of a given class. |
String |
toString()
|
Methods inherited from class uk.ac.starlink.datanode.factory.DataNodeBuilder |
---|
getBuilders |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected SimpleDataNodeBuilder(String name, Class argClass)
name
- the name of this builder - this should normally be
the classname of the DataNodes it will produceargClass
- the class on which this node builder will operateprotected SimpleDataNodeBuilder(Class nodeClass, Class argClass)
nodeClass
- the class of DataNode objects which this builder
will be buildingargClass
- the class on which this node bulider will operateMethod Detail |
---|
public abstract DataNode buildNode(Object obj) throws NoSuchDataException
DataNodeBuilder
buildNode
in class DataNodeBuilder
obj
- the object to build a datanode from
NoSuchDataException
- if no new node can be createdpublic Class getNodeClass()
DataNodeBuilder
DataNodeBuilder.buildNode(java.lang.Object)
method will belong to. DataNodeBuilder's implementation of this
returns DataNode.class, but implementations which can
be more specific should override this method.
getNodeClass
in class DataNodeBuilder
public boolean suitable(Class objClass)
DataNodeBuilder
suitable
in class DataNodeBuilder
objClass
- the class of an object which might be passed
as the argument of buildNode
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |