Package org.ametys.runtime.model
Class DefinitionContext
java.lang.Object
org.ametys.runtime.model.DefinitionContext
Object that gives some context for definitions manipulation
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of aDefinitionContext
, with the current context valuesRetrieves the tag name to use while generating SAX eventsRetrieves the model itemRetrieves the context object for the definitiongetView()
Retrieves the viewboolean
Checks if the context is in editionstatic DefinitionContext
Creates a new instance of aDefinitionContext
static DefinitionContext
newInstance
(DefinitionContext context) Creates a new instance of aDefinitionContext
from anotherDefinitionContext
.withEdition
(boolean isEdition) Set totrue
if the context is in edition (default tofalse
)withItemTagName
(String itemTagName) Set the tag name to use while generating SAX eventswithModelItem
(ModelItem modelItem) Sets the model itemwithObject
(Object object) Set the context objectSet the view
-
Method Details
-
newInstance
Creates a new instance of aDefinitionContext
- Returns:
- the created instance
-
newInstance
Creates a new instance of aDefinitionContext
from anotherDefinitionContext
.- Parameters:
context
- the definition context to copy- Returns:
- the created instance
-
cloneContext
Creates a new instance of aDefinitionContext
, with the current context values- Returns:
- the created instance
-
getObject
Retrieves the context object for the definition- Returns:
- the context object
-
withObject
Set the context object- Parameters:
object
- the context object to set- Returns:
- the current
DefinitionContext
-
isEdition
Checks if the context is in edition- Returns:
true
if the context is in edition,false
otherwise
-
withEdition
Set totrue
if the context is in edition (default tofalse
)- Parameters:
isEdition
-true
if the context is in edition,false
otherwise- Returns:
- the current
DefinitionContext
-
getItemTagName
Retrieves the tag name to use while generating SAX events- Returns:
- the tag name to use while generating SAX events
-
withItemTagName
Set the tag name to use while generating SAX events- Parameters:
itemTagName
- the tag name to set- Returns:
- the current
DefinitionContext
-
getModelItem
Retrieves the model item- Returns:
- the model item
-
withModelItem
Sets the model item- Parameters:
modelItem
- the model item to set- Returns:
- the current
DefinitionContext
-
getView
Retrieves the view- Returns:
- the view
-
withView
Set the view- Parameters:
view
- the view to set- Returns:
- the current
DefinitionContext
-