|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
helma.util.ResourceProperties
public class ResourceProperties
A property dictionary that is updated from property resources
Field Summary | |
---|---|
protected ResourceProperties |
defaultProperties
|
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
ResourceProperties()
Constructs an empty ResourceProperties Resources must be added manually afterwards |
|
ResourceProperties(Application app)
Constructs an empty ResourceProperties Resources must be added manually afterwards |
|
ResourceProperties(Application app,
java.lang.String resourceName)
Constructs a ResourceProperties retrieving resources from the given application using the given name to fetch resources |
|
ResourceProperties(Application app,
java.lang.String resourceName,
ResourceProperties defaultProperties)
Constructs a ResourceProperties retrieving resources from the given application using the given name to fetch resources and falling back to the given default properties |
|
ResourceProperties(Application app,
java.lang.String resourceName,
ResourceProperties defaultProperties,
boolean ignoreCase)
Constructs a ResourceProperties retrieving resources from the given application using the given name to fetch resources and falling back to the given default properties |
Method Summary | |
---|---|
void |
addResource(Resource resource)
Adds a resource to the list of resources and updates all properties if needed |
void |
clear()
Overwrite clear() to also empty the key map. |
boolean |
contains(java.lang.Object value)
Checks wether the given object is in the value list |
boolean |
containsKey(java.lang.Object key)
Checks wether the given object is in the key list |
java.util.Enumeration |
elements()
Returns an enumeration of all values |
java.lang.Object |
get(java.lang.Object key)
Returns a value in this list fetched by the given key |
long |
getChecksum()
Returns a checksum for all resources |
java.lang.String |
getProperty(java.lang.String key)
Returns a value in this list fetched by the given key |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns a value in the list fetched by the given key or a default value if no corresponding key is found |
java.util.Iterator |
getResources()
Get an iterator over the properties' resources |
ResourceProperties |
getSubProperties(java.lang.String prefix)
Extract all entries where the key matches the given string prefix from the source map to the target map, cutting off the prefix from the original key. |
boolean |
isEmpty()
Checks wether the properties list is empty |
boolean |
isIgnoreCase()
Checks wether case-sensitivity is ignored for keys |
java.util.Enumeration |
keys()
Returns an enumeration of all keys |
java.util.Set |
keySet()
Returns a set of all keys |
long |
lastModified()
Returns the date the resources were last modified |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts a new key-value pair into the properties list |
java.lang.Object |
remove(java.lang.Object key)
Removes a key-value pair from the properties list |
void |
removeResource(Resource resource)
Removes a resource from the list of resources and updates all properties if needed |
void |
setDefaultProperties(ResourceProperties defaultProperties)
Sets the default properties and updates all properties |
void |
setIgnoreCase(boolean ignore)
Changes how keys are handled |
int |
size()
Returns the number of peroperties in the list |
java.lang.String |
toString()
Returns a string-representation of the class |
void |
update()
Updates all properties if there is a need to update |
Methods inherited from class java.util.Properties |
---|
list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
Methods inherited from class java.util.Hashtable |
---|
clone, containsValue, entrySet, equals, hashCode, putAll, rehash, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ResourceProperties defaultProperties
Constructor Detail |
---|
public ResourceProperties()
public ResourceProperties(Application app)
public ResourceProperties(Application app, java.lang.String resourceName)
app
- application to fetch resources fromresourceName
- name to use when fetching resources from the applicationpublic ResourceProperties(Application app, java.lang.String resourceName, ResourceProperties defaultProperties)
app
- application to fetch resources fromresourceName
- name to use when fetching resources from the applicationdefaultProperties
- default propertiespublic ResourceProperties(Application app, java.lang.String resourceName, ResourceProperties defaultProperties, boolean ignoreCase)
app
- application to fetch resources fromresourceName
- name to use when fetching resources from the applicationdefaultProperties
- default propertiesignoreCase
- ignore case for property keys, setting all keys to lower caseMethod Detail |
---|
public void setDefaultProperties(ResourceProperties defaultProperties)
defaultProperties
- default propertiespublic void addResource(Resource resource)
resource
- resource to addpublic void removeResource(Resource resource)
resource
- resource to removepublic java.util.Iterator getResources()
public void update()
public ResourceProperties getSubProperties(java.lang.String prefix)
prefix
- the string prefix to match againstpublic boolean contains(java.lang.Object value)
contains
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
value
- value to look for
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.Object,java.lang.Object>
containsKey
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
key
- key to look for
public java.util.Enumeration elements()
elements
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map<java.lang.Object,java.lang.Object>
get
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
key
- key to use for fetching the value
public long lastModified()
public long getChecksum()
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
getProperty
in class java.util.Properties
key
- key to use for fetching the valuedefaultValue
- default value to return if key is not found
public java.lang.String getProperty(java.lang.String key)
getProperty
in class java.util.Properties
key
- key to use for fetching the value
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.Object,java.lang.Object>
isEmpty
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public boolean isIgnoreCase()
public java.util.Enumeration keys()
keys
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.util.Set keySet()
keySet
in interface java.util.Map<java.lang.Object,java.lang.Object>
keySet
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map<java.lang.Object,java.lang.Object>
put
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
key
- keyvalue
- value
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.Object,java.lang.Object>
remove
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
key
- key
public void setIgnoreCase(boolean ignore)
ignore
- true if to ignore case-sensitivity for keyspublic int size()
size
in interface java.util.Map<java.lang.Object,java.lang.Object>
size
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public void clear()
clear
in interface java.util.Map<java.lang.Object,java.lang.Object>
clear
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
public java.lang.String toString()
toString
in class java.util.Hashtable<java.lang.Object,java.lang.Object>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |