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