public interface FacetAccessor
Modifier and Type | Method and Description |
---|---|
<T> void |
addFacet(T obj)
Add a facet to the object.
|
<T> T |
facet(java.lang.Class<T> cls)
Access the Facet of Class T from the object.
|
java.util.Collection<java.lang.Object> |
facets()
Return a list of all facets on this object.
|
java.lang.Object |
get(java.lang.reflect.Field field)
Fetch the value of the field from whichever facet contains the field.
|
java.lang.Object |
invoke(java.lang.reflect.Method method,
java.lang.Object... args)
Invoke method on the appropriate facet of this
object, that is, on the facet corresponding to
method.getDeclaringClass.
|
void |
removeFacet(java.lang.Class<?> cls)
Remove the facet (if any) of the given type.
|
void |
set(java.lang.reflect.Field field,
java.lang.Object value) |
<T> T facet(java.lang.Class<T> cls)
T
- The Type (as a Class) of the Facet.cls
- The class of the facet.<T> void addFacet(T obj)
T
- obj
- void removeFacet(java.lang.Class<?> cls)
cls
- The class of the facet to remove.java.util.Collection<java.lang.Object> facets()
java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object... args)
method
- The method to invoke.args
- Arguments to the method.java.lang.Object get(java.lang.reflect.Field field)
field
- The field to accessdebug
- True if debugging trace output is desiredvoid set(java.lang.reflect.Field field, java.lang.Object value)