|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.util.Property
public class Property
Property class managing a property. This class allows storing property value and calling setter method too.
Constructor Summary | |
---|---|
Property(java.lang.String name,
java.lang.String field,
java.lang.String method,
java.lang.String value,
java.lang.String type,
InstanceManager manager,
Handler handler)
Configurable Property Constructor. |
Method Summary | |
---|---|
static java.lang.Class |
computeType(java.lang.String type,
org.osgi.framework.BundleContext context)
The set type method computes and returns the property type according to the given type name. |
static java.lang.Object |
create(java.lang.Class type,
java.lang.String strValue)
Create an object of the given type with the given String value. |
static java.lang.Object |
createArrayObject(java.lang.Class interntype,
java.lang.String[] values)
Create an array object containing the type 'interntype' from the String array 'values'. |
java.lang.String |
getField()
|
java.lang.String |
getMethod()
Get method name, null if no method. |
java.lang.String |
getName()
|
java.lang.Object |
getValue()
|
boolean |
hasField()
Check if the property has a field. |
boolean |
hasMethod()
Check if the property has a method callback. |
void |
invoke(java.lang.Object instance)
Invoke the setter method on the given pjo object. |
static boolean |
isAssignable(java.lang.Class type,
java.lang.Object value)
Test if the given value is assignable to the given type. |
java.lang.Object |
onGet(java.lang.Object pojo,
java.lang.String fieldName,
java.lang.Object value)
A field value is required by the object 'pojo'. |
void |
onSet(java.lang.Object pojo,
java.lang.String fieldName,
java.lang.Object value)
The field 'field' receives a new value. |
void |
setValue(java.lang.Object value)
Fix the value of the property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Property(java.lang.String name, java.lang.String field, java.lang.String method, java.lang.String value, java.lang.String type, InstanceManager manager, Handler handler) throws ConfigurationException
name
- : name of the property (optional)field
- : name of the fieldmethod
- : method namevalue
- : initial value of the property (optional)type
- : the type of the propertymanager
- : instance managerhandler
- : handler object which manage this property.
ConfigurationException
- : occurs when the property value cannot be set.Method Detail |
---|
public static java.lang.Class computeType(java.lang.String type, org.osgi.framework.BundleContext context) throws ConfigurationException
type
- : the type namecontext
- : bundle context (used to load classes)
ConfigurationException
- if an error occurs when loading the type class for non-primitive types.public java.lang.String getName()
public java.lang.String getField()
public java.lang.String getMethod()
public boolean hasMethod()
public boolean hasField()
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
value
- : the new value.public static boolean isAssignable(java.lang.Class type, java.lang.Object value)
type
- : class of the typevalue
- : object to check
public static java.lang.Object create(java.lang.Class type, java.lang.String strValue) throws ConfigurationException
type
- : type of the returned objectstrValue
- : String value.
ConfigurationException
- occurs when the object cannot be created.public static java.lang.Object createArrayObject(java.lang.Class interntype, java.lang.String[] values) throws ConfigurationException
interntype
- : internal type of the array.values
- : String array
ConfigurationException
- occurs when the array cannot be created correctlypublic void invoke(java.lang.Object instance)
instance
- : the created object (could be nullorg.apache.felix.ipojo.Handler#onCreation(java.lang.Object)
public java.lang.Object onGet(java.lang.Object pojo, java.lang.String fieldName, java.lang.Object value)
onGet
in interface FieldInterceptor
pojo
- : POJO objectfieldName
- : fieldvalue
- : last value
FieldInterceptor.onGet(java.lang.Object, java.lang.String, java.lang.Object)
public void onSet(java.lang.Object pojo, java.lang.String fieldName, java.lang.Object value)
onSet
in interface FieldInterceptor
pojo
- : pojofieldName
- : field namevalue
- : new valueFieldInterceptor.onSet(java.lang.Object, java.lang.String, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |