public class Reflector
extends java.lang.Object
| Constructor and Description |
|---|
Reflector() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.String> |
getAllProperties() |
java.lang.String |
getClassName() |
java.lang.Class<?> |
getClazz() |
java.util.Set<java.lang.String> |
getOwnProperties() |
java.lang.String[] |
getProperties()
Deprecated.
since 1.2; use
getOwnProperties() instead |
java.lang.Object |
getValue(java.lang.Object object,
java.lang.String attribute)
Gets the attribute of the object by invoking either
object.get<attribute>(), object.<attribute>()
or object.is<attribute>() (trying in that order). |
java.lang.Object |
newInstance()
Creates a new instance of the underlying class.
|
void |
removeObject(java.lang.Object object)
Removes all associations from the object by calling it's
removeYou() method. |
void |
removeValue(java.lang.Object object,
java.lang.String attribute,
java.lang.Object target)
Removes the link from object to target by invoking a fitting
set<attribute>(null) or
without<attribute>(target) method. |
Reflector |
setClassName(java.lang.String className) |
Reflector |
setClazz(java.lang.Class<?> clazz) |
Reflector |
setUseEMF()
Signifies to this reflector that the underlying class uses EMF.
|
java.lang.Object |
setValue(java.lang.Object object,
java.lang.String attribute,
java.lang.Object value)
Sets the attribute of the object to the new value by invoking a fitting
set<attribute>(...) or
with<attribute>(...) method or get<attribute>.add(...) for EMF to-many associations. |
java.lang.Object |
setValue(java.lang.Object object,
java.lang.String attribute,
java.lang.Object value,
java.lang.String type)
Deprecated.
since 1.2; use
setValue(Object, String, Object) instead |
public java.lang.Class<?> getClazz()
public Reflector setClazz(java.lang.Class<?> clazz)
public java.lang.String getClassName()
public Reflector setClassName(java.lang.String className)
public Reflector setUseEMF()
@Deprecated public java.lang.String[] getProperties()
getOwnProperties() insteadgetOwnProperties().toArray(new String[0]).clazz has.public java.util.Set<java.lang.String> getOwnProperties()
public java.util.Set<java.lang.String> getAllProperties()
public java.lang.Object newInstance()
null is returnednull if that failspublic java.lang.Object getValue(java.lang.Object object,
java.lang.String attribute)
object.get<attribute>(), object.<attribute>()
or object.is<attribute>() (trying in that order).object - the receiver objectattribute - the attribute namenull if no getter was found@Deprecated
public java.lang.Object setValue(java.lang.Object object,
java.lang.String attribute,
java.lang.Object value,
java.lang.String type)
setValue(Object, String, Object) insteadset<attribute>(...) or
with<attribute>(...) method or get<attribute>.add(...) for EMF to-many associations.object - the object to modifyattribute - the attribute namevalue - the new valuetype - unusedtrue if successful, or null if unsuccessfulpublic java.lang.Object setValue(java.lang.Object object,
java.lang.String attribute,
java.lang.Object value)
set<attribute>(...) or
with<attribute>(...) method or get<attribute>.add(...) for EMF to-many associations.object - the object to modifyattribute - the attribute namevalue - the new valuetrue if successful, or null if unsuccessfulpublic void removeValue(java.lang.Object object,
java.lang.String attribute,
java.lang.Object target)
set<attribute>(null) or
without<attribute>(target) method.object - the source objectattribute - the link nametarget - the target that shall no longer be attached to objectpublic void removeObject(java.lang.Object object)
removeYou() method.
If that method is not available, no action is taken.
In particular, no exception is thrown in that case.object - the object to remove