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.String
DEFAULT_PROPERTIES_FILE
The default properties file.static java.lang.String
EXCEPTION_MESSAGE_KEY_DEFAULT_PROPERTIES_FILE_NOT_FOUND
static java.lang.String
EXCEPTION_MESSAGE_KEY_LOAD_DEFAULT_PROPERTIES_FAILURE
static java.lang.String
EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FAILURE
static java.lang.String
EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FILE_FAILURE
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String>
properties
static java.lang.String
PROPERTIES_FILE
The 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.Properties
getDefaultProperties()
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 DefaultJasperReportsContext
getInstance()
java.lang.String
getOwnProperty(java.lang.String key)
java.lang.Object
getOwnValue(java.lang.String key)
java.util.Map<java.lang.String,java.lang.String>
getProperties()
java.lang.String
getProperty(java.lang.String key)
Returns the value of the property.protected static java.lang.String
getSystemProperty(java.lang.String propertyName)
java.lang.Object
getValue(java.lang.String key)
protected void
initProperties()
Loads the properties.protected void
loadSystemProperties()
protected void
loadSystemProperty(java.lang.String sysKey, java.lang.String propKey)
void
removeProperty(java.lang.String key)
void
setProperty(java.lang.String key, java.lang.String value)
void
setValue(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 JRException
Sets 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:
getValue
in interfaceJasperReportsContext
-
getOwnValue
public java.lang.Object getOwnValue(java.lang.String key)
- Specified by:
getOwnValue
in interfaceJasperReportsContext
-
setValue
public void setValue(java.lang.String key, java.lang.Object value)
- Specified by:
setValue
in 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:
getExtensions
in 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:
getProperty
in interfaceJasperReportsContext
- Parameters:
key
- the key- Returns:
- the property value
-
getOwnProperty
public java.lang.String getOwnProperty(java.lang.String key)
- Specified by:
getOwnProperty
in interfaceJasperReportsContext
-
setProperty
public void setProperty(java.lang.String key, java.lang.String value)
- Specified by:
setProperty
in interfaceJasperReportsContext
-
removeProperty
public void removeProperty(java.lang.String key)
- Specified by:
removeProperty
in interfaceJasperReportsContext
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
- Specified by:
getProperties
in interfaceJasperReportsContext
-
-