|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectMemberAbstract
public abstract class NakedObjectMemberAbstract
| Nested Class Summary | |
|---|---|
protected static class |
NakedObjectMemberAbstract.MemberType
powertype for subclasses. |
| Field Summary | |
|---|---|
protected java.lang.String |
defaultName
|
| Constructor Summary | |
|---|---|
protected |
NakedObjectMemberAbstract(java.lang.String id,
Identified facetHolder,
NakedObjectMemberAbstract.MemberType memberType,
RuntimeContext runtimeContext)
|
| Method Summary | ||
|---|---|---|
void |
addFacet(Facet facet)
Adds the facet, extracting its type as the key. |
|
void |
addFacet(MultiTypedFacet facet)
Adds the multi-typed facet, extracting each of its
types as keys. |
|
boolean |
containsFacet(java.lang.Class<? extends Facet> facetType)
Whether there is a facet registered of the specified type. |
|
protected AuthenticationSession |
getAuthenticationSession()
|
|
java.lang.String |
getDescription()
Returns a description of how the member is used - this complements the help text. |
|
|
getFacet(java.lang.Class<T> cls)
Get the facet of the specified type (as per the type it reports from Facet.facetType()). |
|
Facet[] |
getFacets(Filter<Facet> filter)
Returns all Facets matching the specified FacetFilter. |
|
java.lang.Class<? extends Facet>[] |
getFacetTypes()
Get the list of all facet types that are supported by objects of this specification. |
|
java.lang.String |
getHelp()
Return the help text for this member - the field or action - to complement the description. |
|
java.lang.String |
getId()
Returns the identifier of the member, which must not change. |
|
Identifier |
getIdentifier()
Identifier of this feature. |
|
java.lang.String |
getName()
Return the default label for this member. |
|
RuntimeContext |
getRuntimeContext()
|
|
boolean |
isAction()
Whether this member represents a NakedObjectAction. |
|
boolean |
isAssociation()
Whether this member represents a NakedObjectAssociation. |
|
boolean |
isOneToManyAssociation()
Whether this member represents a OneToManyAssociation. |
|
boolean |
isOneToOneAssociation()
Whether this member represents a OneToOneAssociation. |
|
Consent |
isUsable(AuthenticationSession session,
NakedObject target)
Loops over all DisablingInteractionAdvisor Facets and returns true only if
none disables the member. |
|
Consent |
isVisible(AuthenticationSession session,
NakedObject target)
Loops over all HidingInteractionAdvisor Facets and returns true only if none
hide the member. |
|
void |
removeFacet(java.lang.Class<? extends Facet> facetType)
Remove the facet of the specified type. |
|
void |
removeFacet(Facet facet)
Remove the facet whose type is that reported by Facet.facetType(). |
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectMember |
|---|
createUsableInteractionContext, createVisibleInteractionContext, debugData |
| Methods inherited from interface org.nakedobjects.metamodel.spec.TypedSpecification |
|---|
getSpecification |
| Methods inherited from interface org.nakedobjects.metamodel.spec.Specification |
|---|
getInstance |
| Field Detail |
|---|
protected final java.lang.String defaultName
| Constructor Detail |
|---|
protected NakedObjectMemberAbstract(java.lang.String id,
Identified facetHolder,
NakedObjectMemberAbstract.MemberType memberType,
RuntimeContext runtimeContext)
| Method Detail |
|---|
public java.lang.String getId()
NakedObjectMember
getId in interface NakedObjectMemberpublic Identifier getIdentifier()
Identified
getIdentifier in interface Identifiedpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean containsFacet(java.lang.Class<? extends Facet> facetType)
FacetHolder
Convenience; saves having to FacetHolder.getFacet(Class) and then check if null.
containsFacet in interface FacetHolderpublic <T extends Facet> T getFacet(java.lang.Class<T> cls)
FacetHolderFacet.facetType()).
getFacet in interface FacetHolderpublic java.lang.Class<? extends Facet>[] getFacetTypes()
FacetHolder
getFacetTypes in interface FacetHolderpublic Facet[] getFacets(Filter<Facet> filter)
FacetHolderFacets matching the specified FacetFilter.
getFacets in interface FacetHolderpublic void addFacet(Facet facet)
FacetHoldertype as the key.
If there are any facet of the same type, they will be overwritten provided that either the
Facet specifies to always replace or if the existing
Facet is a no-op.
addFacet in interface FacetHolderpublic void addFacet(MultiTypedFacet facet)
FacetHoldermulti-typed facet, extracting each of its
types as keys.
If there are any facet of the same type, they will be overwritten provided that either the
Facet specifies to always replace or if the existing
Facet is a no-op.
addFacet in interface FacetHolderpublic void removeFacet(Facet facet)
FacetHolderFacet.facetType().
removeFacet in interface FacetHolderpublic void removeFacet(java.lang.Class<? extends Facet> facetType)
FacetHolder
removeFacet in interface FacetHolderpublic java.lang.String getName()
getName in interface NamedAndDescribedgetId()public java.lang.String getDescription()
NamedAndDescribed
getDescription in interface NamedAndDescribed#getHelp()public java.lang.String getHelp()
NakedObjectMember
getHelp in interface NakedObjectMemberNamedAndDescribed.getDescription()
public Consent isVisible(AuthenticationSession session,
NakedObject target)
HidingInteractionAdvisor Facets and returns true only if none
hide the member.
TODO: currently this method is hard-coded to assume all interactions are initiated
by user.
isVisible in interface NakedObjectMembertarget - may be null if just checking for authorization.#isVisibleResult(AuthenticationSession, NakedObject)
public Consent isUsable(AuthenticationSession session,
NakedObject target)
DisablingInteractionAdvisor Facets and returns true only if
none disables the member.
TODO: currently this method is hard-coded to assume all interactions are initiated
by user.
isUsable in interface NakedObjectMembertarget - may be null if just checking for authorization.#isUsableResult(AuthenticationSession, NakedObject)public boolean isAction()
NakedObjectMemberNakedObjectAction.
If so, can be safely downcast to NakedObjectAction.
isAction in interface NakedObjectMemberpublic boolean isAssociation()
NakedObjectMemberNakedObjectAssociation.
If so, can be safely downcast to NakedObjectAssociation.
isAssociation in interface NakedObjectMemberpublic boolean isOneToManyAssociation()
NakedObjectMemberOneToManyAssociation.
If so, can be safely downcast to OneToManyAssociation.
isOneToManyAssociation in interface NakedObjectMemberpublic boolean isOneToOneAssociation()
NakedObjectMemberOneToOneAssociation.
If so, can be safely downcast to OneToOneAssociation.
isOneToOneAssociation in interface NakedObjectMemberpublic RuntimeContext getRuntimeContext()
protected AuthenticationSession getAuthenticationSession()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||