public abstract class FacetAbstract extends Object implements Facet
| Modifier and Type | Class and Description |
|---|---|
static class |
FacetAbstract.Derivation |
static interface |
FacetAbstract.Disabling
Marker interface used within
toString(). |
static interface |
FacetAbstract.Hiding
Marker interface used within
toString(). |
static interface |
FacetAbstract.Validating
Marker interface used within
toString(). |
| Constructor and Description |
|---|
FacetAbstract(Class<? extends Facet> facetType,
FacetHolder holder,
FacetAbstract.Derivation derivation) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alwaysReplace()
Default implementation of this method that returns true, ie
should replace (none
no-op implementations. |
Class<? extends Facet> |
facetType()
Determines the type of this facet to be stored under.
|
FacetHolder |
getFacetHolder()
The
holder of this facet. |
IdentifiedHolder |
getIdentified()
Convenience method that returns
getFacetHolder() downcast to
IdentifiedHolder if the implementation does indeed inherit from
IdentifiedHolder, otherwise null. |
Facet |
getUnderlyingFacet()
|
boolean |
isDerived()
Whether this facet implementation is derived (as opposed to explicit);
used to determine precedence.
|
boolean |
isNoop()
Assume implementation is not a no-op.
|
void |
setFacetHolder(FacetHolder facetHolder)
Allows reparenting of Facet.
|
void |
setUnderlyingFacet(Facet underlyingFacet)
Sets underlying
Facet, that is, creating a chain. |
String |
toString() |
protected String |
toStringValues() |
public FacetAbstract(Class<? extends Facet> facetType, FacetHolder holder, FacetAbstract.Derivation derivation)
public final Class<? extends Facet> facetType()
Facet
The framework looks for Facets of certain well-known facet types.
Each facet implementation must specify which type of facet it corresponds
to. This therefore allows the (rules of the) programming model to be
varied without impacting the rest of the framework.
For example, the ActionInvocationFacet specifies the facet to
invoke an action. The typical implementation of this wraps a
public method. However, a different facet factory could be
installed that creates facet also of type ActionInvocationFacet
but that have some other rule, such as requiring an action prefix,
or that decorate the interaction by logging it, for example.
public FacetHolder getFacetHolder()
Facetholder of this facet.getFacetHolder in interface Facetpublic boolean isDerived()
FacetFor example, we might derive the typical length of a property based on its type; but if the typical length has been explicitly specified using an annotation then that should take precedence.
public IdentifiedHolder getIdentified()
getFacetHolder() downcast to
IdentifiedHolder if the implementation does indeed inherit from
IdentifiedHolder, otherwise null.public Facet getUnderlyingFacet()
FacetgetUnderlyingFacet in interface Facetpublic void setUnderlyingFacet(Facet underlyingFacet)
FacetsetUnderlyingFacet in interface Facetpublic boolean isNoop()
No-op implementations should override and return true.
public boolean alwaysReplace()
no-op implementations.
Implementations that don't wish to replace none no-op implementations should override and return false.
alwaysReplace in interface Facetpublic void setFacetHolder(FacetHolder facetHolder)
FacetUsed by Facet decorators.
setFacetHolder in interface Facetprotected String toStringValues()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.