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