|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.chromattic.api.ChromatticBuilder
public abstract class ChromatticBuilder
The builder configures and create a Chromattic runtime.
| Nested Class Summary | |
|---|---|
static class |
ChromatticBuilder.Configuration
|
static class |
ChromatticBuilder.Option<D>
A configuration option. |
| Field Summary | |
|---|---|
static ChromatticBuilder.Option<java.lang.Boolean> |
CREATE_ROOT_NODE
A boolean option that creates the root node designated by the ROOT_NODE_PATH option
when it does not exist. |
static ChromatticBuilder.Option<java.lang.String> |
INSTRUMENTOR_CLASSNAME
The instrumentor class name for Chromattic's objects. |
static ChromatticBuilder.Option<java.lang.Boolean> |
JCR_OPTIMIZE_ENABLED
Enable / disable all JCR optimizations. |
static ChromatticBuilder.Option<java.lang.Boolean> |
JCR_OPTIMIZE_HAS_NODE_ENABLED
Enable / disable access to JCR has property. |
static ChromatticBuilder.Option<java.lang.Boolean> |
JCR_OPTIMIZE_HAS_PROPERTY_ENABLED
Enable / disable access to JCR has property. |
static ChromatticBuilder.Option<java.lang.Boolean> |
LAZY_CREATE_ROOT_NODE
A boolean option that indicates that the root node should be lazyly created when it is required. |
static ChromatticBuilder.Option<java.lang.String> |
OBJECT_FORMATTER_CLASSNAME
The object name formatter class name. |
static ChromatticBuilder.Option<java.lang.Boolean> |
PROPERTY_CACHE_ENABLED
The boolean indicating if caching is performed. |
static ChromatticBuilder.Option<java.lang.Boolean> |
PROPERTY_READ_AHEAD_ENABLED
Todo. |
static ChromatticBuilder.Option<java.lang.String> |
ROOT_NODE_PATH
The path of the root node. |
static ChromatticBuilder.Option<java.lang.String> |
ROOT_NODE_TYPE
A string value that is the root node type when Chromattic has to build the path to the root node. |
static ChromatticBuilder.Option<java.lang.String> |
SESSION_LIFECYCLE_CLASSNAME
The JCR session life cycle class name. |
static ChromatticBuilder.Option<java.lang.Boolean> |
USE_SYSTEM_PROPERTIES
A special option that will lookup system properties when set to true to configure options by default. |
| Constructor Summary | |
|---|---|
ChromatticBuilder()
|
|
| Method Summary | ||
|---|---|---|
void |
add(java.lang.Class<?> clazz)
Adds a class definition. |
|
void |
add(java.lang.Class<?> first,
java.lang.Class<?>... other)
Adds a class definition. |
|
protected abstract Chromattic |
boot(ChromatticBuilder.Configuration options)
|
|
Chromattic |
build()
Builds the runtime and return a configured Chromattic instance. |
|
Chromattic |
build(ChromatticBuilder.Configuration config)
Builds the runtime and return a configured Chromattic instance. |
|
static ChromatticBuilder |
create()
Create and return an instance of the builder. |
|
protected ChromatticBuilder.Configuration |
createDefaultConfiguration()
Create the default configuration. |
|
ChromatticBuilder.Configuration |
getConfiguration()
Returns a copy of the current configuration. |
|
boolean |
init()
Initialize the builder, this operation should be called once per builder, unlike the build(Configuration)
operation that can be called several times with different configurations. |
|
protected abstract void |
init(java.util.Set<java.lang.Class<?>> classes)
|
|
|
setOptionValue(ChromatticBuilder.Option<D> option,
D value)
Set the option value. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ChromatticBuilder.Option<java.lang.Boolean> USE_SYSTEM_PROPERTIES
public static final ChromatticBuilder.Option<java.lang.String> INSTRUMENTOR_CLASSNAME
public static final ChromatticBuilder.Option<java.lang.String> SESSION_LIFECYCLE_CLASSNAME
public static final ChromatticBuilder.Option<java.lang.String> OBJECT_FORMATTER_CLASSNAME
public static final ChromatticBuilder.Option<java.lang.Boolean> PROPERTY_CACHE_ENABLED
public static final ChromatticBuilder.Option<java.lang.Boolean> PROPERTY_READ_AHEAD_ENABLED
public static final ChromatticBuilder.Option<java.lang.Boolean> JCR_OPTIMIZE_ENABLED
public static final ChromatticBuilder.Option<java.lang.Boolean> JCR_OPTIMIZE_HAS_PROPERTY_ENABLED
public static final ChromatticBuilder.Option<java.lang.Boolean> JCR_OPTIMIZE_HAS_NODE_ENABLED
public static final ChromatticBuilder.Option<java.lang.String> ROOT_NODE_PATH
public static final ChromatticBuilder.Option<java.lang.Boolean> CREATE_ROOT_NODE
ROOT_NODE_PATH option
when it does not exist.
public static final ChromatticBuilder.Option<java.lang.Boolean> LAZY_CREATE_ROOT_NODE
public static final ChromatticBuilder.Option<java.lang.String> ROOT_NODE_TYPE
| Constructor Detail |
|---|
public ChromatticBuilder()
| Method Detail |
|---|
public static ChromatticBuilder create()
protected ChromatticBuilder.Configuration createDefaultConfiguration()
Create the default configuration. Subclass can override it to provide a suitable default configuration. The returned object will likely be modified and therefore a new copy should be created every time this method is invoked.
The default implementation relies on the ServiceLoader to load an instance of ChromatticBuilder.Configuration.Factory
If no configuration is found then a builder exception is thrown.
public final ChromatticBuilder.Configuration getConfiguration()
public void add(java.lang.Class<?> clazz)
throws java.lang.NullPointerException,
java.lang.IllegalStateException
clazz - the class to add
java.lang.NullPointerException - if the provided class is null
java.lang.IllegalStateException - if the builder is already initialized
public void add(java.lang.Class<?> first,
java.lang.Class<?>... other)
throws java.lang.NullPointerException,
java.lang.IllegalStateException
first - the first class to addother - the other classes to add
java.lang.NullPointerException - if the provided class is null
java.lang.IllegalStateException - if the builder is already initialized
public final Chromattic build()
throws BuilderException
Chromattic instance.
BuilderException - any builder exception
public final Chromattic build(ChromatticBuilder.Configuration config)
throws BuilderException
Chromattic instance.
config - the configuration to use
BuilderException - any builder exception
public final boolean init()
throws BuilderException
build(Configuration)
operation that can be called several times with different configurations. This operation is used to perform the
initialization that is common to any configuration such as building the meta model from the classes.
BuilderException - any exception that would prevent the initialization to happen correctly
protected abstract void init(java.util.Set<java.lang.Class<?>> classes)
throws BuilderException
BuilderException
protected abstract Chromattic boot(ChromatticBuilder.Configuration options)
throws BuilderException
BuilderException
public <D> void setOptionValue(ChromatticBuilder.Option<D> option,
D value)
throws java.lang.NullPointerException
D - the option data typeoption - the option to setvalue - the option value
java.lang.NullPointerException - if any argument is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||