|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BlueprintConfiguration
Defines a blueprint configuration
| Method Summary | ||
|---|---|---|
|
construct(Class<T> clazz)
Construct a Java-Object using a class as a blueprint. |
|
CreationStrategy<?> |
findCreationStrategyForField(Field field)
Find a creation strategy that matches on the given field. |
|
CreationStrategy<?> |
findCreationStrategyForMethod(Method method)
Find a creation strategy that matches on the given method. |
|
CreationStrategy<?> |
findCreationStrategyForType(Class<?> clazz)
Find a creation strategy that matches on a given type. |
|
|
handleCycle(BlueprintSession session,
Class<T> clazz)
Handle the situation that a BlueprintCycle was detected for a particular class. |
|
boolean |
isWithPublicAttributes()
Retrieve if public attributes are filled during blueprinting. |
|
|
with(Class<T> type,
CreationStrategy<?> creator)
Replace every attribute with the type type with a given value. |
|
|
with(Class<T> type,
T value)
Replace every attribute with the type type with a given value. |
|
|
with(CycleHandlingStrategy<T> cycleHandlingStrategy)
Handle detected cycles in the blueprinting graph using an additional strategy. |
|
|
with(MatchingStrategy matchingStrategy)
Blueprint everything matching a given MatchingStrategy using this configuration. |
|
BlueprintConfiguration |
with(MatchingStrategy matcher,
CreationStrategy<?> creator)
Replace every attribute which matches a given strategy with a given value. |
|
|
with(String name,
T value)
Replace every attribute with the name name with a given value. |
|
BlueprintConfiguration |
withPublicAttributes(boolean withPublicAttributes)
Configure whether public attributes should be filled with values during blueprinting. |
|
| Method Detail |
|---|
@Nullable
<T> T construct(@Nonnull
Class<T> clazz)
T - clazz - a class
TBlueprint
@Nullable
CreationStrategy<?> findCreationStrategyForField(@Nonnull
Field field)
field - A field
ValueCreationStrategy or null
@Nullable
CreationStrategy<?> findCreationStrategyForMethod(@Nonnull
Method method)
method - A setter method
ValueCreationStrategy or null
@Nullable
CreationStrategy<?> findCreationStrategyForType(@Nonnull
Class<?> clazz)
class - A class
ValueCreationStrategy or null
@Nullable
<T> T handleCycle(@Nonnull
BlueprintSession session,
@Nonnull
Class<T> clazz)
T - session - The current BlueprintSessionclazz - The class which caused cycle in the blueprinting graph
TBlueprintboolean isWithPublicAttributes()
true if public attributes are filled during blueprinting
@Nonnull
<T> BlueprintConfiguration with(@Nonnull
Class<T> type,
@Nullable
CreationStrategy<?> creator)
type with a given value.
type - a Java type.creator - Creation strategy which actually creates a new value.
@Nonnull
<T> BlueprintConfiguration with(@Nonnull
Class<T> type,
@Nullable
T value)
type with a given value.
type - a Java type.value - value which should be assigned to the attribute
@Nonnull
<T> BlueprintConfiguration with(@Nonnull
CycleHandlingStrategy<T> cycleHandlingStrategy)
BlueprintCycleException.
cycleHandlingStrategy - Strategy to define how cycles for a certain type are handled
@Nonnull
<T> BlueprintConfiguration with(@Nonnull
MatchingStrategy matchingStrategy)
MatchingStrategy using this configuration.
matchingStrategy - Matching strategy to define if a given type or method should be constructed using blueprint.
@Nonnull
BlueprintConfiguration with(MatchingStrategy matcher,
CreationStrategy<?> creator)
matcher - Matching strategy to define if the replaced should be applied.creator - Creation strategy which actually creates a new value.
@Nonnull
<T> BlueprintConfiguration with(@Nonnull
String name,
@Nullable
T value)
name with a given value.
name - case insensitive name of an attribute.value - value which should be assigned to the attribute
@Nonnull BlueprintConfiguration withPublicAttributes(boolean withPublicAttributes)
withPublicAttributes - if true public attributes will be filled during blueprinting, otherwise they will be ignored.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||