|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NutEnvironment
The environment that a Nut object is running in.
| Method Summary | |
|---|---|
Component |
cast(java.lang.Class target_type,
Component c,
Location loc)
Transform a Component so that the instantiated instance is converted to the target type. |
java.lang.Object |
convert(java.lang.Class target_type,
java.lang.Object val,
Location loc)
Convert an object to a target type. |
java.lang.Object |
deserialize(java.lang.Class type,
java.lang.String text)
Convert a string literal to an object of a certain type. |
java.lang.Object |
findService(java.lang.Object key)
To find an optional service provided by the system. |
java.io.File |
getBaseDir()
Get the base directory setting of the system. |
java.lang.ClassLoader |
getComponentClassLoader()
Get the class loader used to load the component classes. |
DefaultLifecycleManager |
getLifecycleManager()
Get the lifecycle manager. |
java.lang.ClassLoader |
getNutClassLoader()
Get the class loader used to load the Nut tags. |
ParameterBinder |
getParameterWiringMode(java.lang.String mode_name,
Location loc)
Get the auto wiring mode specified by the mode name. |
PropertyBinder |
getPropertyWiringMode(java.lang.String mode_name,
Location loc)
Get the auto wiring mode specified by the mode name. |
ResourceLoader |
getResourceLoader()
Get the ResourceLoader object for loading resources. |
boolean |
isDeserializable(java.lang.Class type)
To determine if string literal can be converted to the target type. |
boolean |
isEagerlyInstantiating()
Do we by default eagerly instantiate components? |
void |
registerDeserializer(java.lang.Class type,
Deserializer deserializer,
boolean overriding,
boolean mandatory)
To register a Deserializer. |
void |
registerDynamic(java.lang.Object key,
java.lang.Object val,
boolean overridable,
boolean overriding,
Location loc)
Dynamically register an object. |
void |
registerEagerInstantiation(int seq,
java.lang.Object key,
Component c)
Add a Component to the list to be eagerly instantiated. |
| Method Detail |
|---|
ResourceLoader getResourceLoader()
java.lang.ClassLoader getNutClassLoader()
java.lang.ClassLoader getComponentClassLoader()
java.lang.Object convert(java.lang.Class target_type,
java.lang.Object val,
Location loc)
target_type - the target type.val - the object to be converted.loc - the location within the source that does the conversion.
Component cast(java.lang.Class target_type,
Component c,
Location loc)
target_type - the target type.c - the Component to transform.loc - the location within the source that does the casting.
java.io.File getBaseDir()
new File(".").
PropertyBinder getPropertyWiringMode(java.lang.String mode_name,
Location loc)
throws ConfigurationException
mode_name - the mode name.loc - the Location within the source file.
ConfigurationException - if the mode name is not recognized.
ParameterBinder getParameterWiringMode(java.lang.String mode_name,
Location loc)
throws ConfigurationException
mode_name - the mode name.loc - the location within the source file.
ConfigurationException - if the mode name is not recognized.boolean isEagerlyInstantiating()
java.lang.Object findService(java.lang.Object key)
key - the key to the service.
DefaultLifecycleManager getLifecycleManager()
void registerEagerInstantiation(int seq,
java.lang.Object key,
Component c)
seq - the sequence number of the component within the enclosing scope.
This number is important to figure out the evaluation order of the components.key - the key of the component.c - the component.
void registerDynamic(java.lang.Object key,
java.lang.Object val,
boolean overridable,
boolean overriding,
Location loc)
key - the key of the object.val - the object.overridable - whether this registration is overridable.overriding - do we override when the same key is already used
by another dynamically registered entry.loc - the location of the entry.
java.lang.Object deserialize(java.lang.Class type,
java.lang.String text)
throws java.lang.Throwable
type - the target type.text - the string literal.
java.lang.Throwable - when any error happens.
void registerDeserializer(java.lang.Class type,
Deserializer deserializer,
boolean overriding,
boolean mandatory)
type - the type that uses the Deserializer to convert
literal string to objects of this type.deserializer - the Deserializer object.overriding - whether override the existent Deserializer if any.
and an Deserializer object is already registered for the target type.mandatory - true if this registration has to go through.
java.lang.IllegalArgumentException - if not overriding
and an Deserializer object is already registered for the target type.boolean isDeserializable(java.lang.Class type)
type - the target type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||