Package uk.ac.starlink.datanode.factory
Class SourceDataNodeBuilder
- java.lang.Object
-
- uk.ac.starlink.datanode.factory.DataNodeBuilder
-
- uk.ac.starlink.datanode.factory.SourceDataNodeBuilder
-
public class SourceDataNodeBuilder extends DataNodeBuilder
A DataNodebuilder which tries to build a DataNode from a DataSource object. It examines the file and may invoke a constructor of a DataNode subclass if it knows of one which is likely to be suitable. It will only try constructors which might have a chance.Part of its duties involve constructing a DOM from a DataSource which looks like XML and offering it to known XML consumers.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DataNodebuildNode(java.lang.Object obj)Builds a DataNode from a given object.static SourceDataNodeBuildergetInstance()Obtains the singleton instance of this class.booleansuitable(java.lang.Class objClass)Determine whether this builder can be used to work on an object of a given class.java.lang.StringtoString()-
Methods inherited from class uk.ac.starlink.datanode.factory.DataNodeBuilder
getBuilders, getNodeClass
-
-
-
-
Method Detail
-
getInstance
public static SourceDataNodeBuilder getInstance()
Obtains the singleton instance of this class.
-
suitable
public boolean suitable(java.lang.Class objClass)
Description copied from class:DataNodeBuilderDetermine whether this builder can be used to work on an object of a given class.- Specified by:
suitablein classDataNodeBuilder- Parameters:
objClass- the class of an object which might be passed as the argument of buildNode- Returns:
- whether it's OK to do that
-
buildNode
public DataNode buildNode(java.lang.Object obj) throws NoSuchDataException
Description copied from class:DataNodeBuilderBuilds a DataNode from a given object.- Specified by:
buildNodein classDataNodeBuilder- Parameters:
obj- the object to build a datanode from- Returns:
- a new DataNode made from obj
- Throws:
NoSuchDataException- if no new node can be created
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-