|
Components | |||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.DynamicPropertyBag
public abstract class DynamicPropertyBag
This abstract class represents a property bag component, which defines a collection of dynamic properties that can be specified at design time within the IDE via a customizer.
PropertyBag
,
Serialized FormConstructor Summary | |
---|---|
DynamicPropertyBag()
Create a new DynamicPropertyBag |
Method Summary | |
---|---|
void |
addPropertyBagChangedListener(com.sas.collection.PropertyBagChangedListener listener)
Add a listener for the com.sas.collection.PropertyBagChangedEvent event. |
java.lang.Object |
clone()
Clone a dynamic property bag. |
boolean |
containsKey(java.lang.String key)
Determine if the property bag contains a property with this name (key). |
int |
count()
Return the number of properties in the property bag. |
java.lang.Object |
get(java.lang.String key)
Get an item from a property bag. |
java.lang.Object |
get(java.lang.String key,
java.lang.Object defaultValue)
Get an item from a property bag, or return a default if it does not exist. |
java.beans.BeanInfo |
getBeanInfo()
Retrieve information about this object's properties, exposed methods, and events. |
java.lang.Class |
getPropertyType(java.lang.Object bean,
java.lang.String property)
Return the type of the specified property. |
java.lang.Object |
getPropertyValue(java.lang.Object bean,
java.lang.String property)
Return the value of the property specified. |
java.lang.String[] |
listKeys()
Return a list of the keys for this property bag. |
void |
merge(com.sas.collection.StaticPropertyBagInterface other)
Merge into this bag any property from the source which does not exist in this bag. |
void |
remove(java.lang.String key)
Remove a property from the property bag. |
void |
removeAll()
Remove all items from the property bag. |
void |
removePropertyBagChangedListener(com.sas.collection.PropertyBagChangedListener listener)
Remove a listener for the com.sas.collection.PropertyBagChangedEvent event. |
void |
set(com.sas.collection.StaticPropertyBagInterface other)
Add the contents of another property bag to this property bag. |
void |
set(java.lang.String key,
java.lang.Object property)
Put a property in the property bag. |
void |
setPropertyValue(java.lang.Object bean,
java.lang.String property,
java.lang.Object value)
Set the value of the specified property. |
com.sas.collection.DictionaryInterface |
toDictionary(com.sas.collection.DictionaryInterface initialDictionary)
Place the property bag items into a dictionary and return that dictionary. |
Methods inherited from interface com.sas.util.DynamicBeanInfoInterface |
---|
addPropertyChangeListener, removePropertyChangeListener |
Methods inherited from interface com.sas.util.UserCodeGenClassInterface |
---|
getUserCodeGenClass |
Constructor Detail |
---|
public DynamicPropertyBag()
Method Detail |
---|
public java.beans.BeanInfo getBeanInfo()
getBeanInfo
in interface DynamicBeanInfoInterface
public java.lang.Object getPropertyValue(java.lang.Object bean, java.lang.String property)
getPropertyValue
in interface com.sas.PropertyValueQueryInterface
bean
- The bean to get the property value from.property
- The name of the property to return the value of.
public void setPropertyValue(java.lang.Object bean, java.lang.String property, java.lang.Object value)
setPropertyValue
in interface com.sas.PropertyValueQueryInterface
bean
- The bean to set the property value on.property
- The name of the property to set the value of.value
- The new value of the property.public java.lang.Class getPropertyType(java.lang.Object bean, java.lang.String property)
getPropertyType
in interface com.sas.PropertyValueQueryInterface
bean
- The bean which has the property.property
- The name of the property to get the type of.
public int count()
count
in interface com.sas.collection.StaticPropertyBagInterface
count
in interface com.sas.util.Countable
public boolean containsKey(java.lang.String key)
containsKey
in interface com.sas.collection.StaticPropertyBagInterface
key
- the name of the property.
This string must be
an interned string and may not be null.
(Use aString.intern() to create an interned string.)
Returns:
true if the property bag contains the property.
get
public java.lang.Object get(java.lang.String key)
- Get an item from a property bag.
- Specified by:
get
in interface com.sas.collection.StaticPropertyBagInterface
- Parameters:
key
- the name of the property.
This string must be
an interned string and may not be null.
(Use aString.intern() to create an interned string.)
Returns:
the object associated with the key
Throws:
java.util.NoSuchElementException
- if there
is no such property in the property bag.
(this is necessary to distinguish between
no such key and a property value of null.)
get
public java.lang.Object get(java.lang.String key,
java.lang.Object defaultValue)
- Get an item from a property bag, or return a default if it does not exist.
- Specified by:
get
in interface com.sas.collection.StaticPropertyBagInterface
- Parameters:
key
- the name of the property.
This string must be
an interned string and may not be null.
(Use aString.intern() to create an interned string.)
defaultValue
- a default value to return if the named property does
not exist in the property bag
Returns:
the object associated with the key, or the defaultValue
if the bag does not contain an element for the specified key.
toDictionary
public com.sas.collection.DictionaryInterface toDictionary(com.sas.collection.DictionaryInterface initialDictionary)
- Place the property bag items into a dictionary and return that
dictionary.
- Specified by:
toDictionary
in interface com.sas.collection.StaticPropertyBagInterface
- Parameters:
initialDictionary
- a dictionary into which the property bag
places all of its values via. This may be null, in which case
a new Dictionary is created.
- Returns:
- the dictionary containing the property bag contents.
- See Also:
Dictionary
,
DictionaryInterface.set(Object,Object)
listKeys
public java.lang.String[] listKeys()
- Return a list of the keys for this property bag.
- Specified by:
listKeys
in interface com.sas.collection.StaticPropertyBagInterface
- Returns:
- an array containing the property keys
- See Also:
StringCollection
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Clone a dynamic property bag.
- Specified by:
clone
in interface com.sas.collection.StaticPropertyBagInterface
- Specified by:
clone
in interface com.sas.PublicClonable
- Overrides:
clone
in class com.sas.Component
- Returns:
- a clone of the dynamic property bag
- Throws:
java.lang.CloneNotSupportedException
- if the object cannot be cloned.
set
public void set(java.lang.String key,
java.lang.Object property)
- Put a property in the property bag.
- Specified by:
set
in interface com.sas.collection.PropertyBagInterface
- Parameters:
key
- the name of the property.
This string must be
an interned string and may not be null.
(Use aString.intern() to create an interned string.)
property
- the value to associate with the property name
Property values may be null.
remove
public void remove(java.lang.String key)
- Remove a property from the property bag.
After removing, contains(key) will return false
and get(key) will throw
a NoSuchElementException
- Specified by:
remove
in interface com.sas.collection.PropertyBagInterface
- Parameters:
key
- the name of the property.
This string must be
an interned string and may not be null.
(Use aString.intern() to create an interned string.)
Throws:
java.util.NoSuchElementException
- if the
bag does not contains the named element.
removeAll
public void removeAll()
- Remove all items from the property bag.
- Specified by:
removeAll
in interface com.sas.collection.PropertyBagInterface
set
public void set(com.sas.collection.StaticPropertyBagInterface other)
- Add the contents of another property bag to this property bag.
This does set(key, property) on this property bag
for each the key/property pair from the source.
- Specified by:
set
in interface com.sas.collection.PropertyBagInterface
- Parameters:
other
- another property bag- See Also:
PropertyBagInterface.merge(com.sas.collection.StaticPropertyBagInterface)
merge
public void merge(com.sas.collection.StaticPropertyBagInterface other)
- Merge into this bag any property from the source
which does not exist in this bag. For items which
exists in both property bags, if both items are also
property bags, merge the element from other
into the element from this PropertyBag recursively.
- Specified by:
merge
in interface com.sas.collection.PropertyBagInterface
- Parameters:
other
- another property bag- See Also:
PropertyBagInterface.set(com.sas.collection.StaticPropertyBagInterface)
addPropertyBagChangedListener
public void addPropertyBagChangedListener(com.sas.collection.PropertyBagChangedListener listener)
- Add a listener for the com.sas.collection.PropertyBagChangedEvent event.
- Specified by:
addPropertyBagChangedListener
in interface com.sas.collection.PropertyBagChangedSource
- Parameters:
listener
- an object which handles PropertyBagChangedEvent events
the listener is not added a second time if it already exists
in the list of listeners for this event.- See Also:
PropertyBagChangedSource
removePropertyBagChangedListener
public void removePropertyBagChangedListener(com.sas.collection.PropertyBagChangedListener listener)
- Remove a listener for the com.sas.collection.PropertyBagChangedEvent event. Nothing
happens if the listener is not in the list of listeners for this event.
- Specified by:
removePropertyBagChangedListener
in interface com.sas.collection.PropertyBagChangedSource
- Parameters:
listener
- an object which handles PropertyBagChangedEvent events- See Also:
PropertyBagChangedSource
All Libraries
This Library
Package
Class
Use
Tree
Deprecated
Index
Grand Index
Help
Components
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2009 SAS Institute Inc. All Rights Reserved.