|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Container
Object container.
ContainerFactory| Method Summary | |
|---|---|
Object |
getDependency(Object object,
String dependencyName)
Gets an instance of a dependency of an object. |
String |
getMessage(Object object,
String messageName,
Locale locale,
Object arguments)
Gets an instance of a message of an object for a given locale. |
Object |
getObject(Class specification)
Gets an instance of an implementation of a specification. |
Object |
getObject(Class specification,
String implementationName)
Gets an instance of an implementation of a specification. |
Object |
getProperty(Object object,
String propertyName)
Gets an instance of a property of an object. |
| Method Detail |
|---|
Object getDependency(Object object,
String dependencyName)
The object to return is resolved based on the multiplicity of the
specification defined for the dependency. For a multiplicity equal to
Specification.MULTIPLICITY_ONE, the returned object will be an
instance of the class of that specification. For a multiplicity equal to
Specification.MULTIPLICITY_MANY, the returned object will be a
one-dimensional array of instances of the class of that specification.
When creating objects, use of the classloader associated with the
class of the given object, as returned by method
Class.getClassLoader(), is recommended. Only if that method
returns null, indicating the class has been loaded by the
bootstrap classloader, use of the bootstrap classloader is recommended.
object - The object to return a dependency instance of.dependencyName - The logical name of the dependency to return an
instance of.
dependencyName of
object.
NullPointerException - if object or dependencyName
is null.
MissingImplementationException - if no implementation is defined
for object.
MissingDependencyException - if no dependency named
dependencyName is defined for object.
MultiplicityConstraintException - if the specification of the
dependency has a multiplicity of MULTIPLICITY_ONE without any
implementation being available.
InstantiationException - if creating an
instance of the dependency fails.
ContainerError - for unrecoverable container errors.
ContextError - for unrecoverable context errors.
ModelError - for unrecoverable model errors.
String getMessage(Object object,
String messageName,
Locale locale,
Object arguments)
When creating objects, use of the classloader associated with the
class of the given object, as returned by method
Class.getClassLoader(), is recommended. Only if that method
returns null, indicating the class has been loaded by the
bootstrap classloader, use of the bootstrap classloader is recommended.
object - The object to return a message instance of.messageName - The logical name of the message to return an instance
of.locale - The locale of the message instance to return.arguments - Arguments to format the message instance with or
null.
messageName of
object formatted with arguments for locale.
NullPointerException - if object, locale or
messageName is null.
MissingImplementationException - if no implementation is defined
for object.
MissingMessageException - if no message named
messageName is defined for object.
ContainerError - for unrecoverable container errors.
ContextError - for unrecoverable context errors.
ModelError - for unrecoverable model errors.Object getObject(Class specification)
The object to return is resolved based on the multiplicity of the
specification defined for the given class. For a multiplicity equal to
Specification.MULTIPLICITY_ONE, the returned object will be an
instance of the given class. For a multiplicity equal to
Specification.MULTIPLICITY_MANY, the returned object will be a
one-dimensional array of instances of the given class.
When creating objects, use of the classloader associated with the
given class, as returned by method Class.getClassLoader(), is
recommended. Only if that method returns null, indicating the
class has been loaded by the bootstrap classloader, use of the bootstrap
classloader is recommended.
specification - The class of the specification to return an
implementation instance of.
specification.
NullPointerException - if specification is null.
MissingSpecificationException - if no specification is defined
for specification.
MultiplicityConstraintException - if the multiplicity of the
specification defined for specification equals
MULTIPLICITY_ONE and the model holds either no or more than one
implementation.
InstantiationException - if creating an
implementation instance fails.
ContainerError - for unrecoverable container errors.
ContextError - for unrecoverable context errors.
ModelError - for unrecoverable model errors.
Object getObject(Class specification,
String implementationName)
When creating objects, use of the classloader associated with the
given class, as returned by method Class.getClassLoader(), is
recommended. Only if that method returns null, indicating the
class has been loaded by the bootstrap classloader, use of the bootstrap
classloader is recommended.
specification - The class of the specification to return an
implementation instance of.implementationName - The logical name of the implementation to
return an instance of.
implementationName as specified by the specification defined for
class specification.
NullPointerException - if specification or
implementationName is null.
MissingSpecificationException - if no specification is defined
for specification.
MissingImplementationException - if no implementation named
implementationName is defined for the specification for
specification.
InstantiationException - if creating an
implementation instance fails.
ContainerError - for unrecoverable container errors.
ContextError - for unrecoverable context errors.
ModelError - for unrecoverable model errors.
Object getProperty(Object object,
String propertyName)
When creating objects, use of the classloader associated with the
class of the given object, as returned by method
Class.getClassLoader(), is recommended. Only if that method
returns null, indicating the class has been loaded by the
bootstrap classloader, use of the bootstrap classloader is recommended.
object - The object to return a property instance of.propertyName - The logical name of the property to return an
instance of.
propertyName of
object.
NullPointerException - if object or propertyName is
null.
MissingImplementationException - if no implementation is defined
for object.
MissingPropertyException - if no property named
propertyName is defined for object.
ContainerError - for unrecoverable container errors.
ContextError - for unrecoverable context errors.
ModelError - for unrecoverable model errors.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||