|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.config.Jadice
public class Jadice
Helper methods for object creation and configuration. The methods supplied by this class are mainly used by jadice components internally; however, they can be helpful in a few advanced integration scenarios.
Method Summary | ||
---|---|---|
static void |
configure(Object instance)
Apply all registered and applicable ComponentConfigurer s to an object. |
|
static
|
create(Class<C> componentClass)
Create a new instance of the given type and apply the ComponentConfigurer s pertaining
to it. |
|
static Resolver<Class<?>,ClassNotFoundException> |
getClassResolver()
Gets the Resolver to be used by jadice components when looking up Class
instances based on their name. |
|
static void |
purgeComponentConfigurers()
Remove all registered ComponentConfigurer instances. |
|
static void |
registerComponentConfigurer(ComponentConfigurer<? extends Object> cc,
Class<?>... supportedClasses)
Add a ComponentConfigurer to the collection of configurers which are invoked by
configure(Object) , if applicable. |
|
static void |
setClassResolver(Resolver<Class<?>,ClassNotFoundException> resolver)
Set the Resolver to be used by jadice compontents when looking up Class
instances based on their name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void purgeComponentConfigurers()
ComponentConfigurer
instances.
registerComponentConfigurer(ComponentConfigurer, Class...)
public static void registerComponentConfigurer(ComponentConfigurer<? extends Object> cc, Class<?>... supportedClasses)
ComponentConfigurer
to the collection of configurers which are invoked by
configure(Object)
, if applicable.
cc
- the instance to be registeredsupportedClasses
- the type (or types) of classes which this ComponentConfigurer
is able to configurepublic static <C> C create(Class<C> componentClass)
ComponentConfigurer
s pertaining
to it.
componentClass
- the class to be instantiated
IllegalArgumentException
- if instantiation is not possible due to various reasons, such
as Illegal Access or a non-instantiable kind of classpublic static void configure(Object instance)
ComponentConfigurer
s to an object. A
ComponentConfigurer
is applicable if the type of object which it is able to configure
matches the given instance's type.
instance
- the object to be configuredpublic static Resolver<Class<?>,ClassNotFoundException> getClassResolver()
Resolver
to be used by jadice components when looking up Class
instances based on their name.
Resolver
to be used by jadice components when looking up Class
instances based on their name.public static void setClassResolver(Resolver<Class<?>,ClassNotFoundException> resolver)
Resolver
to be used by jadice compontents when looking up Class
instances based on their name. Setting a custom resolver is only needed in very few advanced
integration scenarios.
resolver
- the Resolver
to be used from now on
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |