Class SimpleDataNodeBuilder


  • public abstract class SimpleDataNodeBuilder
    extends DataNodeBuilder
    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

      Constructors 
      Modifier Constructor Description
      protected SimpleDataNodeBuilder​(java.lang.Class nodeClass, java.lang.Class argClass)
      Construct a new builder which will turn out DataNode of a given class from objects of a given class.
      protected SimpleDataNodeBuilder​(java.lang.String name, java.lang.Class argClass)
      Construct a new builder which will turn out DataNodes from objects of a given class (or its subclasses).
    • Constructor Detail

      • SimpleDataNodeBuilder

        protected SimpleDataNodeBuilder​(java.lang.String name,
                                        java.lang.Class argClass)
        Construct a new builder which will turn out DataNodes from objects of a given class (or its subclasses).
        Parameters:
        name - the name of this builder - this should normally be the classname of the DataNodes it will produce
        argClass - the class on which this node builder will operate
      • SimpleDataNodeBuilder

        protected SimpleDataNodeBuilder​(java.lang.Class nodeClass,
                                        java.lang.Class argClass)
        Construct a new builder which will turn out DataNode of a given class from objects of a given class. Just invokes SimpleDataNodeBuilder(nodeClass.getName(),argClass).
        Parameters:
        nodeClass - the class of DataNode objects which this builder will be building
        argClass - the class on which this node bulider will operate
    • Method Detail

      • getNodeClass

        public java.lang.Class getNodeClass()
        Description copied from class: DataNodeBuilder
        Returns the class which all nodes returned by the 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.
        Overrides:
        getNodeClass in class DataNodeBuilder
        Returns:
        superclass of all the classes of DataNode this builder can build
      • suitable

        public boolean suitable​(java.lang.Class objClass)
        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 class DataNodeBuilder
        Parameters:
        objClass - the class of an object which might be passed as the argument of buildNode
        Returns:
        whether it's OK to do that
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object