|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.metamodel.facets.FacetAbstract
public abstract class FacetAbstract
| Constructor Summary | |
|---|---|
FacetAbstract(java.lang.Class<? extends Facet> facetType,
FacetHolder holder,
boolean derived)
|
|
| Method Summary | |
|---|---|
boolean |
alwaysReplace()
Default implementation of this method that returns true, ie should replace (none no-op implementations. |
java.lang.Class<? extends Facet> |
facetType()
Determines the type of this facet to be stored under. |
FacetHolder |
getFacetHolder()
The holder of this facet. |
Identified |
getIdentified()
Convenience method that returns getFacetHolder() downcast to
Identified if the implementation does indeed inherit from
Identified, otherwise null. |
Facet |
getUnderlyingFacet()
Underlying Facet of the same type, if any. |
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. |
java.lang.String |
toString()
|
protected java.lang.String |
toStringValues()
|
java.lang.Object |
unwrapObject(NakedObject nakedObject)
For convenience of subclass facets that implement ValidatingInteractionAdvisor,
HidingInteractionAdvisor or DisablingInteractionAdvisor. |
java.lang.String |
unwrapString(NakedObject nakedObject)
For convenience of subclass facets that implement ValidatingInteractionAdvisor,
HidingInteractionAdvisor or DisablingInteractionAdvisor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FacetAbstract(java.lang.Class<? extends Facet> facetType,
FacetHolder holder,
boolean derived)
| Method Detail |
|---|
public final java.lang.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.
facetType in interface Facetpublic 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.
isDerived in interface Facetpublic Identified getIdentified()
getFacetHolder() downcast to
Identified if the implementation does indeed inherit from
Identified, otherwise null.
public Facet getUnderlyingFacet()
FacetFacet of the same type, if any.
getUnderlyingFacet in interface Facetpublic void setUnderlyingFacet(Facet underlyingFacet)
FacetFacet, that is, creating a chain.
Must be of the same type.
setUnderlyingFacet in interface Facetpublic boolean isNoop()
No-op implementations should override and return true.
isNoop in interface Facetpublic 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 Facetpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object unwrapObject(NakedObject nakedObject)
ValidatingInteractionAdvisor,
HidingInteractionAdvisor or DisablingInteractionAdvisor.
public java.lang.String unwrapString(NakedObject nakedObject)
ValidatingInteractionAdvisor,
HidingInteractionAdvisor or DisablingInteractionAdvisor.
protected java.lang.String toStringValues()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||