|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport groovy.lang.Binding groovy.util.FactoryBuilderSupport groovy.util.ObjectGraphBuilder
public class ObjectGraphBuilder extends FactoryBuilderSupport
A builder for creating object graphs.
Each node defines the class to be created and the property on its parent (if
any) at the same time.
Nested Class Summary | |
---|---|
interface |
ObjectGraphBuilder.ChildPropertySetter
Strategy for setting a child node on its parent. |
interface |
ObjectGraphBuilder.ClassNameResolver
Strategy for resolving a classname. |
static class |
ObjectGraphBuilder.DefaultChildPropertySetter
Default impl that calls parent.propertyName = child |
static class |
ObjectGraphBuilder.DefaultClassNameResolver
Default impl that capitalizes the classname. |
static class |
ObjectGraphBuilder.DefaultIdentifierResolver
Default impl, always returns 'id' |
static class |
ObjectGraphBuilder.DefaultNewInstanceResolver
Default impl that calls Class.newInstance() |
static class |
ObjectGraphBuilder.DefaultReferenceResolver
Default impl, always returns 'refId' |
static class |
ObjectGraphBuilder.DefaultRelationNameResolver
Default impl that returns parentName and childName accordingly. |
interface |
ObjectGraphBuilder.IdentifierResolver
Strategy for picking the correct synthetic identifier. |
interface |
ObjectGraphBuilder.NewInstanceResolver
Strategy for creating new instances of a class. |
interface |
ObjectGraphBuilder.ReferenceResolver
Strategy for picking the correct synthetic reference identifier. |
class |
ObjectGraphBuilder.ReflectionClassNameResolver
Build objects using reflection to resolve class names. |
interface |
ObjectGraphBuilder.RelationNameResolver
Strategy for resolving a relationship property name. |
Field Summary | |
---|---|
static String |
CLASSNAME_RESOLVER_KEY
|
static String |
CLASSNAME_RESOLVER_REFLECTION
|
static String |
CLASSNAME_RESOLVER_REFLECTION_ROOT
|
static String |
LAZY_REF
|
static String |
NODE_CLASS
|
static String |
NODE_NAME
|
static String |
OBJECT_ID
|
Constructor Summary | |
ObjectGraphBuilder()
|
Method Summary | |
---|---|
String
|
getBeanFactoryName()
Returns the current name of the 'bean' node. |
ObjectGraphBuilder.ChildPropertySetter
|
getChildPropertySetter()
Returns the current ChildPropertySetter. |
ClassLoader
|
getClassLoader()
Returns the classLoader used to load a node's class. |
ObjectGraphBuilder.ClassNameResolver
|
getClassNameResolver()
Returns the current ClassNameResolver. |
ObjectGraphBuilder.NewInstanceResolver
|
getNewInstanceResolver()
Returns the current NewInstanceResolver. |
ObjectGraphBuilder.RelationNameResolver
|
getRelationNameResolver()
Returns the current RelationNameResolver. |
boolean
|
isLazyReferencesAllowed()
Returns true if references can be resolved lazily |
protected void
|
postInstantiate(Object name, Map attributes, Object node)
|
protected void
|
preInstantiate(Object name, Map attributes, Object value)
|
protected Factory
|
resolveFactory(Object name, Map attributes, Object value)
|
void
|
setBeanFactoryName(String beanFactoryName)
Sets the name for the 'bean' node. |
void
|
setChildPropertySetter(Object childPropertySetter)
Sets the current ChildPropertySetter. |
void
|
setClassLoader(ClassLoader classLoader)
Sets the classLoader used to load a node's class. |
void
|
setClassNameResolver(Object classNameResolver)
Sets the current ClassNameResolver. |
void
|
setIdentifierResolver(Object identifierResolver)
Sets the current IdentifierResolver. |
void
|
setLazyReferencesAllowed(boolean lazyReferencesAllowed)
Sets whether references can be resolved lazily or not. |
void
|
setNewInstanceResolver(Object newInstanceResolver)
Sets the current NewInstanceResolver. |
void
|
setReferenceResolver(Object referenceResolver)
Sets the current ReferenceResolver. |
void
|
setRelationNameResolver(ObjectGraphBuilder.RelationNameResolver relationNameResolver)
Sets the current RelationNameResolver. |
Methods inherited from class Binding | |
---|---|
getProperty, getVariable, getVariables, hasVariable, setProperty, setVariable |
Methods inherited from class GroovyObjectSupport | |
---|---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
public static final String CLASSNAME_RESOLVER_KEY
public static final String CLASSNAME_RESOLVER_REFLECTION
public static final String CLASSNAME_RESOLVER_REFLECTION_ROOT
public static final String LAZY_REF
public static final String NODE_CLASS
public static final String NODE_NAME
public static final String OBJECT_ID
Constructor Detail |
---|
public ObjectGraphBuilder()
Method Detail |
---|
public String getBeanFactoryName()
public ObjectGraphBuilder.ChildPropertySetter getChildPropertySetter()
public ClassLoader getClassLoader()
public ObjectGraphBuilder.ClassNameResolver getClassNameResolver()
public ObjectGraphBuilder.NewInstanceResolver getNewInstanceResolver()
public ObjectGraphBuilder.RelationNameResolver getRelationNameResolver()
public boolean isLazyReferencesAllowed()
protected void postInstantiate(Object name, Map attributes, Object node)
protected void preInstantiate(Object name, Map attributes, Object value)
protected Factory resolveFactory(Object name, Map attributes, Object value)
public void setBeanFactoryName(String beanFactoryName)
public void setChildPropertySetter(Object childPropertySetter)
public void setClassLoader(ClassLoader classLoader)
public void setClassNameResolver(Object classNameResolver)
public void setIdentifierResolver(Object identifierResolver)
public void setLazyReferencesAllowed(boolean lazyReferencesAllowed)
public void setNewInstanceResolver(Object newInstanceResolver)
public void setReferenceResolver(Object referenceResolver)
public void setRelationNameResolver(ObjectGraphBuilder.RelationNameResolver relationNameResolver)
Copyright © 2003-2013 The Codehaus. All rights reserved.