public class ExecutionContext extends Object
Modifier and Type | Class and Description |
---|---|
class |
ExecutionContext.DeclarationBuilder
Builder class for declaring a new proprety.
|
Constructor and Description |
---|
ExecutionContext() |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getProperties() |
Object |
getProperty(String key) |
boolean |
hasProperty(String key) |
void |
inheritFrom(ExecutionContext executionContext)
Inherit properties marked for inheritance from the given execution context.
|
ExecutionContext.DeclarationBuilder |
newProperty(String key) |
void |
removeProperty(String key) |
void |
setProperties(Map<String,Object> properties) |
void |
setProperty(String key,
Object value) |
public Object getProperty(String key)
key
- the key under which is stored the property to retrievepublic ExecutionContext.DeclarationBuilder newProperty(String key)
key
- the key of the property.public boolean hasProperty(String key)
key
- the key under which is stored the property to retrievetrue
if there is a property declared for the given key.public void removeProperty(String key)
key
- remove the property whose key matches the passed keypublic void setProperty(String key, Object value)
key
- the key under which to save the passed property valuevalue
- the value to setpublic void setProperties(Map<String,Object> properties)
properties
- the properties to add to the contextpublic void inheritFrom(ExecutionContext executionContext)
Inheritance is performed both in Execution.setContext(ExecutionContext)
and in
Execution.pushContext(ExecutionContext)
if there is a current execution context.
All properties marked as 'inherited' will be copied into this context, unless the property already is declared in this context.
It is an error if this context contain a value that was declared as 'inherited' and 'final' in the inherited execution context and an exception will be thrown.
executionContext
- The execution to inherit.IllegalStateException
- if the execution context cannot be inherited.Copyright © 2004–2017 XWiki. All rights reserved.