Package org.ametys.runtime.model
Interface ModelItem
-
- All Superinterfaces:
Comparable<ModelItem>
,Labelable
,ModifiableLabelable
- All Known Subinterfaces:
RestrictedModelItem<T>
- All Known Implementing Classes:
AbstractModelItem
,AttributeDefinition
,CompositeDefinition
,ContentAttributeDefinition
,ContentRestrictedCompositeDefinition
,ContentRestrictedRepeaterDefinition
,ElementDefinition
,ModelItemGroup
,RepeaterDefinition
,RichTextAttributeDefinition
,ServiceParameter
,ViewParameter
public interface ModelItem extends ModifiableLabelable, Comparable<ModelItem>
Interface for model items
-
-
Field Summary
Fields Modifier and Type Field Description static String
ITEM_PATH_SEPARATOR
Separator used for item paths in definitions
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addItemChecker(ItemCheckerDescriptor itemChecker)
Add an item checker to the groupDisableConditions
getDisableConditions()
Retrieves the disable condition.Set<ItemCheckerDescriptor>
getItemCheckers()
Returns theItemCheckerDescriptor
s associated with this group.Model
getModel()
Retrieves the model of the itemModelItemGroup
getParent()
Retrieves the parent of the itemString
getPath()
Retrieves the path of the model itemString
getPluginName()
Retrieves the name of the plugin declaring this element.ModelItemType
getType()
Retrieves the type.String
getWidget()
Retrieves the widget to use for rendering.Map<String,I18nizableText>
getWidgetParameters()
Get the widget's parametersvoid
setDisableConditions(DisableConditions disableConditions)
Sets the disable condition.void
setModel(Model model)
Sets the model of the elementvoid
setParent(ModelItemGroup parent)
Sets the parent of the itemvoid
setPluginName(String pluginName)
Set the name of the plugin declaring this element.void
setType(ModelItemType type)
Set the type.void
setWidget(String widget)
Set the widget.void
setWidgetParameters(Map<String,I18nizableText> params)
Set the widget's parametersMap<String,Object>
toJSON(DefinitionContext context)
Converts the model item in a JSON mapvoid
toSAX(ContentHandler contentHandler, DefinitionContext context)
Generates SAX events for the model item-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getName
-
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
-
-
-
Field Detail
-
ITEM_PATH_SEPARATOR
static final String ITEM_PATH_SEPARATOR
Separator used for item paths in definitions- See Also:
- Constant Field Values
-
-
Method Detail
-
getItemCheckers
Set<ItemCheckerDescriptor> getItemCheckers()
Returns theItemCheckerDescriptor
s associated with this group.- Returns:
- the
ItemCheckerDescriptor
s associated with this group.
-
addItemChecker
void addItemChecker(ItemCheckerDescriptor itemChecker)
Add an item checker to the group- Parameters:
itemChecker
- the item checker to add
-
setModel
void setModel(Model model)
Sets the model of the element- Parameters:
model
- the model to set
-
getParent
ModelItemGroup getParent()
Retrieves the parent of the item- Returns:
- the parent group
-
setParent
void setParent(ModelItemGroup parent)
Sets the parent of the item- Parameters:
parent
- the parent to set
-
toJSON
Map<String,Object> toJSON(DefinitionContext context) throws ProcessingException
Converts the model item in a JSON map- Parameters:
context
- the context of the definition- Returns:
- The model item as a JSON map, or an empty map
- Throws:
ProcessingException
- If an error occurs when converting the model item
-
toSAX
void toSAX(ContentHandler contentHandler, DefinitionContext context) throws SAXException
Generates SAX events for the model item- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventscontext
- the context of the definition- Throws:
SAXException
- if an error occurs during the SAX events generation
-
getType
ModelItemType getType()
Retrieves the type.- Returns:
- the type.
-
setType
void setType(ModelItemType type)
Set the type.- Parameters:
type
- the type.
-
getPluginName
String getPluginName()
Retrieves the name of the plugin declaring this element.- Returns:
- the plugin name.
-
setPluginName
void setPluginName(String pluginName)
Set the name of the plugin declaring this element.- Parameters:
pluginName
- the plugin name.
-
getWidget
String getWidget()
Retrieves the widget to use for rendering.- Returns:
- the widget or
null
if none is defined.
-
getWidgetParameters
Map<String,I18nizableText> getWidgetParameters()
Get the widget's parameters- Returns:
- the widget's parameters
-
setWidgetParameters
void setWidgetParameters(Map<String,I18nizableText> params)
Set the widget's parameters- Parameters:
params
- the parameters to set
-
getDisableConditions
DisableConditions getDisableConditions()
Retrieves the disable condition.- Returns:
- the disable condition or
null
if none is defined.
-
setDisableConditions
void setDisableConditions(DisableConditions disableConditions)
Sets the disable condition.- Parameters:
disableConditions
- the disable condition.
-
-