Package net.sf.jasperreports.engine
Class DefaultJasperReportsContext
- java.lang.Object
-
- net.sf.jasperreports.engine.DefaultJasperReportsContext
-
- All Implemented Interfaces:
JasperReportsContext
public class DefaultJasperReportsContext extends Object implements JasperReportsContext
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_PROPERTIES_FILEThe default properties file.static StringEXCEPTION_MESSAGE_KEY_DEFAULT_PROPERTIES_FILE_NOT_FOUNDstatic StringEXCEPTION_MESSAGE_KEY_LOAD_DEFAULT_PROPERTIES_FAILUREstatic StringEXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FAILUREstatic StringEXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FILE_FAILUREprotected ConcurrentHashMap<String,String>propertiesstatic StringPROPERTIES_FILEThe name of the system property that specifies the properties file name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static PropertiesgetDefaultProperties()Sets the default properties.<T> List<T>getExtensions(Class<T> extensionType)Returns a list of extension objects for a specific extension type.static DefaultJasperReportsContextgetInstance()StringgetOwnProperty(String key)ObjectgetOwnValue(String key)Map<String,String>getProperties()StringgetProperty(String key)Returns the value of the property.protected static StringgetSystemProperty(String propertyName)ObjectgetValue(String key)protected voidinitProperties()Loads the properties.protected voidloadSystemProperties()protected voidloadSystemProperty(String sysKey, String propKey)voidremoveProperty(String key)voidsetProperty(String key, String value)voidsetValue(String key, Object value)
-
-
-
Field Detail
-
DEFAULT_PROPERTIES_FILE
public static final String DEFAULT_PROPERTIES_FILE
The default properties file.- See Also:
- Constant Field Values
-
PROPERTIES_FILE
public static final String PROPERTIES_FILE
The name of the system property that specifies the properties file name.- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_LOAD_DEFAULT_PROPERTIES_FAILURE
public static final String EXCEPTION_MESSAGE_KEY_LOAD_DEFAULT_PROPERTIES_FAILURE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FAILURE
public static final String EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FAILURE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FILE_FAILURE
public static final String EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FILE_FAILURE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_DEFAULT_PROPERTIES_FILE_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_DEFAULT_PROPERTIES_FILE_NOT_FOUND
- See Also:
- Constant Field Values
-
properties
protected volatile ConcurrentHashMap<String,String> properties
-
-
Method Detail
-
getInstance
public static DefaultJasperReportsContext getInstance()
-
initProperties
protected void initProperties()
Loads the properties.
-
loadSystemProperties
protected void loadSystemProperties()
-
getDefaultProperties
protected static Properties getDefaultProperties() throws JRException
Sets the default properties.- Returns:
- the default properties
- Throws:
JRException
-
getValue
public Object getValue(String key)
- Specified by:
getValuein interfaceJasperReportsContext
-
getOwnValue
public Object getOwnValue(String key)
- Specified by:
getOwnValuein interfaceJasperReportsContext
-
setValue
public void setValue(String key, Object value)
- Specified by:
setValuein interfaceJasperReportsContext
-
getExtensions
public <T> List<T> getExtensions(Class<T> extensionType)
Returns a list of extension objects for a specific extension type.- Specified by:
getExtensionsin interfaceJasperReportsContext- Type Parameters:
T- generic extension type- Parameters:
extensionType- the extension type- Returns:
- a list of extension objects
-
getProperty
public String getProperty(String key)
Returns the value of the property.- Specified by:
getPropertyin interfaceJasperReportsContext- Parameters:
key- the key- Returns:
- the property value
-
getOwnProperty
public String getOwnProperty(String key)
- Specified by:
getOwnPropertyin interfaceJasperReportsContext
-
setProperty
public void setProperty(String key, String value)
- Specified by:
setPropertyin interfaceJasperReportsContext
-
removeProperty
public void removeProperty(String key)
- Specified by:
removePropertyin interfaceJasperReportsContext
-
getProperties
public Map<String,String> getProperties()
- Specified by:
getPropertiesin interfaceJasperReportsContext
-
-