|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A context represents a set of typed objects, each identified by a name.
Nested Class Summary | |
static class |
Context.NO_VALUE
|
Field Summary | |
static java.lang.Object |
NO_VALUE
The NO_VALUE object is returned by getValue
if no value corresponds to the provided name. |
Method Summary | |
void |
acquire()
Acquires the target context. |
Element |
addElement(Name name,
java.lang.Class type,
int value)
Adds an element to the target context. |
Element |
addElement(Name name,
java.lang.Class type,
java.lang.Object value)
Adds an element in the target context. |
Element |
addElement(Name name,
Component component)
Adds an element in the target context. |
Element |
addElement(java.lang.String name,
java.lang.Class type,
int value,
char separator)
Adds an element to the target context. |
Element |
addElement(java.lang.String name,
java.lang.Class type,
java.lang.Object value,
char separator)
Adds an element to the target context. |
Element |
addElement(java.lang.String name,
Component component,
char separator)
Adds an element to the target context. |
Context |
addOrGetContext(Name _name)
|
Context |
addOrGetContext(java.lang.String _name,
char _separator)
|
Component |
getComponent(java.lang.String name,
char separator)
Returns the component contained in the element registered in the target context under the name name . |
Element |
getElement(java.lang.String name,
char separator)
Returns the element in the target context identified by name ,
null if no element is registered under name name . |
java.util.Enumeration |
getElements()
Returns an enumeration of the elements found in the target context. |
int |
getIntValue(Name name)
Returns the value of the element registered in the target context under the name name . |
int |
getIntValue(java.lang.String name,
char separator)
Returns the value of the element registered in the target context under the name name . |
Context |
getScope()
Returns the scope of the target context; |
java.lang.Object |
getValue(java.lang.String name,
char separator)
Returns the value of the element registered in the target context under the name name . |
void |
release()
Releases the target context, releasing all the resources it uses, if no one still uses it. |
void |
reset()
Resets the target context, removing all its current elements. |
Context |
setScope(Context scope)
Sets the scope of the target context; |
Methods inherited from interface org.objectweb.jonathan.apis.kernel.Component |
fork, getComponent, getElement, getFactoryValue, getIntValue, getReference, getType, getValue, getValue, setReference |
Field Detail |
public static final java.lang.Object NO_VALUE
getValue
if no value corresponds to the provided name.
Method Detail |
public Element addElement(Name name, java.lang.Class type, java.lang.Object value) throws JonathanException
name
- the name of the object to be added;type
- the type of the object to be added;value
- the object to be added.
JonathanException
- if something goes wrong (usually, a type
exception).public Element addElement(Name name, java.lang.Class type, int value) throws JonathanException
Class
is one of int.class, short.class, char.class,
or byte.class.
name
- the name of the element to be added;value
- the integer value of the element to be added;
JonathanException
- if something goes wrong (usually, a type
exception).public Element addElement(Name name, Component component) throws JonathanException
name
- the name of the element to be added;component
- the component to be added;
JonathanException
- if something goes wrong (usually, a type
exception).public Element addElement(java.lang.String name, java.lang.Class type, java.lang.Object value, char separator) throws JonathanException
addElement(Name,Class,Object)
, except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0
, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
name
- a string representing the name of the seeked element;type
- the type of the object to be added;value
- the object to be added;separator
- the separator character used to parse name
;
JonathanException
- if something goes wrong (usually, a type
exception).public Element addElement(java.lang.String name, Component component, char separator) throws JonathanException
addElement(Name,Component)
, except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0
, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
name
- a string representing the name of the added element;component
- the component to be added;separator
- the separator character used to parse name
;
JonathanException
- if something goes wrong (usually, a type
exception).public Element addElement(java.lang.String name, java.lang.Class type, int value, char separator) throws JonathanException
addElement(Name,Class,int)
, except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0
, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
name
- a string representing the name of the seeked element;value
- the integer value of the element to be added;separator
- the separator character used to parse name
;
JonathanException
- if something goes wrong (usually, a type
exception).public Context addOrGetContext(java.lang.String _name, char _separator) throws JonathanException
JonathanException
public Context addOrGetContext(Name _name) throws JonathanException
JonathanException
public Element getElement(java.lang.String name, char separator)
name
,
null if no element is registered under name name
.
This method is equivalent to getElement(Name)
, except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0
, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
name
- a string representing the name of the seeked element;separator
- the separator character used to parse name
;
public Component getComponent(java.lang.String name, char separator)
name
.
This method is equivalent to getComponent(Name)
, except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0
, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
name
- the name of the element whose component is seeked;separator
- the separator character used to parse name
;
public java.lang.Object getValue(java.lang.String name, char separator)
name
.
This method is equivalent to getValue(Name)
, except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0
, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
name
- the name of the element whose value is seeked;separator
- the separator character used to parse name
;
NO_VALUE
.public int getIntValue(Name name)
name
.
A call to getIntValue(name)
is equivalent to
if the provided name actually corresponds to an
element. If it is not the case,
getElement(name)
.getIntValue()
Integer.MAX_VALUE
is returned.
name
- the name of the element whose value is seeked;
Integer.MAX_VALUE
public int getIntValue(java.lang.String name, char separator)
name
.
This method is equivalent to getIntValue(Name)
, except that the name to use
is specified by a string and a separator separating the different elements of
the name.
If separator == 0
, the name corresponds to an object
local to the target context.
If the name begins with the separator, the name is an absolute name (this
only makes sense if the context has a tree structure); otherwise, the name is
relative to the target context.
name
- the name of the element whose value is seeked;separator
- the separator character used to parse name
;
Integer.MAX_VALUE
public java.util.Enumeration getElements()
public void release()
public void acquire()
public void reset()
public Context setScope(Context scope)
scope
- the new scope of the target context;
public Context getScope()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |