Package org.ametys.runtime.model
Class ViewElement
- java.lang.Object
-
- org.ametys.runtime.model.ViewElement
-
- All Implemented Interfaces:
ModelViewItem<ElementDefinition>,ViewItem,Labelable,ModifiableLabelable
- Direct Known Subclasses:
CompareView.CompareViewElement,ViewElementAccessor
public class ViewElement extends Object implements ModelViewItem<ElementDefinition>
View reference to an element definition
-
-
Field Summary
Fields Modifier and Type Field Description private ElementDefinition_definitionprivate I18nizableText_descriptionprivate I18nizableText_label
-
Constructor Summary
Constructors Constructor Description ViewElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyTo(ViewItem item)Copy the current view item in the given one.ViewElementcreateInstance()Create an instance ofViewItembooleanequals(Object obj)booleanequals(Object obj, boolean checkDetails)Indicates whether some other object is "equal to" this one.ElementDefinitiongetDefinition()Retrieves the referenced model item definitionI18nizableTextgetDescription()Retrieves the description.I18nizableTextgetLabel()Retrieves the label.StringgetName()Get the name.inthashCode()voidsetDefinition(ElementDefinition definition)Sets the referenced model item definitionvoidsetDescription(I18nizableText description)Set the description.voidsetLabel(I18nizableText label)Set the label.Map<String,Object>toJSON(DefinitionContext context)Converts the view item in a JSON map-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.runtime.model.ModelViewItem
setName
-
-
-
-
Field Detail
-
_definition
private ElementDefinition _definition
-
_label
private I18nizableText _label
-
_description
private I18nizableText _description
-
-
Constructor Detail
-
ViewElement
public ViewElement()
-
-
Method Detail
-
getDefinition
public ElementDefinition getDefinition()
Description copied from interface:ModelViewItemRetrieves the referenced model item definition- Specified by:
getDefinitionin interfaceModelViewItem<ElementDefinition>- Returns:
- the referenced definition
-
setDefinition
public void setDefinition(ElementDefinition definition)
Description copied from interface:ModelViewItemSets the referenced model item definition- Specified by:
setDefinitionin interfaceModelViewItem<ElementDefinition>- Parameters:
definition- the referenced definition
-
setLabel
public void setLabel(I18nizableText label)
Description copied from interface:ModifiableLabelableSet the label.- Specified by:
setLabelin interfaceModifiableLabelable- Parameters:
label- the label.
-
setDescription
public void setDescription(I18nizableText description)
Description copied from interface:ModifiableLabelableSet the description.- Specified by:
setDescriptionin interfaceModifiableLabelable- Parameters:
description- the description.
-
getLabel
public I18nizableText getLabel()
Description copied from interface:LabelableRetrieves the label.
-
getDescription
public I18nizableText getDescription()
Description copied from interface:LabelableRetrieves the description.- Specified by:
getDescriptionin interfaceLabelable- Returns:
- the description.
-
toJSON
public Map<String,Object> toJSON(DefinitionContext context) throws ProcessingException
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
-
copyTo
public void copyTo(ViewItem item)
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
-
createInstance
public ViewElement createInstance()
Description copied from interface:ViewItemCreate an instance ofViewItem- Specified by:
createInstancein interfaceViewItem- Returns:
- the created instance
-
-