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:
ViewElementAccessor
public class ViewElement extends Object implements ModelViewItem<ElementDefinition>
View reference to an element definition
-
-
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 mapvoidtoSAX(ContentHandler contentHandler, DefinitionContext context)Generates SAX events for the view itemStringtoString()-
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
-
-
-
-
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
-
toSAX
public void toSAX(ContentHandler contentHandler, DefinitionContext context) throws SAXException
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
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
-
equals
public boolean equals(Object obj, boolean checkDetails)
Description copied from interface:ViewItemIndicates whether some other object is "equal to" this one.
-
-