Package org.ametys.runtime.model
Class ModelViewItemGroup
- java.lang.Object
-
- org.ametys.runtime.model.AbstractViewItemGroup
-
- org.ametys.runtime.model.ModelViewItemGroup
-
- All Implemented Interfaces:
ModelViewItem<ModelItemGroup>,ViewItem,ViewItemContainer,ViewItemGroup
public class ModelViewItemGroup extends AbstractViewItemGroup implements ModelViewItem<ModelItemGroup>
View reference to a group of model items
-
-
Field Summary
Fields Modifier and Type Field Description private ModelItemGroup_definition-
Fields inherited from class org.ametys.runtime.model.AbstractViewItemGroup
_children, _role
-
Fields inherited from interface org.ametys.runtime.model.ViewItemGroup
FIELDSET_ROLE, TAB_ROLE
-
-
Constructor Summary
Constructors Constructor Description ModelViewItemGroup()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<ViewItem>_getChildrenForJSON()ModelItemGroupgetDefinition()Retrieves the referenced model item definitionStringgetName()Retrieves the name of the view itemstatic ModelViewItemGroupof(ModelItemGroup modelItem)Creates aModelViewItemGroupwith the items of the givenModelItemGroupstatic ModelViewItemGroupof(ModelItemGroup modelItem, String... itemPaths)Creates aModelViewItemGroupwith the given itemsvoidsetDefinition(ModelItemGroup definition)Sets the referenced model item definitionMap<String,Object>toJSON()Converts the view item in a JSON map-
Methods inherited from class org.ametys.runtime.model.AbstractViewItemGroup
addViewItem, getRole, getViewItems, insertViewItem, setRole
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.runtime.model.ViewItemContainer
getModelViewItem, hasModelViewItem
-
-
-
-
Field Detail
-
_definition
private ModelItemGroup _definition
-
-
Constructor Detail
-
ModelViewItemGroup
public ModelViewItemGroup()
-
-
Method Detail
-
of
public static ModelViewItemGroup of(ModelItemGroup modelItem) throws IllegalArgumentException
Creates aModelViewItemGroupwith the items of the givenModelItemGroup- Parameters:
modelItem- the model item group- Returns:
- the created
ModelViewItemGroup - Throws:
IllegalArgumentException- if the model item isnull
-
of
public static ModelViewItemGroup of(ModelItemGroup modelItem, String... itemPaths) throws IllegalArgumentException, BadItemTypeException
Creates aModelViewItemGroupwith the given items- Parameters:
modelItem- the model item containing items definitionsitemPaths- the paths of the items to put in the view item- Returns:
- the created
ModelViewItemGroup - Throws:
IllegalArgumentException- if the model item isnullor if an item path isnull, empty, or is not defined in the given model itemsBadItemTypeException- if a segment in a path (but not the last) does not represent a group item
-
getDefinition
public ModelItemGroup getDefinition()
Description copied from interface:ModelViewItemRetrieves the referenced model item definition- Specified by:
getDefinitionin interfaceModelViewItem<ModelItemGroup>- Returns:
- the referenced definition
-
setDefinition
public void setDefinition(ModelItemGroup definition)
Description copied from interface:ModelViewItemSets the referenced model item definition- Specified by:
setDefinitionin interfaceModelViewItem<ModelItemGroup>- Parameters:
definition- the referenced definition
-
getName
public String getName()
Description copied from interface:ViewItemRetrieves the name of the view item
-
toJSON
public Map<String,Object> toJSON() throws ProcessingException
Description copied from interface:ViewItemConverts the view item in a JSON map- Specified by:
toJSONin interfaceViewItem- Returns:
- The view item as a JSON map
- Throws:
ProcessingException- If an error occurs when converting the view item
-
_getChildrenForJSON
private List<ViewItem> _getChildrenForJSON()
-
-