Package uk.ac.starlink.datanode.factory
Class FileDataNodeBuilder
java.lang.Object
uk.ac.starlink.datanode.factory.DataNodeBuilder
uk.ac.starlink.datanode.factory.FileDataNodeBuilder
A DataNodeBuilder which tries to build a DataNode from a File 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.
Rather than trying everything, it will only attempt constructors
which it thinks has a good chance of succeeding. Thus, if it works,
it will probably be faster than going through the whole list of
constructor-based builders. It may also make smarter decisions than
doing it that way.
-
Method Summary
Modifier and TypeMethodDescriptionBuilds a DataNode from a given object.static FileDataNodeBuilder
Obtains the singleton instance of this class.boolean
Determine whether this builder can be used to work on an object of a given class.toString()
Methods inherited from class uk.ac.starlink.datanode.factory.DataNodeBuilder
getBuilders, getNodeClass
-
Method Details
-
getInstance
Obtains the singleton instance of this class. -
suitable
Description copied from class:DataNodeBuilder
Determine whether this builder can be used to work on an object of a given class.- Specified by:
suitable
in classDataNodeBuilder
- Parameters:
objClass
- the class of an object which might be passed as the argument ofbuildNode
- Returns:
- whether it's OK to do that
-
buildNode
Description copied from class:DataNodeBuilder
Builds a DataNode from a given object.- Specified by:
buildNode
in 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
-