Class ObjectBinder


  • public final class ObjectBinder
    extends java.lang.Object
    Creates configurations bound to an object or class, getting its values from its fields.
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectBinder()
      Creates a new ObjectBinder with the default parameters.
      ObjectBinder​(boolean bypassTransient, boolean bypassFinal)
      Creates a new ObjectBinder with advanced parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Config bind​(java.lang.Class<?> clazz)
      Creates a new config bound to the static fields of a class.
      Config bind​(java.lang.Class<?> clazz, ConfigFormat<?> configFormat)
      Creates a new config bound to the static fields of a class.
      Config bind​(java.lang.Object object)
      Creates a new config bound to the fields of a object.
      Config bind​(java.lang.Object object, ConfigFormat<?> configFormat)
      Creates a new config bound to the fields of a object.
      • Methods inherited from class java.lang.Object

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

      • ObjectBinder

        public ObjectBinder​(boolean bypassTransient,
                            boolean bypassFinal)
        Creates a new ObjectBinder with advanced parameters.
        Parameters:
        bypassTransient - true to use (parse or write) a field even if it's transient
        bypassFinal - true to write a field even if it's final
      • ObjectBinder

        public ObjectBinder()
        Creates a new ObjectBinder with the default parameters. This is equivalent to new ObjectBinder(false, true).
        See Also:
        ObjectBinder(boolean, boolean)
    • Method Detail

      • bind

        public Config bind​(java.lang.Class<?> clazz)
        Creates a new config bound to the static fields of a class.
        Parameters:
        clazz - the class to bind
        Returns:
        a config bound to the static fields of the class
      • bind

        public Config bind​(java.lang.Class<?> clazz,
                           ConfigFormat<?> configFormat)
        Creates a new config bound to the static fields of a class.
        Parameters:
        clazz - the class to bind
        configFormat - the Config format
        Returns:
        a config bound to the static fields of the class
      • bind

        public Config bind​(java.lang.Object object)
        Creates a new config bound to the fields of a object.
        Parameters:
        object - the class to bind
        Returns:
        a config bound to the fields of the object
      • bind

        public Config bind​(java.lang.Object object,
                           ConfigFormat<?> configFormat)
        Creates a new config bound to the fields of a object.
        Parameters:
        object - the class to bind
        configFormat - the Config format
        Returns:
        a config bound to the fields of the object