public interface ObjectSpecification extends Specification, ObjectActionContainer, ObjectAssociationContainer, Hierarchical, Dirtiable, DefaultProvider
Class) within the
metamodel.
As specifications are cyclic (specifically a class will reference its
subclasses, which in turn reference their superclass) they need be created
first, and then later work out its internals. Hence we create
ObjectSpecifications as we need them, and then introspect them later.
| Modifier and Type | Field and Description |
|---|---|
static Comparator<ObjectSpecification> |
COMPARATOR_FULLY_QUALIFIED_CLASS_NAME |
static Comparator<ObjectSpecification> |
COMPARATOR_SHORT_IDENTIFIER_IGNORE_CASE |
static List<ObjectSpecification> |
EMPTY_LIST |
static com.google.common.base.Function<ObjectSpecification,String> |
FUNCTION_FULLY_QUALIFIED_CLASS_NAME |
| Modifier and Type | Method and Description |
|---|---|
Object |
createObject() |
ObjectTitleContext |
createTitleInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter targetObjectAdapter)
Create an
InteractionContext representing an attempt to read the
object's title. |
ObjectValidityContext |
createValidityInteractionContext(DeploymentCategory deploymentCategory,
AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter targetObjectAdapter)
Create an
InteractionContext representing an attempt to save the
object. |
Class<?> |
getCorrespondingClass() |
String |
getCssClass()
Returns a css class name of the specification.
|
String |
getDescription()
Returns the description, if any, of the specification.
|
String |
getFullIdentifier()
Returns an (immutable) "full" identifier for this specification.
|
String |
getHelp()
Returns a help string or lookup reference, if any, of the specification.
|
String |
getIconName(ObjectAdapter object)
Returns the name of an icon to use for the specified object.
|
String |
getPluralName()
Returns the plural name for objects of this specification.
|
String |
getShortIdentifier()
Returns an (immutable) "short" identifier for this specification.
|
String |
getSingularName()
Returns the (singular) name for objects of this specification.
|
ObjectSpecId |
getSpecId()
Returns the (unique) spec Id, as per the
ObjectSpecIdFacet. |
String |
getTitle(ObjectAdapter adapter,
org.apache.isis.applib.profiles.Localization localization)
Deprecated.
|
String |
getTitle(ObjectAdapter contextAdapterIfAny,
ObjectAdapter targetAdapter,
org.apache.isis.applib.profiles.Localization localization)
Returns the title to display of target adapter, rendered within the context
of some other adapter (if any).
|
ObjectAdapter |
initialize(ObjectAdapter object)
REVIEW: should this behaviour move, eg onto ObjectAdapter?
|
boolean |
isAbstract() |
boolean |
isEncodeable()
Determines if objects of this type can be converted to a data-stream.
|
boolean |
isHidden()
Whether has the
HiddenFacet |
boolean |
isImmutable()
Whether has the
ImmutableFacet. |
boolean |
isNotCollection()
Determines if the object represents an value or object.
|
boolean |
isParented()
Determines if objects of this type are parented (a parented collection, or an aggregated entity).
|
boolean |
isParentedOrFreeCollection()
Determines if objects of this type are a parented (internal) or free-standing (external) collection.
|
boolean |
isParseable()
Determines if objects of this type can be set up from a text entry
string.
|
boolean |
isService()
Whether or not this specification represents a domain service (as opposed
to a domain entity or a value etc).
|
Consent |
isValid(ObjectAdapter adapter)
Determines whether the specified object is in a valid state (for example,
so can be persisted); represented as a
Consent. |
InteractionResult |
isValidResult(ObjectAdapter adapter)
Determines whether the specified object is in a valid state (for example,
so can be persisted); represented as a
InteractionResult. |
boolean |
isValue()
Determines if objects of this type are values.
|
boolean |
isValueOrIsParented()
Determines if objects of this type are either values or aggregated.
|
void |
markAsService() |
Persistability |
persistability()
Determines if objects of this specification can be persisted or not.
|
getFeatureType, getInstancegetIdentifieraddFacet, addFacet, containsDoOpFacet, containsFacet, getFacet, getFacets, getFacetTypes, removeFacet, removeFacetgetObjectAction, getObjectAction, getObjectAction, getObjectActions, getObjectActions, getObjectActions, getServiceActionsReturninggetAssociation, getAssociations, getAssociations, getAssociations, getCollections, getPropertieshasSubclasses, interfaces, isOfType, subclasses, superclassclearDirty, isDirty, markDirtygetDefaultValuestatic final List<ObjectSpecification> EMPTY_LIST
static final com.google.common.base.Function<ObjectSpecification,String> FUNCTION_FULLY_QUALIFIED_CLASS_NAME
static final Comparator<ObjectSpecification> COMPARATOR_FULLY_QUALIFIED_CLASS_NAME
static final Comparator<ObjectSpecification> COMPARATOR_SHORT_IDENTIFIER_IGNORE_CASE
Class<?> getCorrespondingClass()
ObjectSpecId getSpecId()
ObjectSpecIdFacet.
This will typically be the value of the ObjectType annotation (or equivalent);
if non has been specified then will default to the fully qualified class name (with
class name substituted if necessary to allow for runtime bytecode enhancement.
The ObjectSpecification can be retrieved using SpecificationLoader.lookupBySpecId(ObjectSpecId).
String getFullIdentifier()
This will be the fully qualified name of the Class object that this object represents (i.e. it includes the package name).
String getShortIdentifier()
This will be the class name without the package; any text up to and including the last period is removed.
String getSingularName()
Corresponds to the SingleStringValueFacet.value() of NamedFacet; is
not necessarily immutable.
String getPluralName()
Corresponds to the value of
PluralFacet; is not necessarily immutable.
String getDescription()
Corresponds to the DescribedAsFacet#value()) value of
DescribedAsFacet; is not necessarily immutable.
getDescription in interface Specification#getHelp()String getHelp()
Corresponds to the HelpFacet#value()) value of HelpFacet;
is not necessarily immutable.
String getCssClass()
Corresponds to the CssClass#value()) value of CssClassFacet;
@Deprecated String getTitle(ObjectAdapter adapter, org.apache.isis.applib.profiles.Localization localization)
getTitle(ObjectAdapter, ObjectAdapter, Localization)
Corresponds to the TitleFacet#value()) value of
TitleFacet; is not necessarily immutable.
String getTitle(ObjectAdapter contextAdapterIfAny, ObjectAdapter targetAdapter, org.apache.isis.applib.profiles.Localization localization)
String getIconName(ObjectAdapter object)
Corresponds to the IconFacet#iconName(ObjectAdapter)) icon name
returned by the IconFacet; is not necessarily immutable.
boolean isAbstract()
ObjectTitleContext createTitleInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter targetObjectAdapter)
InteractionContext representing an attempt to read the
object's title.ObjectValidityContext createValidityInteractionContext(DeploymentCategory deploymentCategory, AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter targetObjectAdapter)
InteractionContext representing an attempt to save the
object.deploymentCategory - TODOConsent isValid(ObjectAdapter adapter)
Consent.InteractionResult isValidResult(ObjectAdapter adapter)
InteractionResult.Persistability persistability()
Persistability.TRANSIENT ObjectAdapter.isPersistent() will
indicated whether the object is persistent or not. If they cannot be
persisted then ObjectAdapter. persistability() should be
ignored.boolean isNotCollection()
In effect, means that it doesn't have the CollectionFacet, and
therefore will return NOT isParentedOrFreeCollection()
#isCollection().boolean isParentedOrFreeCollection()
In effect, means has got CollectionFacet, and therefore will
return NOT isNotCollection().
isNotCollection()boolean isValue()
In effect, means has got ValueFacet.
boolean isParented()
In effect, means has got ParentedFacet.
boolean isValueOrIsParented()
isValue(),
isParented()boolean isParseable()
In effect, means has got a ParseableFacet.
boolean isEncodeable()
In effect, means has got EncodableFacet.
boolean isImmutable()
ImmutableFacet.boolean isHidden()
HiddenFacetObject createObject()
ObjectAdapter initialize(ObjectAdapter object)
boolean isService()
WARNING: this only returns true once the metamodel has been fully built, and a PersistenceSession has been opened. This should probably be improved upon; for now, beware...
void markAsService()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.