public abstract class ObjectActionParameterAbstract extends Object implements ObjectActionParameter
ObjectActionParameter.Filters| Modifier | Constructor and Description |
|---|---|
protected |
ObjectActionParameterAbstract(int number,
ObjectActionImpl objectAction,
TypedHolder peer) |
| Modifier and Type | Method and Description |
|---|---|
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. |
protected List<ObjectAdapter> |
argsForDefaultOrChoices(ObjectAdapter adapter,
List<ObjectAdapter> argumentsIfAvailable)
Hook method;
contributed action parameters override. |
boolean |
containsDoOpFacet(Class<? extends Facet> facetType)
Whether there is a facet registered of the specified type that is not a
no-op. |
boolean |
containsFacet(Class<? extends Facet> facetType)
Whether there is a facet registered of the specified type.
|
ActionArgumentContext |
createProposedArgumentInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter targetObject,
ObjectAdapter[] proposedArguments,
int position) |
protected ObjectAdapter |
doCoerceProposedValue(ObjectAdapter adapter,
Object proposedValue,
org.apache.isis.applib.profiles.Localization localization)
Optional hook for parsing.
|
ObjectAction |
getAction()
Owning
ObjectAction. |
protected AdapterManager |
getAdapterMap() |
protected AuthenticationSession |
getAuthenticationSession() |
protected AuthenticationSessionProvider |
getAuthenticationSessionProvider() |
ObjectAdapter[] |
getAutoComplete(ObjectAdapter adapter,
String searchArg)
Returns a list of possible references/values for this parameter, which the
user can choose from, based on the input search argument.
|
int |
getAutoCompleteMinLength() |
ObjectAdapter[] |
getChoices(ObjectAdapter adapter,
ObjectAdapter[] argumentsIfAvailable)
Returns a list of possible references/values for this parameter, which the
user can choose from.
|
ObjectAdapter |
getDefault(ObjectAdapter adapter) |
String |
getDescription()
Returns a description of how the member is used - this complements the
help text.
|
<T extends Facet> |
getFacet(Class<T> cls)
Get the facet of the specified type (as per the type it reports from
Facet.facetType()). |
List<Facet> |
getFacets(org.apache.isis.applib.filter.Filter<Facet> filter)
Returns all
Facets matching the specified FacetFilter. |
Class<? extends Facet>[] |
getFacetTypes()
Get the list of all facet types that are supported by objects of
this specification.
|
String |
getId()
Returns the identifier of the member, which must not change.
|
org.apache.isis.applib.Identifier |
getIdentifier()
Identifier of this feature.
|
String |
getName()
Returns the name of this parameter.
|
int |
getNumber()
Parameter number, 0-based.
|
TypedHolder |
getPeer()
NOT API, but exposed for the benefit of
ObjectActionParameterContributee. |
protected QuerySubmitter |
getQuerySubmitter() |
ObjectSpecification |
getSpecification()
The specification of the underlying type.
|
protected SpecificationLoader |
getSpecificationLookup() |
boolean |
hasAutoComplete()
Whether there is an autoComplete provided (eg autoCompleteXxx supporting
method) for the parameter.
|
boolean |
hasChoices()
Whether there are any choices provided (eg choicesXxx supporting
method) for the parameter.
|
boolean |
isCollection()
Subclasses should override either
isObject() or
isCollection(). |
boolean |
isObject()
Subclasses should override either
isObject() or
isCollection(). |
boolean |
isOptional()
Returns a flag indicating if it can be left unset when the action can be
invoked.
|
Consent |
isUsable() |
String |
isValid(ObjectAdapter adapter,
Object proposedValue,
org.apache.isis.applib.profiles.Localization localization)
Whether proposed value for this parameter is valid.
|
void |
removeFacet(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()
. |
protected ObjectAdapter |
targetForDefaultOrChoices(ObjectAdapter adapter,
List<ObjectAdapter> argumentsIfAvailable)
Hook method;
contributed action parameters override. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFeatureType, getInstancegetprotected ObjectActionParameterAbstract(int number, ObjectActionImpl objectAction, TypedHolder peer)
public boolean isObject()
isObject() or
isCollection().isObject in interface ObjectActionParameterpublic boolean isCollection()
isObject() or
isCollection().isCollection in interface ObjectActionParameterpublic int getNumber()
getNumber in interface ObjectActionParameterpublic ObjectAction getAction()
ObjectActionParameterObjectAction.getAction in interface ObjectActionParameterpublic TypedHolder getPeer()
ObjectActionParameterContributee.public ObjectSpecification getSpecification()
ObjectFeatureFor example:
property, will return the
ObjectSpecification of the type that the accessor returns.
collection it will be the type of
element the collection holds (not the type of collection).
action, will always return null.
See instead ObjectAction.getReturnType() and
ObjectAction.getParameterTypes().
action, will return the type of
the parameter}.
getSpecification in interface ObjectFeaturepublic org.apache.isis.applib.Identifier getIdentifier()
IdentifiedHoldergetIdentifier in interface IdentifiedHolderpublic String getId()
ObjectFeaturegetId in interface ObjectFeaturepublic String getName()
ObjectActionParameterBecause Java's reflection API does not allow us to access the code name of the parameter, we have to do figure out the name of the parameter ourselves:
NamedFacet associated with this parameter then
we infer a name from this, eg "First Name" becomes "firstName".
getName in interface ObjectActionParametergetName in interface ObjectFeatureIdentifiedHolder.getIdentifier()public String getDescription()
ObjectFeaturegetDescription in interface ObjectFeaturegetDescription in interface Specification#getHelp()public boolean isOptional()
ObjectActionParameterisOptional in interface ObjectActionParameterpublic boolean containsFacet(Class<? extends Facet> facetType)
FacetHoldercontainsFacet in interface FacetHolderpublic boolean containsDoOpFacet(Class<? extends Facet> facetType)
FacetHolderno-op.
Convenience; saves having to FacetHolder.getFacet(Class) and then check if
null and not a no-op.
containsDoOpFacet in interface FacetHolderpublic <T extends Facet> T getFacet(Class<T> cls)
FacetHolderFacet.facetType()).getFacet in interface FacetHolderpublic Class<? extends Facet>[] getFacetTypes()
FacetHoldergetFacetTypes in interface FacetHolderpublic List<Facet> getFacets(org.apache.isis.applib.filter.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(Class<? extends Facet> facetType)
FacetHolderremoveFacet in interface FacetHolderpublic boolean hasAutoComplete()
ObjectActionParameterhasAutoComplete in interface ObjectActionParameterpublic ObjectAdapter[] getAutoComplete(ObjectAdapter adapter, String searchArg)
ObjectActionParametergetAutoComplete in interface ObjectActionParameterpublic int getAutoCompleteMinLength()
getAutoCompleteMinLength in interface ObjectActionParameterpublic boolean hasChoices()
ObjectActionParameterhasChoices in interface ObjectActionParameterpublic ObjectAdapter[] getChoices(ObjectAdapter adapter, ObjectAdapter[] argumentsIfAvailable)
ObjectActionParametergetChoices in interface ObjectActionParameterpublic ObjectAdapter getDefault(ObjectAdapter adapter)
getDefault in interface ObjectActionParameterprotected ObjectAdapter targetForDefaultOrChoices(ObjectAdapter adapter, List<ObjectAdapter> argumentsIfAvailable)
contributed action parameters override.protected List<ObjectAdapter> argsForDefaultOrChoices(ObjectAdapter adapter, List<ObjectAdapter> argumentsIfAvailable)
contributed action parameters override.public ActionArgumentContext createProposedArgumentInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter targetObject, ObjectAdapter[] proposedArguments, int position)
createProposedArgumentInteractionContext in interface ObjectActionParameterpublic String isValid(ObjectAdapter adapter, Object proposedValue, org.apache.isis.applib.profiles.Localization localization)
ObjectActionParameterisValid in interface ObjectActionParameterprotected ObjectAdapter doCoerceProposedValue(ObjectAdapter adapter, Object proposedValue, org.apache.isis.applib.profiles.Localization localization)
protected SpecificationLoader getSpecificationLookup()
protected AuthenticationSessionProvider getAuthenticationSessionProvider()
protected AdapterManager getAdapterMap()
protected QuerySubmitter getQuerySubmitter()
protected AuthenticationSession getAuthenticationSession()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.