Class ObjectBinder
- java.lang.Object
-
- com.electronwill.nightconfig.core.conversion.ObjectBinder
-
public final class ObjectBinder extends java.lang.ObjectCreates 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 Configbind(java.lang.Class<?> clazz)Creates a new config bound to the static fields of a class.Configbind(java.lang.Class<?> clazz, ConfigFormat<?> configFormat)Creates a new config bound to the static fields of a class.Configbind(java.lang.Object object)Creates a new config bound to the fields of a object.Configbind(java.lang.Object object, ConfigFormat<?> configFormat)Creates a new config bound to the fields of a object.
-
-
-
Constructor Detail
-
ObjectBinder
public ObjectBinder(boolean bypassTransient, boolean bypassFinal)Creates a new ObjectBinder with advanced parameters.- Parameters:
bypassTransient-trueto use (parse or write) a field even if it's transientbypassFinal-trueto write a field even if it's final
-
ObjectBinder
public ObjectBinder()
Creates a new ObjectBinder with the default parameters. This is equivalent tonew 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 bindconfigFormat- 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 bindconfigFormat- the Config format- Returns:
- a config bound to the fields of the object
-
-