public interface MutableComponentModel extends ComponentModel
ComponentModel
used during the transformation phase.Modifier and Type | Method and Description |
---|---|
MutableEmbeddedComponentModel |
addEmbeddedComponent(String id,
String type,
String componentClassName,
boolean inheritInformalParameters,
Location location)
Defines a new embedded component.
|
void |
addEventHandler(String eventType)
Identifies that the component includes an event handler for the indicated event type.
|
void |
addMixinClassName(String mixinClassName,
String... order)
Adds a mixin to the component's implementation, optionally specifying ordering constraints, as per OrderedConfiguration.
|
void |
addParameter(String name,
boolean required,
boolean allowNull,
String defaultBindingPrefix)
Deprecated.
|
void |
addParameter(String name,
boolean required,
boolean allowNull,
String defaultBindingPrefix,
boolean cached)
Adds a new formal parameter to the model.
|
void |
addRenderPhase(Class renderPhase)
Identifies that the component does handle the render phase.
|
void |
doHandleActivationEventContext()
Relevant for pages only, identifies that the component handle
EventConstants.ACTIVATE
events supporting one of the three special case for catch all rules:
|
void |
enableSupportsInformalParameters()
Sets the internal flag to indicate that this model (and all models that extend from it) support informal
parameters.
|
String |
setFieldPersistenceStrategy(String fieldName,
String strategy)
Used to define the field persistence strategy for a particular field name.
|
void |
setMeta(String key,
String value)
Stores a meta data value under the indicated key.
|
void |
setMixinAfter(boolean mixinAfter)
Changes the value of the mixinAfter flag.
|
getBaseResource, getComponentClassName, getDeclaredParameterNames, getEmbeddedComponentIds, getEmbeddedComponentModel, getFieldPersistenceStrategy, getHandledRenderPhases, getLibraryName, getLogger, getMeta, getMixinClassNames, getOrderForMixin, getParameterModel, getParameterNames, getParentModel, getPersistentFieldNames, getSupportsInformalParameters, handleActivationEventContext, handlesEvent, isFormalParameter, isMixinAfter, isPage, isRootClass
void addParameter(String name, boolean required, boolean allowNull, String defaultBindingPrefix)
addParameter(String, boolean, boolean, String, boolean)
instead.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 modelParameter
void addParameter(String name, boolean required, boolean allowNull, String defaultBindingPrefix, boolean cached)
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 renderingParameter
MutableEmbeddedComponentModel addEmbeddedComponent(String id, String type, String componentClassName, boolean inheritInformalParameters, Location location)
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
setString setFieldPersistenceStrategy(String fieldName, String strategy)
fieldName
- the name of the field which is to be made persistentstrategy
- the strategy for persisting the field, from Persist.value()
. This value may be blank, in
which case the stategy is inherited from the component, or the component's container.ComponentModel.getFieldPersistenceStrategy(String)
,
and with InternalComponentResources.persistFieldChange(String, Object)
, etc.void addMixinClassName(String mixinClassName, String... order)
void enableSupportsInformalParameters()
void setMixinAfter(boolean mixinAfter)
void addRenderPhase(Class renderPhase)
renderPhase
- annotation class corresponding to the render phaseComponentModel.getHandledRenderPhases()
void addEventHandler(String eventType)
eventType
- of handled eventvoid doHandleActivationEventContext()
EventConstants.ACTIVATE
events supporting one of the three special case for catch all rules:
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.