public class BaseContext extends Object implements IContext
IContext interface.| Constructor and Description |
|---|
BaseContext()
Creates an empty context.
|
BaseContext(Map<String,Object> properties)
Creates a BaseContext object and copy a map of properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearAnnotations()
Removes all annotations from this context.
|
void |
clearProperties()
Removes all properties from this context.
|
<A extends IAnnotation> |
getAnnotation(Class<A> type)
Gets the annotation of a given type for this context.
|
boolean |
getBoolean(String name)
Gets a boolean property of this context.
|
int |
getInteger(String name)
Gets an integer property of this context.
|
Object |
getObject(String name)
Gets an object property of this context.
|
Map<String,Object> |
getProperties()
Gets the map of the existing properties for this context.
|
String |
getString(String name)
Gets a string property of this context.
|
void |
removeProperty(String name)
Removes a given property from this context.
|
void |
setAnnotation(IAnnotation annotation)
Sets an annotation for this context.
|
void |
setBoolean(String name,
boolean value)
Sets a boolean property for this context.
|
void |
setInteger(String name,
int value)
Sets an integer property for this context.
|
void |
setObject(String name,
Object value)
Sets an object property for this context.
|
void |
setString(String name,
String value)
Sets a string property for this context.
|
public String getString(String name)
IContextpublic void setString(String name, String value)
IContextpublic boolean getBoolean(String name)
IContextgetBoolean in interface IContextname - the name of the property to retrieve.public void setBoolean(String name, boolean value)
IContextsetBoolean in interface IContextname - the name of the property to set.value - the value to set.public int getInteger(String name)
IContextgetInteger in interface IContextname - the name of the property to retrieve.public void setInteger(String name, int value)
IContextsetInteger in interface IContextname - the name of the property to set.value - the value to set.public Object getObject(String name)
IContextpublic void setObject(String name, Object value)
IContextpublic void removeProperty(String name)
IContextremoveProperty in interface IContextname - the name of the property to remove.public Map<String,Object> getProperties()
IContextgetProperties in interface IContextpublic void clearProperties()
IContextclearProperties in interface IContextpublic <A extends IAnnotation> A getAnnotation(Class<A> type)
IContextgetAnnotation in interface IContextA - the class type.type - the type of the annotation to retrieve.public void setAnnotation(IAnnotation annotation)
IContextsetAnnotation in interface IContextannotation - the annotation to set. If one of this type
already exists it will be overwritten.public void clearAnnotations()
IContextclearAnnotations in interface IContextCopyright © 2021. All rights reserved.