Package org.spongepowered.configurate
Interface ConfigurationNodeFactory<N extends ConfigurationNode>
- All Known Subinterfaces:
ConfigurationLoader<N>
- All Known Implementing Classes:
AbstractConfigurationLoader
,GsonConfigurationLoader
,HoconConfigurationLoader
,JacksonConfigurationLoader
,XmlConfigurationLoader
,YamlConfigurationLoader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Something that can create a customized node.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault N
Create a new node with default options.createNode
(ConfigurationOptions options) Create an empty node with the provided options.createNode
(ConfigurationOptions options, CheckedConsumer<N, E> action) Create a new node with the provided options and initialize it with the provided action.createNode
(CheckedConsumer<N, E> action) Create a new node with default options and initialize it with the provided action.default ConfigurationOptions
Default options for the types of nodes created by this factory.toListCollector
(io.leangen.geantyref.TypeToken<V> valueType) Create a collector that appends values to a newly created node as list children.toListCollector
(Class<V> valueType) Create a collector that appends values to a newly created node as list children.toMapCollector
(io.leangen.geantyref.TypeToken<V> valueType) Create a collector that appends values to a newly created node as map children.toMapCollector
(Class<V> valueType) Create a collector that appends values to a newly created node as map children.
-
Method Details
-
defaultOptions
Default options for the types of nodes created by this factory.All values must match what a created node will see, but some values may be determined by this factory to be non user-modifiable. These should be documented for any factory implementation.
- Returns:
- default options
- Since:
- 4.0.0
-
createNode
Create an empty node with the provided options.Node options may be overridden if the factory enforces specific requirements on options.
- Parameters:
options
- node options- Returns:
- newly created empty node
- Since:
- 4.0.0
-
createNode
Create a new node with default options.- Returns:
- newly created empty node
- Since:
- 4.0.0
-
createNode
Create a new node with default options and initialize it with the provided action.- Type Parameters:
E
- thrown type- Parameters:
action
- action to initialize node with- Returns:
- newly created empty node
- Throws:
E
- when thrown from inner action- Since:
- 4.0.0
-
createNode
default <E extends Exception> N createNode(ConfigurationOptions options, CheckedConsumer<N, E> action) throws ECreate a new node with the provided options and initialize it with the provided action.Node options may be overridden if the factory enforces specific requirements on options.
- Type Parameters:
E
- thrown type- Parameters:
options
- node optionsaction
- action to initialize node with- Returns:
- newly created empty node
- Throws:
E
- when thrown from inner action- Since:
- 4.0.0
-
toMapCollector
default <V> Collector<Map.Entry<?,V>, toMapCollectorN, N> (io.leangen.geantyref.TypeToken<V> valueType) Create a collector that appends values to a newly created node as map children.This collector does not accept values in parallel.
- Type Parameters:
V
- value type- Parameters:
valueType
- marker for value type- Returns:
- a new collector
- Since:
- 4.0.0
-
toMapCollector
Create a collector that appends values to a newly created node as map children.This collector does not accept values in parallel.
- Type Parameters:
V
- value type- Parameters:
valueType
- marker for value type- Returns:
- a new collector
- Since:
- 4.0.0
-
toListCollector
Create a collector that appends values to a newly created node as list children.This collector does not accept values in parallel.
- Type Parameters:
V
- value type- Parameters:
valueType
- marker for value type- Returns:
- a new collector
- Since:
- 4.0.0
-
toListCollector
Create a collector that appends values to a newly created node as list children.This collector does not accept values in parallel.
- Type Parameters:
V
- value type- Parameters:
valueType
- marker for value type- Returns:
- a new collector
- Since:
- 4.0.0
-