Class ObjectBinder
java.lang.Object
com.electronwill.nightconfig.core.conversion.ObjectBinder
Creates configurations bound to an object or class, getting its values from its fields.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ObjectBinder with the default parameters.ObjectBinder(boolean bypassTransient, boolean bypassFinal) Creates a new ObjectBinder with advanced parameters. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new config bound to the static fields of a class.bind(Class<?> clazz, ConfigFormat<?> configFormat) Creates a new config bound to the static fields of a class.Creates a new config bound to the fields of a object.bind(Object object, ConfigFormat<?> configFormat) Creates a new config bound to the fields of a object.
-
Constructor Details
-
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:
-
-
Method Details
-
bind
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
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
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
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
-