Class EDEFProperties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
org.eclipse.ecf.osgi.services.remoteserviceadmin.EDEFProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
Class to represent EDEF properties for load from .properties file (via
loadEDEFProperties(InputStream)
or
loadEDEFProperties(Reader)
) or via store to .properties file (via
storeEDEFProperties(BufferedWriter, String)
or
storeEDEFProperties(Writer, String)
. This class is used by the
EndpointDescriptionLocator class to load from default.properties files as
well as properties edeffile.properties to override the values from the
edeffile.xml files specified by the Remote-Service header in manifest as per
the RSA specification (chap 122 in compendium spec).- Since:
- 4.8
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
ConstructorDescriptionCreate empty EDEFProperties instance.EDEFProperties
(Map<String, Object> properties) Create EDEFProperties instance initialized with all the given properties -
Method Summary
Modifier and TypeMethodDescriptionGet EDEF properties as String -> Object mapGet EDEF Property Value given namevoid
Load EDEF properties from the given input streamvoid
loadEDEFProperties
(Reader reader) Load EDEF properties from the given readervoid
putEDEFProperties
(Map<String, Object> properties) Put all the given properties into this map as EDEF properties, suitable for storing viastoreEDEFProperties(Writer, String)
putEDEFProperty
(String name, Object value) Put String->Object relation in as an EDEF property.void
storeEDEFProperties
(BufferedWriter bufferedWriter, String comments) Store EDEF properties to the given buffered writer.void
storeEDEFProperties
(Writer writer, String comments) Store EDEF properties to given WriterMethods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Constructor Details
-
EDEFProperties
public EDEFProperties()Create empty EDEFProperties instance. -
EDEFProperties
Create EDEFProperties instance initialized with all the given properties- Parameters:
properties
- must not benull
-
-
Method Details
-
put
-
getValue
Get EDEF Property Value given name- Parameters:
name
- the name/key of the EDEFProperty previously loaded or added. Must not benull
.- Returns:
- Value the value found for given name/key.
Null
if not found.
-
putEDEFProperty
Put String->Object relation in as an EDEF property. Both the key and value must not benull
. The value must be either a Set, List, Array type or a primitive type: Long/long, Byte/byte, Short/short, Int/Integer, char/Character, double/Double, float/Float. If array,set, or list, the elements must be one of the primitive types.- Parameters:
key
- unique name/key for given value. Must not benull
.value
- array,list,set of primitive type or instance of primitive type.- Returns:
- existing Object with name/key. Null if no existing object exists.
-
getEDEFPropertiesAsMap
Get EDEF properties as String -> Object map- Returns:
- Map<String,Object> containing all name->EDEFPropertiesValue contents of this EDEFProperties
-
loadEDEFProperties
Load EDEF properties from the given input stream- Parameters:
ins
- InputStream to read the edef properties from. Must not benull
- Throws:
IOException
- if properties cannot be read from given InputStream
-
loadEDEFProperties
Load EDEF properties from the given reader- Parameters:
reader
- Reader to read the edef properties from. Must not benull
- Throws:
IOException
- if properties cannot be read from given Reader
-
storeEDEFProperties
Store EDEF properties to given Writer- Parameters:
writer
- the Writer to write output to. Must not benull
.comments
-- Throws:
IOException
-
storeEDEFProperties
Store EDEF properties to the given buffered writer.- Parameters:
bufferedWriter
- the BufferedWriter to write to. Must not benull
comments
- Comment line prepended to properties file output. May benull
.- Throws:
IOException
- if properties cannot be written to bufferedWriter
-
putEDEFProperties
Put all the given properties into this map as EDEF properties, suitable for storing viastoreEDEFProperties(Writer, String)
- Parameters:
properties
- the properties to put. May not benull
-