public abstract class ContextBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected PropertyStoreBuilder |
psb
Contains all the modifiable settings for the implementation class.
|
Modifier | Constructor and Description |
---|---|
|
ContextBuilder()
Constructor.
|
|
ContextBuilder(PropertyStore ps)
Constructor.
|
protected |
ContextBuilder(PropertyStoreBuilder psb)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ContextBuilder |
add(Map<String,Object> properties)
Adds multiple configuration properties on this object.
|
ContextBuilder |
addTo(String name,
Object value)
Adds a value to a SET or LIST property.
|
ContextBuilder |
addTo(String name,
String key,
Object value)
Adds or overwrites a value to a SET, LIST, or MAP property.
|
ContextBuilder |
apply(PropertyStore copyFrom)
Copies the settings from the specified property store into this builder.
|
abstract Context |
build()
Build the object.
|
<T extends Context> |
build(Class<T> c)
Build a new instance of the specified object.
|
PropertyStore |
getPropertyStore()
Returns a read-only snapshot of the current property store on this builder.
|
protected PropertyStoreBuilder |
getPropertyStoreBuilder()
Returns access to the inner property store builder.
|
ContextBuilder |
removeFrom(String name,
Object value)
Removes a value from a SET, LIST, or MAP property.
|
ContextBuilder |
set(boolean append,
String name,
Object value)
Sets or adds to a SET or LIST property.
|
ContextBuilder |
set(Map<String,Object> properties)
Sets multiple configuration properties on this object.
|
ContextBuilder |
set(String name,
Object value)
Sets a configuration property on this object.
|
protected final PropertyStoreBuilder psb
public ContextBuilder()
public ContextBuilder(PropertyStore ps)
ps
- The initial configuration settings for this builder.protected ContextBuilder(PropertyStoreBuilder psb)
Used in cases where multiple context builder are sharing the same property store builder.
(e.g. HtlmlDocBuilder
)
psb
- The property store builder to use.protected PropertyStoreBuilder getPropertyStoreBuilder()
Used in conjunction with ContextBuilder(PropertyStoreBuilder)
when builders share property store builders.
public abstract Context build()
public ContextBuilder apply(PropertyStore copyFrom)
copyFrom
- The factory whose settings are being copied.public <T extends Context> T build(Class<T> c)
c
- The subclass of Context
to instantiate.public PropertyStore getPropertyStore()
public ContextBuilder set(String name, Object value)
name
- The property name.value
- The property value.PropertyStoreBuilder.set(String, Object)
public ContextBuilder set(boolean append, String name, Object value)
append
- If name
- The property name.value
- The property value.PropertyStoreBuilder.set(String, Object)
public ContextBuilder set(Map<String,Object> properties)
properties
- The properties to set on this class.PropertyStoreBuilder.set(java.util.Map)
public ContextBuilder add(Map<String,Object> properties)
properties
- The properties to set on this class.PropertyStoreBuilder.add(java.util.Map)
public ContextBuilder addTo(String name, Object value)
name
- The property name.value
- The new value to add to the SET property.ConfigException
- If property is not a SET property.public ContextBuilder addTo(String name, String key, Object value)
name
- The property name.key
- The property value map key.value
- The property value map value.ConfigException
- If property is not a MAP property.public ContextBuilder removeFrom(String name, Object value)
name
- The property name.value
- The property value in the SET property.ConfigException
- If property is not a SET property.Copyright © 2018 Apache. All rights reserved.