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
,ViewItemAccessor
,ViewItemContainer
,ViewItemGroup
,Labelable
,ModifiableLabelable
public class ModelViewItemGroup
extends AbstractViewItemGroup
implements ModelViewItem<ModelItemGroup>
View reference to a group of model items
-
Field Summary
Fields inherited from class org.ametys.runtime.model.AbstractViewItemGroup
_children, _description, _label, _role
Fields inherited from interface org.ametys.runtime.model.ViewItemGroup
FIELDSET_ROLE, TAB_ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Copy the current view item in the given one.Create an instance ofViewItem
boolean
Retrieves the referenced model item definitionRetrieves the description.getLabel()
Retrieves the label.getName()
Get the name.Retrieves the parent of the view itemint
hashCode()
static ModelViewItemGroup
of
(ModelItemGroup modelItem) Creates aModelViewItemGroup
with the items of the givenModelItemGroup
static ModelViewItemGroup
of
(ModelItemGroup modelItem, String... itemPaths) Creates aModelViewItemGroup
with the given itemsvoid
setDefinition
(ModelItemGroup definition) Sets the referenced model item definitionvoid
setParent
(ViewItemAccessor parent) Sets the parent of the view itemtoJSON
(DefinitionContext context) Converts the view item in a JSON mapvoid
toSAX
(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, setRole
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.ModelViewItem
setName
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel
Methods inherited from interface org.ametys.runtime.model.ViewItemAccessor
addViewItems, getModelViewItem, getViewItem, hasModelViewItem, hasModelViewItem, hasModelViewItem
Methods inherited from interface org.ametys.runtime.model.ViewItemGroup
copyTo
-
Constructor Details
-
ModelViewItemGroup
public ModelViewItemGroup()
-
-
Method Details
-
of
Creates aModelViewItemGroup
with 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 aModelViewItemGroup
with 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 isnull
or 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:ModelViewItem
Retrieves the referenced model item definition- Specified by:
getDefinition
in interfaceModelViewItem<ModelItemGroup>
- Returns:
- the referenced definition
-
setDefinition
Description copied from interface:ModelViewItem
Sets the referenced model item definition- Specified by:
setDefinition
in interfaceModelViewItem<ModelItemGroup>
- Parameters:
definition
- the referenced definition
-
getParent
Description copied from interface:ViewItem
Retrieves the parent of the view item -
setParent
Description copied from interface:ViewItem
Sets the parent of the view item -
getName
Description copied from interface:Labelable
Get the name. -
getLabel
Description copied from interface:Labelable
Retrieves the label.- Specified by:
getLabel
in interfaceLabelable
- Overrides:
getLabel
in classAbstractViewItemGroup
- Returns:
- the label.
-
getDescription
Description copied from interface:Labelable
Retrieves the description.- Specified by:
getDescription
in interfaceLabelable
- Overrides:
getDescription
in classAbstractViewItemGroup
- Returns:
- the description.
-
toJSON
Description copied from interface:ViewItem
Converts the view item in a JSON map- Specified by:
toJSON
in 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
-
toSAX
Description copied from interface:ViewItem
Generates SAX events for the view item- Specified by:
toSAX
in interfaceViewItem
- Parameters:
contentHandler
- theContentHandler
that 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:ViewItem
Copy the current view item in the given one. If the view item is an accessor, its view items are not copied- Specified by:
copyTo
in interfaceViewItem
- Overrides:
copyTo
in classAbstractViewItemGroup
- Parameters:
item
- the copy
-
createInstance
Description copied from interface:ViewItem
Create an instance ofViewItem
- Specified by:
createInstance
in interfaceViewItem
- Returns:
- the created instance
-
hashCode
- Overrides:
hashCode
in classAbstractViewItemGroup
-
equals
- Overrides:
equals
in classAbstractViewItemGroup
-
toString
-