| org.apache.beehive.controls.api.context.ControlBeanContext
All known Subclasses: org.apache.beehive.controls.runtime.bean.ControlBeanContext,
ControlBeanContext | public interface ControlBeanContext extends BeanContextServices(Code) | | The ControlBeanContext interface defines the basic set of contextual services and lifecycle
events for Java ControlBean implementations.
ControlBeanContext also extends the java.beans.beancontext.BeanContextServices
interface, so it also provide core Java Beans services for managing contained controls,
looking up contextual services, and locating the parent
java.beans.beancontext.BeanContext context.
A Control implementation class can obtain access to the ControlBeanContext associated
with it by declaring an instance field of this type and annotating it with the
org.apache.beehive.controls.api.context.Context annotation, as in the following
example:
import org.apache.beehive.controls.api.context.Context;
import org.apache.beehive.controls.api.context.ControlBeanContext;
@ControlImplementation
public class MyControlImpl
{
@Context
ControlBeanContext myContext;
}
The Java Control runtime will automatically initialize this field to a reference to the
ControlBeanContext associated with the implementation instance.
|
Inner Class :public interface LifeCycle | |
Method Summary | |
public void | addLifeCycleListener(LifeCycle listener) Registers a new listener for LifeCycle events on the context. | public PropertyMap | getAnnotationMap(AnnotatedElement annotElem) Returns the PropertyMap containing default properties for an AnnotatedElement
in the current context. | public ControlBean | getBean(String id) Returns any child ControlBean that is nested in the ControlBeanContext, or null
if no matching child is found. | public java.lang.ClassLoader | getClassLoader() Returns the ClassLoader used to load the ControlBean class associated with the control
implementation instance. | public ControlBean | getControlBean() Returns the peer ControlBean associated with this ControlBeanContext. | public ControlHandle | getControlHandle() Returns a ControlHandle instance that enables operations and events to be dispatched
to the target control, if it is running inside of a container that supports external
event dispatch. | public Class | getControlInterface() | public PropertyMap | getControlPropertyMap() Returns the current set of properties (in PropertyMap format) for the control
associated with the context. | public T | getControlPropertySet(Class<T> propertySet) Returns the current value of PropertySet for the associated control, or
null if the property set has not been bound. | public T | getMethodPropertySet(Method m, Class<T> propertySet) Returns the current value of PropertySet for the provided method, or null
if the property set has not been bound for this method. | public String[] | getParameterNames(Method m) Returns an array containing the parameter names for the specified method
Parameters: m - the Method whose parameter names should be returned. | public T | getParameterPropertySet(Method m, int i, Class<T> propertySet) Returns the current value of PropertySet for the selected (by index) method parameter,
or null if the property set has not been bound for this method. | public Object | getParameterValue(Method m, String parameterName, Object[] parameters) Returns the value of a named method parameter from the input parameter array. | public T | getService(Class<T> serviceClass, Object selector) Returns an instance of a contextual service based upon the local context. | public boolean | isSingleThreadedContainer() Returns true if this container guarantees single-threaded behaviour. | public void | removeLifeCycleListener(LifeCycle listener) Removes a currently registered LifeCycle event listener on the context. |
addLifeCycleListener | public void addLifeCycleListener(LifeCycle listener)(Code) | | Registers a new listener for LifeCycle events on the context.
See Also: org.apache.beehive.controls.api.context.ControlBeanContext.LifeCycle |
getAnnotationMap | public PropertyMap getAnnotationMap(AnnotatedElement annotElem)(Code) | | Returns the PropertyMap containing default properties for an AnnotatedElement
in the current context.
|
getBean | public ControlBean getBean(String id)(Code) | | Returns any child ControlBean that is nested in the ControlBeanContext, or null
if no matching child is found. The id parameter is relative to
the current nesting context, not an absolute control id.
|
getClassLoader | public java.lang.ClassLoader getClassLoader()(Code) | | Returns the ClassLoader used to load the ControlBean class associated with the control
implementation instance. This is useful for loading other classes or resources that may
have been packaged with the public interfaces of the Control type (since they may not
necessarily have been packaged directly with the implementation class).
|
getControlBean | public ControlBean getControlBean()(Code) | | Returns the peer ControlBean associated with this ControlBeanContext. If the context
represents a top-level container (i.e. not a Control containing other controls), null
will be returned.
|
getControlHandle | public ControlHandle getControlHandle()(Code) | | Returns a ControlHandle instance that enables operations and events to be dispatched
to the target control, if it is running inside of a container that supports external
event dispatch. If the runtime container for the control does not support this
functionality, a value of null will be returned.
a ControlHandle instance for the control, or null. See Also: org.apache.beehive.controls.api.context.ControlHandle |
getControlInterface | public Class getControlInterface()(Code) | | Returns the public or extension interface associated with the context
|
getControlPropertyMap | public PropertyMap getControlPropertyMap()(Code) | | Returns the current set of properties (in PropertyMap format) for the control
associated with the context. The return map will contain the values for all bound
properties for the control.
the PropertyMap containing properties of the control. This map is read-only;any changes to it will not effect the local bean instance. See Also: org.apache.beehive.controls.api.properties.PropertyMap |
getControlPropertySet | public T getControlPropertySet(Class<T> propertySet)(Code) | | Returns the current value of PropertySet for the associated control, or
null if the property set has not been bound. Actual bindings for property
values may be the result of annotations on the control field or class,
property setting via factory arguments or setter APIs, or external
configuration.
Parameters: propertySet - the PropertySet to return the requested PropertySet instance, or null if not bound See Also: org.apache.beehive.controls.api.properties.PropertySet |
getParameterNames | public String[] getParameterNames(Method m) throws IllegalArgumentException(Code) | | Returns an array containing the parameter names for the specified method
Parameters: m - the Method whose parameter names should be returned. the array of parameter names (or an empty array if no parameters) |
getParameterPropertySet | public T getParameterPropertySet(Method m, int i, Class<T> propertySet) throws IllegalArgumentException, IndexOutOfBoundsException(Code) | | Returns the current value of PropertySet for the selected (by index) method parameter,
or null if the property set has not been bound for this method.
Parameters: m - the Method to check for properties Parameters: i - the index of the method parameter to check for the request PropertySet Parameters: propertySet - the PropertySet to return the request PropertySet instance, or null if not bound |
getParameterValue | public Object getParameterValue(Method m, String parameterName, Object[] parameters) throws IllegalArgumentException(Code) | | Returns the value of a named method parameter from the input parameter array.
Parameters: m - the Method associated with the input parameter list Parameters: parameterName - the name of the requested parameter Parameters: parameters - the array of method parameters the element in the input parameter array that corresponds to the requestedparameter |
getService | public T getService(Class<T> serviceClass, Object selector)(Code) | | Returns an instance of a contextual service based upon the local context. If
no provider for this service is available, then null will be returned.
Parameters: serviceClass - the class of the requested service Parameters: selector - the service dependent parameter an instance of the request service, or null if unavailable See Also: java.beans.beancontext.BeanContextServices.getService |
isSingleThreadedContainer | public boolean isSingleThreadedContainer()(Code) | | Returns true if this container guarantees single-threaded behaviour.
|
removeLifeCycleListener | public void removeLifeCycleListener(LifeCycle listener)(Code) | | Removes a currently registered LifeCycle event listener on the context.
See Also: org.apache.beehive.controls.api.context.ControlBeanContext.LifeCycle |
|
|