public class FacetAccessorImpl extends Object implements FacetAccessor
| Constructor and Description |
|---|
FacetAccessorImpl(Object delegate) |
| 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) |
public FacetAccessorImpl(Object delegate)
public <T> T facet(Class<T> cls)
FacetAccessorfacet in interface FacetAccessorT - The Type (as a Class) of the Facet.cls - The class of the facet.public Collection<Object> facets()
FacetAccessorfacets in interface FacetAccessorpublic <T> void addFacet(T obj)
FacetAccessoraddFacet in interface FacetAccessorpublic Object invoke(Method method, Object... args)
FacetAccessorinvoke in interface FacetAccessormethod - The method to invoke.args - Arguments to the method.public Object get(Field field)
FacetAccessorget in interface FacetAccessorfield - The field to accesspublic void set(Field field, Object value)
set in interface FacetAccessorpublic void removeFacet(Class<?> cls)
FacetAccessorremoveFacet in interface FacetAccessorcls - The class of the facet to remove.Copyright © 2017 Oracle. All rights reserved.