Package net.sf.jasperreports.engine
Class JRPropertiesMap
java.lang.Object
net.sf.jasperreports.engine.JRPropertiesMap
- All Implemented Interfaces:
Serializable,Cloneable
Properties map of an JR element.
The order of the properties (obtained by
getPropertyNames()
is the same as the order in which the properties were added.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a properties map.JRPropertiesMap(JRPropertiesMap propertiesMap) Clones a properties map. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this property map.protected voidcollectPropertyNames(Collection<String> names) booleancontainsProperty(String propName) Decides whether the map contains a specified property.voidcopyOwnProperties(JRPropertiesMap propertiesMap) Copies own properties of a different map into this object.voidcopyProperties(JRPropertiesMap propertiesMap) Copies properties of a different map into this object.protected voidReturns the base properties map, if any.protected StringgetOwnProperty(String propName) String[]static JRPropertiesMapgetPropertiesClone(JRPropertiesHolder propertiesHolder) Clones the properties map of a properties holder.getProperty(String propName) Returns the value of a property.String[]Returns the names of the properties.protected booleanbooleanChecks whether this object has properties of its own (i.e.protected booleanhasOwnProperty(String propName) booleanChecks whether there are any properties.booleanisEmpty()static JRPropertiesMaploadProperties(URL location) Loads a properties file from a location.voidremoveProperty(String propName) Removes a property.voidSets the base properties map.voidsetProperty(String propName, String value) Adds/sets a property value.toString()
-
Field Details
-
PROPERTY_VALUE
Deprecated.no longer used,setProperty(String, String)now uses the actual property name for the change event- See Also:
-
-
Constructor Details
-
JRPropertiesMap
public JRPropertiesMap()Creates a properties map. -
JRPropertiesMap
Clones a properties map.- Parameters:
propertiesMap- the original properties map
-
-
Method Details
-
ensureInit
protected void ensureInit() -
getPropertyNames
Returns the names of the properties.- Returns:
- the names of the properties
-
getOwnPropertyNames
-
collectPropertyNames
-
getProperty
Returns the value of a property.- Parameters:
propName- the name of the property- Returns:
- the value
-
containsProperty
Decides whether the map contains a specified property. The method returns true even if the property value is null.- Parameters:
propName- the property name- Returns:
trueif and only if the map contains the property
-
hasOwnProperty
-
getOwnProperty
-
setProperty
Adds/sets a property value.- Parameters:
propName- the name of the propertyvalue- the value of the property
-
removeProperty
Removes a property.- Parameters:
propName- the property name
-
cloneProperties
Clones this property map.- Returns:
- a clone of this property map
-
clone
-
copyOwnProperties
Copies own properties of a different map into this object.- Parameters:
propertiesMap- the map to copy properties from
-
copyProperties
Copies properties of a different map into this object.- Parameters:
propertiesMap- the map to copy properties from
-
toString
-
hasProperties
public boolean hasProperties()Checks whether there are any properties.- Returns:
- whether there are any properties
-
isEmpty
public boolean isEmpty() -
hasOwnProperties
public boolean hasOwnProperties()Checks whether this object has properties of its own (i.e. not inherited from the base properties).- Returns:
- whether this object has properties of its own
- See Also:
-
getPropertiesClone
Clones the properties map of a properties holder. If the holder does not have any properties, null is returned.- Parameters:
propertiesHolder- the properties holder- Returns:
- a clone of the holder's properties map, or
nullif the holder does not have any properties
-
getBaseProperties
Returns the base properties map, if any.- Returns:
- the base properties map
- See Also:
-
setBaseProperties
Sets the base properties map.The base properties map are used as base/default properties for this instance. All of the
containsProperty(String),getProperty(String),getPropertyNames()andhasProperties()methods include base properties as well.- Parameters:
base- the base properties map
-
loadProperties
Loads a properties file from a location.- Parameters:
location- the properties file URL- Returns:
- the properties file loaded as a in-memory properties map
-
hasEventSupport
protected boolean hasEventSupport() -
getEventSupport
-
setProperty(String, String)now uses the actual property name for the change event