| java.lang.Object javax.media.jai.PropertySourceImpl
All known Subclasses: javax.media.jai.WritablePropertySourceImpl,
PropertySourceImpl | public class PropertySourceImpl implements PropertySource,Serializable(Code) | | A utility implementation of the PropertySource interface.
Properties are managed by three internal structures: one which maps
property names to values, a second which maps property names to
PropertySource s, and a third which tracks which entries
in the name-value mapping derived their respective values from a
PropertySource in the name-PropertySource
mapping. The case of property names is retained for subsequent
retrieval but is ignored when the names are used as keys.
See Also: CaselessStringKey See Also: PropertySource See Also: WritablePropertySource See Also: WritablePropertySourceImpl since: JAI 1.1 |
Field Summary | |
protected Set | cachedPropertyNames CaselessStringKey s corresponding to the keys of entries
in properties which derived their respective
values from a PropertySource in
propertySources . | protected transient Map | properties Mapping of CaselessStringKey s to values. | protected transient Map | propertySources Mapping of CaselessStringKey s to
PropertySource s. |
Constructor Summary | |
protected | PropertySourceImpl() Constructs a PropertySourceImpl instance with
no properties set. | public | PropertySourceImpl(Map propertyMap, PropertySource propertySource) Constructs a PropertySourceImpl instance which
will derive properties from one or both of the supplied parameters.
The propertyMap and propertySource parameters
will be used to initialize the name-value and
name-PropertySource mappings, respectively.
Entries in the propertyMap object will be assumed
to be properties if the key is a String or a
CaselessStringKey . |
Method Summary | |
public Map | getProperties() Copies into a Map all properties currently available
via this PropertySource . | public Object | getProperty(String propertyName) Returns the value of a property. | public Class | getPropertyClass(String propertyName) Returns the class expected to be returned by a request for
the property with the specified name. | public String[] | getPropertyNames() Returns an array of String s recognized as names by
this property source. | public String[] | getPropertyNames(String prefix) Returns an array of String s recognized as names by
this property source that begin with the supplied prefix. |
cachedPropertyNames | protected Set cachedPropertyNames(Code) | | CaselessStringKey s corresponding to the keys of entries
in properties which derived their respective
values from a PropertySource in
propertySources .
|
properties | protected transient Map properties(Code) | | Mapping of CaselessStringKey s to values.
If this object is serialized, only those entries of which
the value is serializable will be retained.
|
propertySources | protected transient Map propertySources(Code) | | Mapping of CaselessStringKey s to
PropertySource s.
If this object is serialized, only those entries of which
the value is serializable will be retained.
|
PropertySourceImpl | protected PropertySourceImpl()(Code) | | Constructs a PropertySourceImpl instance with
no properties set.
|
PropertySourceImpl | public PropertySourceImpl(Map propertyMap, PropertySource propertySource)(Code) | | Constructs a PropertySourceImpl instance which
will derive properties from one or both of the supplied parameters.
The propertyMap and propertySource parameters
will be used to initialize the name-value and
name-PropertySource mappings, respectively.
Entries in the propertyMap object will be assumed
to be properties if the key is a String or a
CaselessStringKey . The propertySource
object will be queried for the names of properties that it emits
but requests for associated values will not be made at this time
so as to to defer any calculation that such requests might provoke.
The case of property names will be retained but will be ignored
insofar as the name is used as a key to the property value.
Parameters: propertyMap - A Map from which to copy propertieswhich have keys which are either String s orCaselessStringKey s. Parameters: propertySource - A PropertySource from which toderive properties. exception: IllegalArgumentException - if propertyMap and propertySource are both null and this constructor is not being invoked from within asubclass constructor. When invoked from a subclassconstructor both parameters may be null . |
getProperties | public Map getProperties()(Code) | | Copies into a Map all properties currently available
via this PropertySource . All property values are
copied by reference rather than by being cloned. The keys in the
Map will be String s with the original
property name case intact. Property values derived from the
name-value mapping will take precedence. The names of properties
whose values are derived via the name-PropertySource
mapping will be recorded as "cached properties".
A Map of all properties or null ifnone are defined. |
getProperty | public Object getProperty(String propertyName)(Code) | | Returns the value of a property. If the property name is not
recognized, java.awt.Image.UndefinedProperty will
be returned.
If the requested name is found in the name-value mapping,
the corresponding value will be returned. Otherwise the
name-PropertySource mapping will be queried and the
value will be derived from the found PropertySource ,
if any. If the value is derived from a PropertySource ,
a record will be kept of this and this property will be referred to
as a "cached property".
Parameters: propertyName - the name of the property, as a String . the value of the property, as anObject , or the valuejava.awt.Image.UndefinedProperty . exception: IllegalArgumentException - if propertyName is null . |
getPropertyClass | public Class getPropertyClass(String propertyName)(Code) | | Returns the class expected to be returned by a request for
the property with the specified name. If this information
is unavailable, null will be returned.
This method queries only the name-value mapping so as to avoid
requesting a property value from a PropertySource
to which the name might refer via the name-PropertySource
mapping. If it is known from getPropertyNames() that
the property is emitted by this PropertySource but this
method returns null , then getProperty()
will have to be invoked and the Class obtained from
the property value itself.
Parameters: propertyName - the name of the property, as a String . The Class expected to be returneded by arequest for the value of this property or null . exception: IllegalArgumentException - if propertyName is null . |
getPropertyNames | public String[] getPropertyNames()(Code) | | Returns an array of String s recognized as names by
this property source. The case of the property names is retained.
If no properties are available, null will be returned.
an array of String s giving the validproperty names or null . |
getPropertyNames | public String[] getPropertyNames(String prefix)(Code) | | Returns an array of String s recognized as names by
this property source that begin with the supplied prefix. If
no property names match, null will be returned.
The comparison is done in a case-independent manner.
an array of String s giving the validproperty names. exception: IllegalArgumentException - if prefix is null . |
|
|