Package org.ametys.runtime.model
Class ModelViewItemGroup<T extends ModelItemGroup>
java.lang.Object
org.ametys.runtime.model.AbstractViewItemGroup
org.ametys.runtime.model.ModelViewItemGroup<T>
- Type Parameters:
T- type of the referenced model item group
- All Implemented Interfaces:
ModelViewItem<T>,ViewItem,ViewItemAccessor,ViewItemContainer,ViewItemGroup,Labelable,ModifiableLabelable
- Direct Known Subclasses:
RepeaterSearchUIColumn
public class ModelViewItemGroup<T extends ModelItemGroup>
extends AbstractViewItemGroup
implements ModelViewItem<T>
View reference to a group of model items
-
Field Summary
Fields inherited from class org.ametys.runtime.model.AbstractViewItemGroup
_children, _description, _label, _roleFields inherited from interface org.ametys.runtime.model.ViewItemGroup
FIELDSET_ROLE, TAB_ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_childrenToJSON(DefinitionContext context) Converts the group's children in a JSON mapvoidCopy the current view item in the given one.Create an instance ofViewItembooleanRetrieves the referenced model item definitionRetrieves the description.getLabel()Retrieves the label.getName()Get the name.Retrieves the parent of the view iteminthashCode()static ModelViewItemGroupof(ModelItemGroup modelItem) Creates aModelViewItemGroupwith the items of the givenModelItemGroupstatic ModelViewItemGroupof(ModelItemGroup modelItem, String... itemPaths) Creates aModelViewItemGroupwith the given itemsvoidsetDefinition(T definition) Sets the referenced model item definitionvoidsetParent(ViewItemAccessor parent) Sets the parent of the view itemtoJSON(DefinitionContext context) Converts the view item in a JSON mapvoidtoSAX(ContentHandler contentHandler, DefinitionContext context) Generates SAX events for the view itemtoString()Methods inherited from class org.ametys.runtime.model.AbstractViewItemGroup
addViewItem, clear, equals, getRole, getViewItems, insertViewItem, removeViewItem, setDescription, setLabel, setRoleMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.ModelViewItem
setNameMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabelMethods inherited from interface org.ametys.runtime.model.ViewItemAccessor
addViewItems, getModelViewItem, getViewItem, hasModelViewItem, hasModelViewItem, hasModelViewItemMethods inherited from interface org.ametys.runtime.model.ViewItemGroup
copyTo
-
Constructor Details
-
ModelViewItemGroup
public ModelViewItemGroup()
-
-
Method Details
-
of
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
Description copied from interface:ModelViewItemRetrieves the referenced model item definition- Specified by:
getDefinitionin interfaceModelViewItem<T extends ModelItemGroup>- Returns:
- the referenced definition
-
setDefinition
Description copied from interface:ModelViewItemSets the referenced model item definition- Specified by:
setDefinitionin interfaceModelViewItem<T extends ModelItemGroup>- Parameters:
definition- the referenced definition
-
getParent
Description copied from interface:ViewItemRetrieves the parent of the view item -
setParent
Description copied from interface:ViewItemSets the parent of the view item -
getName
Description copied from interface:LabelableGet the name. -
getLabel
Description copied from interface:LabelableRetrieves the label.- Specified by:
getLabelin interfaceLabelable- Overrides:
getLabelin classAbstractViewItemGroup- Returns:
- the label.
-
getDescription
Description copied from interface:LabelableRetrieves the description.- Specified by:
getDescriptionin interfaceLabelable- Overrides:
getDescriptionin classAbstractViewItemGroup- Returns:
- the description.
-
toJSON
Description copied from interface:ViewItemConverts the view item in a JSON map- Specified by:
toJSONin interfaceViewItem- Parameters:
context- the context of the definitions referenced in this view item and/or its children- Returns:
- The view item as a JSON map
- Throws:
ProcessingException- If an error occurs when converting the view item
-
_childrenToJSON
Converts the group's children in a JSON map- Parameters:
context- the context of the definitions referenced in this group and/or the children- Returns:
- The children as a JSON map
- Throws:
ProcessingException- If an error occurs when converting the children
-
toSAX
Description copied from interface:ViewItemGenerates SAX events for the view item- Specified by:
toSAXin interfaceViewItem- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventscontext- the context of the definitions included in the view item- Throws:
SAXException- if an error occurs during the SAX events generation
-
copyTo
Description copied from interface:ViewItemCopy the current view item in the given one. If the view item is an accessor, its view items are not copied- Specified by:
copyToin interfaceViewItem- Overrides:
copyToin classAbstractViewItemGroup- Parameters:
item- the copy
-
createInstance
Description copied from interface:ViewItemCreate an instance ofViewItem- Specified by:
createInstancein interfaceViewItem- Returns:
- the created instance
-
hashCode
- Overrides:
hashCodein classAbstractViewItemGroup
-
equals
- Overrides:
equalsin classAbstractViewItemGroup
-
toString
-