Class DataNodeBuilder

    • Constructor Summary

      Constructors 
      Constructor Description
      DataNodeBuilder()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract DataNode buildNode​(java.lang.Object obj)
      Builds a DataNode from a given object.
      static DataNodeBuilder[] getBuilders​(java.lang.Class clazz)
      Returns an array of DataNodeBuilder objects which are all the ones that can be found by reflection in the supplied class.
      java.lang.Class getNodeClass()
      Returns the class which all nodes returned by the buildNode(java.lang.Object) method will belong to.
      abstract boolean suitable​(java.lang.Class objClass)
      Determine whether this builder can be used to work on an object of a given class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataNodeBuilder

        public DataNodeBuilder()
    • Method Detail

      • suitable

        public abstract boolean suitable​(java.lang.Class objClass)
        Determine whether this builder can be used to work on an object of a given class.
        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 abstract DataNode buildNode​(java.lang.Object obj)
                                    throws NoSuchDataException
        Builds a DataNode from a given object.
        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
      • getNodeClass

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

        public static DataNodeBuilder[] getBuilders​(java.lang.Class clazz)
        Returns an array of DataNodeBuilder objects which are all the ones that can be found by reflection in the supplied class.
        Parameters:
        clazz - a class to reflect on
        Returns:
        an array of builder objects found in clazz