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 String
DEFAULT_PROPERTIES_FILE
The default properties file.static String
EXCEPTION_MESSAGE_KEY_DEFAULT_PROPERTIES_FILE_NOT_FOUND
static String
EXCEPTION_MESSAGE_KEY_LOAD_DEFAULT_PROPERTIES_FAILURE
static String
EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FAILURE
static String
EXCEPTION_MESSAGE_KEY_LOAD_PROPERTIES_FILE_FAILURE
protected ConcurrentHashMap<String,String>
properties
static 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 Properties
getDefaultProperties()
Sets the default properties.<T> List<T>
getExtensions(Class<T> extensionType)
Returns a list of extension objects for a specific extension type.static DefaultJasperReportsContext
getInstance()
String
getOwnProperty(String key)
Object
getOwnValue(String key)
Map<String,String>
getProperties()
String
getProperty(String key)
Returns the value of the property.protected static String
getSystemProperty(String propertyName)
Object
getValue(String key)
protected void
initProperties()
Loads the properties.protected void
loadSystemProperties()
protected void
loadSystemProperty(String sysKey, String propKey)
void
removeProperty(String key)
void
setProperty(String key, String value)
void
setValue(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:
getValue
in interfaceJasperReportsContext
-
getOwnValue
public Object getOwnValue(String key)
- Specified by:
getOwnValue
in interfaceJasperReportsContext
-
setValue
public void setValue(String key, Object value)
- Specified by:
setValue
in interfaceJasperReportsContext
-
getExtensions
public <T> List<T> getExtensions(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 String getProperty(String key)
Returns the value of the property.- Specified by:
getProperty
in interfaceJasperReportsContext
- Parameters:
key
- the key- Returns:
- the property value
-
getOwnProperty
public String getOwnProperty(String key)
- Specified by:
getOwnProperty
in interfaceJasperReportsContext
-
setProperty
public void setProperty(String key, String value)
- Specified by:
setProperty
in interfaceJasperReportsContext
-
removeProperty
public void removeProperty(String key)
- Specified by:
removeProperty
in interfaceJasperReportsContext
-
getProperties
public Map<String,String> getProperties()
- Specified by:
getProperties
in interfaceJasperReportsContext
-
-