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 void
copyTo(ViewItem item)
Copy the current view item in the given one.ViewElement
createInstance()
Create an instance ofViewItem
boolean
equals(Object obj)
boolean
equals(Object obj, boolean checkDetails)
Indicates whether some other object is "equal to" this one.ElementDefinition
getDefinition()
Retrieves the referenced model item definitionI18nizableText
getDescription()
Retrieves the description.I18nizableText
getLabel()
Retrieves the label.String
getName()
Get the name.int
hashCode()
void
setDefinition(ElementDefinition definition)
Sets the referenced model item definitionvoid
setDescription(I18nizableText description)
Set the description.void
setLabel(I18nizableText label)
Set the label.Map<String,Object>
toJSON(DefinitionContext context)
Converts the view item in a JSON mapvoid
toSAX(ContentHandler contentHandler, DefinitionContext context)
Generates SAX events for the view itemString
toString()
-
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:ModelViewItem
Retrieves the referenced model item definition- Specified by:
getDefinition
in interfaceModelViewItem<ElementDefinition>
- Returns:
- the referenced definition
-
setDefinition
public void setDefinition(ElementDefinition definition)
Description copied from interface:ModelViewItem
Sets the referenced model item definition- Specified by:
setDefinition
in interfaceModelViewItem<ElementDefinition>
- Parameters:
definition
- the referenced definition
-
setLabel
public void setLabel(I18nizableText label)
Description copied from interface:ModifiableLabelable
Set the label.- Specified by:
setLabel
in interfaceModifiableLabelable
- Parameters:
label
- the label.
-
setDescription
public void setDescription(I18nizableText description)
Description copied from interface:ModifiableLabelable
Set the description.- Specified by:
setDescription
in interfaceModifiableLabelable
- Parameters:
description
- the description.
-
getLabel
public I18nizableText getLabel()
Description copied from interface:Labelable
Retrieves the label.
-
getDescription
public I18nizableText getDescription()
Description copied from interface:Labelable
Retrieves the description.- Specified by:
getDescription
in interfaceLabelable
- Returns:
- the description.
-
toJSON
public Map<String,Object> toJSON(DefinitionContext context) throws ProcessingException
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
public void toSAX(ContentHandler contentHandler, DefinitionContext context) throws SAXException
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
public void copyTo(ViewItem item)
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
-
createInstance
public ViewElement createInstance()
Description copied from interface:ViewItem
Create an instance ofViewItem
- Specified by:
createInstance
in interfaceViewItem
- Returns:
- the created instance
-
equals
public boolean equals(Object obj, boolean checkDetails)
Description copied from interface:ViewItem
Indicates whether some other object is "equal to" this one.
-
-