|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.util.JRProperties
JRPropertiesUtil
.
public final class JRProperties
Class that provides static methods for loading, getting and setting properties.
The following actions are performed:
Nested Class Summary | |
---|---|
static class |
JRProperties.PropertySuffix
Deprecated. Class used by getProperties(String) . |
Field Summary | |
---|---|
static java.lang.String |
COMPILER_CLASS
Deprecated. Replaced by JRCompiler.COMPILER_PREFIX . |
static java.lang.String |
COMPILER_CLASSPATH
Deprecated. Replaced by JRCompiler.COMPILER_CLASSPATH . |
static java.lang.String |
COMPILER_KEEP_JAVA_FILE
Deprecated. Replaced by JRCompiler.COMPILER_KEEP_JAVA_FILE . |
static java.lang.String |
COMPILER_TEMP_DIR
Deprecated. Replaced by JRCompiler.COMPILER_TEMP_DIR . |
static java.lang.String |
COMPILER_XML_VALIDATION
Deprecated. Replaced by JRReportSaxParserFactory.COMPILER_XML_VALIDATION . |
protected static java.lang.String |
DEFAULT_PROPERTIES_FILE
Deprecated. The default properties file. |
static java.lang.String |
EXPORT_XML_VALIDATION
Deprecated. Replaced by PrintSaxParserFactory.EXPORT_XML_VALIDATION . |
static java.lang.String |
PDF_FONT_DIRS_PREFIX
Deprecated. Replaced by JRPdfExporter.PDF_FONT_DIRS_PREFIX . |
static java.lang.String |
PDF_FONT_FILES_PREFIX
Deprecated. Replaced by JRPdfExporter.PDF_FONT_FILES_PREFIX . |
protected static java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String> |
properties
Deprecated. |
static java.lang.String |
PROPERTIES_FILE
Deprecated. Replaced by DefaultJasperReportsContext.PROPERTIES_FILE . |
static java.lang.String |
PROPERTY_PREFIX
Deprecated. Replaced by JRPropertiesUtil.PROPERTY_PREFIX . |
static java.lang.String |
QUERY_EXECUTER_FACTORY_PREFIX
Deprecated. Replaced by net.sf.jasperreports.engine.query . |
protected static java.util.HashMap<java.lang.String,java.lang.String> |
savedProps
Deprecated. |
Method Summary | |
---|---|
static boolean |
asBoolean(java.lang.String value)
Deprecated. Converts a String value into a boolean . |
static java.lang.Character |
asCharacter(java.lang.String value)
Deprecated. Converts a String into a Character value. |
static float |
asFloat(java.lang.String value)
Deprecated. Converts a String value into a float . |
static int |
asInteger(java.lang.String value)
Deprecated. Converts a String value into a int . |
static long |
asLong(java.lang.String value)
Deprecated. Converts a String value into a long . |
static void |
backupProperties()
Deprecated. Saves a copy of the current properties. |
static java.util.List<JRProperties.PropertySuffix> |
getAllProperties(JRPropertiesHolder propertiesHolder,
java.lang.String prefix)
Deprecated. Returns the list of all properties for a key prefix, including global properties. |
static java.util.List<JRProperties.PropertySuffix> |
getAllProperties(JRPropertiesMap propertiesMap,
java.lang.String prefix)
Deprecated. Returns the list of all properties for a key prefix, including global properties. |
static java.lang.Boolean |
getBooleanProperty(JRPropertiesHolder propertiesHolder,
java.lang.String key)
Deprecated. Returns the value of a property as a Boolean object, looking first in the supplied properties holder and then in the system properties. |
static boolean |
getBooleanProperty(JRPropertiesHolder propertiesHolder,
java.lang.String key,
boolean defaultValue)
Deprecated. Returns the value of a property as a boolean, looking first in the supplied properties holder and then in the system properties. |
static boolean |
getBooleanProperty(JRPropertiesMap propertiesMap,
java.lang.String key,
boolean defaultValue)
Deprecated. Returns the value of a property as a boolean, looking first in the supplied properties map and then in the system properties. |
static boolean |
getBooleanProperty(java.lang.String key)
Deprecated. Returns a property as a boolean value. |
static java.lang.Character |
getCharacterProperty(JRPropertiesMap propertiesMap,
java.lang.String key)
Deprecated. Returns the value of a property as a Character value,
looking first in the supplied properties holder and then in the
system properties. |
static java.lang.Character |
getCharacterProperty(java.lang.String key)
Deprecated. Returns a property as a Character value. |
protected static java.util.Properties |
getDefaults()
Deprecated. Sets the default properties. |
static float |
getFloatProperty(JRPropertiesHolder propertiesHolder,
java.lang.String key,
float defaultValue)
Deprecated. Returns the value of a property as a float, looking first in the supplied properties holder and then in the system properties. |
static float |
getFloatProperty(JRPropertiesMap propertiesMap,
java.lang.String key,
float defaultValue)
Deprecated. Returns the value of a property as a float, looking first in the supplied properties map and then in the system properties. |
static float |
getFloatProperty(java.lang.String key)
Deprecated. Returns a property as a float value. |
static float |
getFloatProperty(java.lang.String key,
float defaultValue)
Deprecated. Returns the value of a property as a float. |
static int |
getIntegerProperty(JRPropertiesHolder propertiesHolder,
java.lang.String key,
int defaultValue)
Deprecated. Returns the value of a property as an integer, looking first in the supplied properties holder and then in the system properties. |
static int |
getIntegerProperty(JRPropertiesMap propertiesMap,
java.lang.String key,
int defaultValue)
Deprecated. Returns the value of a property as an integer, looking first in the supplied properties map and then in the system properties. |
static int |
getIntegerProperty(java.lang.String key)
Deprecated. Returns a property as an integer value. |
static int |
getIntegerProperty(java.lang.String key,
int defaultValue)
Deprecated. Returns the value of a property as an integer. |
static long |
getLongProperty(JRPropertiesHolder propertiesHolder,
java.lang.String key,
int defaultValue)
Deprecated. Returns the value of a property as a long, looking first in the supplied properties holder and then in the system properties. |
static long |
getLongProperty(JRPropertiesMap propertiesMap,
java.lang.String key,
int defaultValue)
Deprecated. Returns the value of a property as a long, looking first in the supplied properties map and then in the system properties. |
static long |
getLongProperty(java.lang.String key)
Deprecated. Returns a property as a long value. |
protected static JRPropertiesMap |
getOwnProperties(JRPropertiesHolder propertiesHolder)
Deprecated. |
static java.util.List<JRProperties.PropertySuffix> |
getProperties(JRPropertiesHolder propertiesHolder,
java.lang.String prefix)
Deprecated. Returns the list of all properties for a key prefix. |
static java.util.List<JRProperties.PropertySuffix> |
getProperties(JRPropertiesMap propertiesMap,
java.lang.String prefix)
Deprecated. Returns the list of all properties for a key prefix. |
static java.util.List<JRProperties.PropertySuffix> |
getProperties(java.lang.String prefix)
Deprecated. Returns the list of all properties for a key prefix. |
static java.lang.String |
getProperty(JRPropertiesHolder propertiesHolder,
java.lang.String key)
Deprecated. Returns the value of a property, looking first in the supplied properties holder and then in the system properties. |
static java.lang.String |
getProperty(JRPropertiesMap propertiesMap,
java.lang.String key)
Deprecated. Returns the value of a property, looking first in the supplied properties map and then in the system properties. |
static java.lang.String |
getProperty(java.lang.String key)
Deprecated. Returns the value of the property. |
static java.lang.String |
getProperty(java.lang.String key,
JRPropertiesHolder... propertiesHolders)
Deprecated. Returns the value of a property, looking for it in several properties holders and then in the system properties. |
protected static java.lang.String |
getSystemProperty(java.lang.String propertyName)
Deprecated. |
protected static void |
initProperties()
Deprecated. Loads the properties. |
static java.util.Properties |
loadProperties(java.lang.String name,
java.util.Properties defaults)
Deprecated. Loads a properties file from the classpath. |
protected static void |
loadSystemProperties()
Deprecated. |
protected static void |
loadSystemProperty(java.lang.String sysKey,
java.lang.String propKey)
Deprecated. |
static void |
removePropertyValue(java.lang.String key)
Deprecated. Removes the value set for a property. |
static void |
restoreProperties()
Deprecated. Restores previously saved properties. |
static void |
setProperty(java.lang.String key,
boolean value)
Deprecated. Sets the value of a property. |
static void |
setProperty(java.lang.String key,
java.lang.String value)
Deprecated. Sets the value of a property. |
protected static void |
transfer(JRPropertiesMap source,
JRPropertiesHolder destination,
java.lang.String tranferPropertiesPrefix)
Deprecated. |
static void |
transferProperties(JRPropertiesHolder source,
JRPropertiesHolder destination,
java.lang.String tranferPropertiesPrefix)
Deprecated. Copies properties from one object to another. |
static void |
transferProperties(JRPropertiesMap source,
JRPropertiesHolder destination,
java.lang.String tranferPropertiesPrefix)
Deprecated. Copies properties from one object to another. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String DEFAULT_PROPERTIES_FILE
public static final java.lang.String PROPERTY_PREFIX
JRPropertiesUtil.PROPERTY_PREFIX
.
public static final java.lang.String PROPERTIES_FILE
DefaultJasperReportsContext.PROPERTIES_FILE
.
public static final java.lang.String COMPILER_CLASS
JRCompiler.COMPILER_PREFIX
.No default value.
public static final java.lang.String COMPILER_XML_VALIDATION
JRReportSaxParserFactory.COMPILER_XML_VALIDATION
.
Defaults to true
.
public static final java.lang.String COMPILER_KEEP_JAVA_FILE
JRCompiler.COMPILER_KEEP_JAVA_FILE
.
Defaults to false
.
public static final java.lang.String COMPILER_TEMP_DIR
JRCompiler.COMPILER_TEMP_DIR
.
Defaults to System.getProperty("user.dir")
.
public static final java.lang.String COMPILER_CLASSPATH
JRCompiler.COMPILER_CLASSPATH
.
Defaults to System.getProperty("java.class.path")
.
public static final java.lang.String EXPORT_XML_VALIDATION
PrintSaxParserFactory.EXPORT_XML_VALIDATION
.
Defaults to true
.
public static final java.lang.String PDF_FONT_FILES_PREFIX
JRPdfExporter.PDF_FONT_FILES_PREFIX
.
public static final java.lang.String PDF_FONT_DIRS_PREFIX
JRPdfExporter.PDF_FONT_DIRS_PREFIX
.
public static final java.lang.String QUERY_EXECUTER_FACTORY_PREFIX
net.sf.jasperreports.engine.query
.protected static volatile java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String> properties
protected static java.util.HashMap<java.lang.String,java.lang.String> savedProps
Method Detail |
---|
protected static void initProperties()
protected static void loadSystemProperties()
protected static java.util.Properties getDefaults() throws JRException
JRException
protected static java.lang.String getSystemProperty(java.lang.String propertyName)
protected static void loadSystemProperty(java.lang.String sysKey, java.lang.String propKey)
public static java.util.Properties loadProperties(java.lang.String name, java.util.Properties defaults) throws JRException
name
- the resource namedefaults
- the default properties
null
otherwise
JRException
public static java.lang.String getProperty(java.lang.String key)
key
- the key
public static boolean getBooleanProperty(java.lang.String key)
key
- the key
public static int getIntegerProperty(java.lang.String key)
key
- the key
public static float getFloatProperty(java.lang.String key)
key
- the key
public static boolean asBoolean(java.lang.String value)
String
value into a boolean
.
value
- the value
boolean
public static int asInteger(java.lang.String value)
String
value into a int
.
value
- the value
int
public static float asFloat(java.lang.String value)
String
value into a float
.
value
- the value
float
public static void setProperty(java.lang.String key, java.lang.String value)
key
- the keyvalue
- the valuepublic static void setProperty(java.lang.String key, boolean value)
key
- the keyvalue
- the valuepublic static void removePropertyValue(java.lang.String key)
This method removes values set in jasperreports.properties or via the
setProperty
method.
Built-in default property values are not affected; if the property has
a default value it will be used after calling this method for the
property.
key
- the property keypublic static void backupProperties()
restoreProperties()
public static void restoreProperties()
backupProperties()
public static java.util.List<JRProperties.PropertySuffix> getProperties(java.lang.String prefix)
prefix
- the key prefix
PropertySuffix
objects containing the suffix of the key and the valuepublic static java.util.List<JRProperties.PropertySuffix> getProperties(JRPropertiesHolder propertiesHolder, java.lang.String prefix)
propertiesHolder
- the properties holderprefix
- the key prefix
PropertySuffix
objects containing the suffix of the key and the valuegetAllProperties(JRPropertiesHolder, String)
public static java.util.List<JRProperties.PropertySuffix> getAllProperties(JRPropertiesHolder propertiesHolder, java.lang.String prefix)
propertiesHolder
- the properties holderprefix
- the key prefix
PropertySuffix
objects containing the suffix of the key and the valuegetProperties(JRPropertiesHolder, String)
public static java.util.List<JRProperties.PropertySuffix> getProperties(JRPropertiesMap propertiesMap, java.lang.String prefix)
propertiesMap
are considered, and
not global properties.
propertiesMap
- the properties mapprefix
- the key prefix
PropertySuffix
objects containing the suffix of the key and the valuegetAllProperties(JRPropertiesMap, String)
public static java.util.List<JRProperties.PropertySuffix> getAllProperties(JRPropertiesMap propertiesMap, java.lang.String prefix)
propertiesMap
- the properties mapprefix
- the key prefix
PropertySuffix
objects containing the suffix of the key and the valuegetProperties(JRPropertiesMap, String)
public static java.lang.String getProperty(JRPropertiesHolder propertiesHolder, java.lang.String key)
propertiesHolder
- the properties holderkey
- the key
public static java.lang.String getProperty(java.lang.String key, JRPropertiesHolder... propertiesHolders)
key
- the keypropertiesHolders
- the properties holders
public static java.lang.String getProperty(JRPropertiesMap propertiesMap, java.lang.String key)
propertiesMap
- the properties mapkey
- the key
public static boolean getBooleanProperty(JRPropertiesHolder propertiesHolder, java.lang.String key, boolean defaultValue)
propertiesHolder
- the properties holderkey
- the keydefaultValue
- the default value used if the property is not found
public static java.lang.Boolean getBooleanProperty(JRPropertiesHolder propertiesHolder, java.lang.String key)
propertiesHolder
- the properties holderkey
- the key
null
if the property is not definedpublic static boolean getBooleanProperty(JRPropertiesMap propertiesMap, java.lang.String key, boolean defaultValue)
propertiesMap
- the properties mapkey
- the keydefaultValue
- the default value used if the property is not found
public static int getIntegerProperty(JRPropertiesHolder propertiesHolder, java.lang.String key, int defaultValue)
propertiesHolder
- the properties holderkey
- the keydefaultValue
- the default value used if the property is not found
public static int getIntegerProperty(JRPropertiesMap propertiesMap, java.lang.String key, int defaultValue)
propertiesMap
- the properties mapkey
- the keydefaultValue
- the default value used if the property is not found
public static int getIntegerProperty(java.lang.String key, int defaultValue)
key
- the keydefaultValue
- the default value used if the property is not found
public static float getFloatProperty(JRPropertiesHolder propertiesHolder, java.lang.String key, float defaultValue)
propertiesHolder
- the properties holderkey
- the keydefaultValue
- the default value used if the property is not found
public static float getFloatProperty(JRPropertiesMap propertiesMap, java.lang.String key, float defaultValue)
propertiesMap
- the properties mapkey
- the keydefaultValue
- the default value used if the property is not found
public static float getFloatProperty(java.lang.String key, float defaultValue)
key
- the keydefaultValue
- the default value used if the property is not found
public static long asLong(java.lang.String value)
String
value into a long
.
value
- the value
long
public static long getLongProperty(java.lang.String key)
key
- the key
public static long getLongProperty(JRPropertiesMap propertiesMap, java.lang.String key, int defaultValue)
propertiesMap
- the properties mapkey
- the keydefaultValue
- the default value used if the property is not found
public static long getLongProperty(JRPropertiesHolder propertiesHolder, java.lang.String key, int defaultValue)
propertiesHolder
- the properties holderkey
- the keydefaultValue
- the default value used if the property is not found
protected static JRPropertiesMap getOwnProperties(JRPropertiesHolder propertiesHolder)
public static void transferProperties(JRPropertiesHolder source, JRPropertiesHolder destination, java.lang.String tranferPropertiesPrefix)
The properties to be copied are determined by one or more JasperReports properties having a specified prefix. The values of these properties are interpreted as prefixes of properties to copy.
source
- the source properties holderdestination
- the destination properties holdertranferPropertiesPrefix
- the prefix of the JasperReports properties
that specify the object properties to copypublic static void transferProperties(JRPropertiesMap source, JRPropertiesHolder destination, java.lang.String tranferPropertiesPrefix)
source
- the source propertiesdestination
- the destination properties holdertranferPropertiesPrefix
- the prefix of the JasperReports properties
that specify the object properties to copytransferProperties(JRPropertiesHolder, JRPropertiesHolder, String)
protected static void transfer(JRPropertiesMap source, JRPropertiesHolder destination, java.lang.String tranferPropertiesPrefix)
public static java.lang.Character getCharacterProperty(java.lang.String key)
Character
value.
key
- the key
Character
asCharacter(String)
public static java.lang.Character getCharacterProperty(JRPropertiesMap propertiesMap, java.lang.String key)
Character
value,
looking first in the supplied properties holder and then in the
system properties.
propertiesMap
- the properties mapkey
- the key
Character
public static java.lang.Character asCharacter(java.lang.String value)
String
into a Character
value.
If the String
value is null or the empty string,
null
is returned. Otherwise, the method returns
the first character in the string.
value
- the String
value
Character
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |