Package org.apache.tapestry5.model
Interface MutableComponentModel
-
- All Superinterfaces:
ComponentModel
- All Known Implementing Classes:
MutableComponentModelImpl
public interface MutableComponentModel extends ComponentModel
Mutable version ofComponentModel
used during the transformation phase.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description MutableEmbeddedComponentModel
id, type, componentClassName, boolean inheritInformalParameters, Location location)
Defines a new embedded component.void
eventType)
Identifies that the component includes an event handler for the indicated event type.void
mixinClassName, ... order)
Adds a mixin to the component's implementation, optionally specifying ordering constraints, as per OrderedConfiguration.void
name, boolean required, boolean allowNull, defaultBindingPrefix)
Deprecated.void
name, boolean required, boolean allowNull, defaultBindingPrefix, boolean cached)
Adds a new formal parameter to the model.void
renderPhase)
Identifies that the component does handle the render phase.void
doHandleActivationEventContext()
Relevant for pages only, identifies that the component handleEventConstants.ACTIVATE
events supporting one of the three special case for catch all rules:[]
EventContext
void
enableSupportsInformalParameters()
Sets the internal flag to indicate that this model (and all models that extend from it) support informal parameters.fieldName, strategy)
Used to define the field persistence strategy for a particular field name.void
key, value)
Stores a meta data value under the indicated key.void
setMixinAfter(boolean mixinAfter)
Changes the value of the mixinAfter flag.-
Methods inherited from interface org.apache.tapestry5.model.ComponentModel
getBaseResource, getComponentClassName, getDeclaredParameterNames, getEmbeddedComponentIds, getEmbeddedComponentModel, getFieldPersistenceStrategy, getHandledRenderPhases, getLibraryName, getLogger, getMeta, getMixinClassNames, getOrderForMixin, getParameterModel, getParameterNames, getParentModel, getPersistentFieldNames, getSupportsInformalParameters, handleActivationEventContext, handlesEvent, isFormalParameter, isMixinAfter, isPage, isRootClass
-
-
-
-
Method Detail
-
addParameter
void name, boolean required, boolean allowNull, defaultBindingPrefix)
Deprecated.Adds a new formal parameter to the model. Each parameter has a unique name (though access to parameters is case insensitive).- Parameters:
name
- new, unique name for the parameterrequired
- if true, the parameter must be boundallowNull
- if true, then parameter may be bound to null, if false a null check will be addeddefaultBindingPrefix
- the default binding prefix for this parameter @throws IllegalArgumentException if a parameter with the given name has already been defined for this model- See Also:
Parameter
-
addParameter
void name, boolean required, boolean allowNull, defaultBindingPrefix, boolean cached)
Adds a new formal parameter to the model. Each parameter has a unique name (though access to parameters is case insensitive).- Parameters:
name
- new, unique name for the parameterrequired
- if true, the parameter must be boundallowNull
- if true, then parameter may be bound to null, if false a null check will be addeddefaultBindingPrefix
- the default binding prefix for this parameter @throws IllegalArgumentException if a parameter with the given name has already been defined for this modelcached
- if true, the parameter value should be cached within the component during rendering- Since:
- 5.2.0.0
- See Also:
Parameter
-
addEmbeddedComponent
id, type, componentClassName, boolean inheritInformalParameters, Location location)
Defines a new embedded component.- Parameters:
id
- the unique id for the embedded component, which must not already exist.type
- the type of the component (posslibly blank)componentClassName
- the fully qualified class name (derived from the field), used if the type is blankinheritInformalParameters
- if true, then the component will inherit informal parameters provided to its containerlocation
- where the component is defined @return a mutable model allowing parameters to be set
-
setFieldPersistenceStrategy
fieldName, strategy)
Used to define the field persistence strategy for a particular field name. Returns a logical name for the field, which is guaranteed to be unique (this is necessary for handling the case where a subclass has a persistent field with the same name as a persistent field from a super-class).- Parameters:
fieldName
- the name of the field which is to be made persistentstrategy
- the strategy for persisting the field, fromPersist.value()
. This value may be blank, in which case the stategy is inherited from the component, or the component's container.- Returns:
- a logical name for the field, to be used with
ComponentModel.getFieldPersistenceStrategy(String)
, and withInternalComponentResources.persistFieldChange(String, Object)
, etc.
-
addMixinClassName
void mixinClassName, ... order)
Adds a mixin to the component's implementation, optionally specifying ordering constraints, as per OrderedConfiguration.- Since:
- 5.2.0.0
-
enableSupportsInformalParameters
void enableSupportsInformalParameters()
Sets the internal flag to indicate that this model (and all models that extend from it) support informal parameters.
-
setMixinAfter
void setMixinAfter(boolean mixinAfter)
Changes the value of the mixinAfter flag. The default value is false.
-
setMeta
void key, value)
Stores a meta data value under the indicated key.
-
addRenderPhase
void renderPhase)
Identifies that the component does handle the render phase.- Parameters:
renderPhase
- annotation class corresponding to the render phase- Since:
- 5.0.19, 5.1.0.0
- See Also:
ComponentModel.getHandledRenderPhases()
-
addEventHandler
void eventType)
Identifies that the component includes an event handler for the indicated event type.- Parameters:
eventType
- of handled event- Since:
- 5.1.0.0
-
doHandleActivationEventContext
void doHandleActivationEventContext()
Relevant for pages only, identifies that the component handleEventConstants.ACTIVATE
events supporting one of the three special case for catch all rules:[]
EventContext
- Since:
- 5.4
-
-