| java.lang.Object net.sf.jasperreports.engine.util.JRProperties
JRProperties | public class JRProperties (Code) | | Class that provides static methods for loading, getting and setting properties.
The following actions are performed:
- The default (hardcoded) properties are set.
- If the system property "net.sf.jasperreports.properties" has been set
then the specified proprties file is loaded.
- Otherwise "jasperreports.properties" is loaded if found in the classpath.
- For backward compatibility, system properties like "jasper.reports.compile.xml.validation"
are checked and their values are used. This way of specifying properties is deprecated.
author: Lucian Chirita (lucianc@users.sourceforge.net) version: $Id: JRProperties.java 1828 2007-08-24 13:58:43Z teodord $ |
Inner Class :public static class PropertySuffix | |
Method Summary | |
public static boolean | asBoolean(String value) Converts a String value into a boolean . | public static int | asInteger(String value) Converts a String value into a int . | public static long | asLong(String value) Converts a String value into a long . | public static void | backupProperties() Saves a copy of the current properties. | public static boolean | getBooleanProperty(String key) Returns a property as a boolean value. | public static boolean | getBooleanProperty(JRPropertiesMap propertiesMap, String key, boolean defaultValue) Returns the value of a property as a boolean, looking first in the supplied properties map
and then in the system properties. | protected static Properties | getDefaults() Sets the default properties. | public static int | getIntegerProperty(String key) Returns a property as an integer value. | public static int | getIntegerProperty(JRPropertiesMap propertiesMap, String key, int defaultValue) Returns the value of a property as an integer, looking first in the supplied properties map
and then in the system properties. | public static int | getIntegerProperty(String key, int defaultValue) Returns the value of a property as an integer. | public static long | getLongProperty(String key) Returns a property as a long value. | public static long | getLongProperty(JRPropertiesMap propertiesMap, String key, int defaultValue) Returns the value of a property as a long, looking first in the supplied properties map
and then in the system properties. | public static List | getProperties(String prefix) Returns the list of all properties for a key prefix. | public static List | getProperties(JRPropertiesMap propertiesMap, String prefix) Returns the list of all properties for a key prefix. | public static String | getProperty(String key) Returns the value of the property. | public static String | getProperty(JRPropertiesMap propertiesMap, String key) Returns the value of a property, looking first in the supplied properties map
and then in the system properties. | protected static String | getSystemProperty(String propertyName) | protected static void | initProperties() Loads the properties. | public static Properties | loadProperties(String name, Properties defaults) Loads a properties file from the classpath. | protected static void | loadSystemProperties() | protected static void | loadSystemProperty(String sysKey, String propKey) | public static void | restoreProperties() Restores previously saved properties. | public static void | setProperty(String key, String value) Sets the value of a property. | public static void | setProperty(String key, boolean value) Sets the value of a property. |
COMPILER_CLASS | final public static String COMPILER_CLASS(Code) | | The name of the class to be used for report compilation.
No default value.
net.sf.jasperreports.engine.design.COMPILER_PREFIX |
COMPILER_CLASSPATH | final public static String COMPILER_CLASSPATH(Code) | | The classpath used by the report compiler.
Defaults to System.getProperty("java.class.path") .
|
COMPILER_KEEP_JAVA_FILE | final public static String COMPILER_KEEP_JAVA_FILE(Code) | | Whether to keep the java file generated when the report is compiled.
Defaults to false .
|
COMPILER_TEMP_DIR | final public static String COMPILER_TEMP_DIR(Code) | | The temporary directory used by the report compiler.
Defaults to System.getProperty("user.dir") .
|
COMPILER_XML_VALIDATION | final public static String COMPILER_XML_VALIDATION(Code) | | Whether to validate the xml report when compiling.
Defaults to true .
|
DEFAULT_PROPERTIES_FILE | final protected static String DEFAULT_PROPERTIES_FILE(Code) | | The default properties file.
|
EXPORT_XML_VALIDATION | final public static String EXPORT_XML_VALIDATION(Code) | | Validation flag used by the XML exporter.
Defaults to true .
|
PDF_FONT_DIRS_PREFIX | final public static String PDF_FONT_DIRS_PREFIX(Code) | | Prefix of properties that specify font directories for the PDF exporter.
|
PDF_FONT_FILES_PREFIX | final public static String PDF_FONT_FILES_PREFIX(Code) | | Prefix of properties that specify font files for the PDF exporter.
|
PROPERTIES_FILE | final public static String PROPERTIES_FILE(Code) | | The name of the system property that specifies the properties file name.
|
PROPERTY_PREFIX | final public static String PROPERTY_PREFIX(Code) | | The prefix used by all properties.
|
QUERY_EXECUTER_FACTORY_PREFIX | final public static String QUERY_EXECUTER_FACTORY_PREFIX(Code) | | net.sf.jasperreports.engine.query.QUERY_EXECUTER_FACTORY_PREFIX |
asBoolean | public static boolean asBoolean(String value)(Code) | | Converts a String value into a boolean .
Parameters: value - the value the value as a boolean |
asInteger | public static int asInteger(String value)(Code) | | Converts a String value into a int .
Parameters: value - the value the value as a int |
asLong | public static long asLong(String value)(Code) | | Converts a String value into a long .
Parameters: value - the value the value as a long |
getBooleanProperty | public static boolean getBooleanProperty(String key)(Code) | | Returns a property as a boolean value.
Parameters: key - the key the property value as a boolean |
getBooleanProperty | public static boolean getBooleanProperty(JRPropertiesMap propertiesMap, String key, boolean defaultValue)(Code) | | Returns the value of a property as a boolean, looking first in the supplied properties map
and then in the system properties.
Parameters: propertiesMap - the properties map Parameters: key - the key Parameters: defaultValue - the default value used if the property is not found the property value |
getIntegerProperty | public static int getIntegerProperty(String key)(Code) | | Returns a property as an integer value.
Parameters: key - the key the property value as an integer |
getIntegerProperty | public static int getIntegerProperty(JRPropertiesMap propertiesMap, String key, int defaultValue)(Code) | | Returns the value of a property as an integer, looking first in the supplied properties map
and then in the system properties.
Parameters: propertiesMap - the properties map Parameters: key - the key Parameters: defaultValue - the default value used if the property is not found the property value |
getIntegerProperty | public static int getIntegerProperty(String key, int defaultValue)(Code) | | Returns the value of a property as an integer.
Parameters: key - the key Parameters: defaultValue - the default value used if the property is not found the property value |
getLongProperty | public static long getLongProperty(String key)(Code) | | Returns a property as a long value.
Parameters: key - the key the property value as a long |
getLongProperty | public static long getLongProperty(JRPropertiesMap propertiesMap, String key, int defaultValue)(Code) | | Returns the value of a property as a long, looking first in the supplied properties map
and then in the system properties.
Parameters: propertiesMap - the properties map Parameters: key - the key Parameters: defaultValue - the default value used if the property is not found the property value |
getProperties | public static List getProperties(String prefix)(Code) | | Returns the list of all properties for a key prefix.
Parameters: prefix - the key prefix a list of PropertySuffix PropertySuffix objects containing the suffix of the key and the value |
getProperties | public static List getProperties(JRPropertiesMap propertiesMap, String prefix)(Code) | | Returns the list of all properties for a key prefix.
Parameters: propertiesMap - the properties map Parameters: prefix - the key prefix a list of PropertySuffix PropertySuffix objects containing the suffix of the key and the value |
getProperty | public static String getProperty(String key)(Code) | | Returns the value of the property.
Parameters: key - the key the property value |
getProperty | public static String getProperty(JRPropertiesMap propertiesMap, String key)(Code) | | Returns the value of a property, looking first in the supplied properties map
and then in the system properties.
Parameters: propertiesMap - the properties map Parameters: key - the key the property value |
initProperties | protected static void initProperties()(Code) | | Loads the properties.
|
loadProperties | public static Properties loadProperties(String name, Properties defaults) throws JRException(Code) | | Loads a properties file from the classpath.
Parameters: name - the resource name Parameters: defaults - the default properties the loaded properties if the resource is found, null otherwise throws: JRException - |
loadSystemProperties | protected static void loadSystemProperties()(Code) | | |
loadSystemProperty | protected static void loadSystemProperty(String sysKey, String propKey)(Code) | | |
setProperty | public static void setProperty(String key, String value)(Code) | | Sets the value of a property.
Parameters: key - the key Parameters: value - the value |
setProperty | public static void setProperty(String key, boolean value)(Code) | | Sets the value of a property.
Parameters: key - the key Parameters: value - the value |
|
|