Class ScriptAttributes
- Version:
- 8.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionScriptAttributes(Map<String, Object> _mAttributes, boolean _bModifiable, String _sScope) Creates a new instance of ScriptAttributes. -
Method Summary
Modifier and TypeMethodDescriptionReturns a specified attribute ornullif the attribute doesn't exist.Returns a specified attribute or a specified default value if the attribute doesn't exist.voidSets an attribute to a specified value.voidCopies all attributes from a specifiedMapinto this attribute collection.voidRemoves a specified attribute from the collection.
-
Constructor Details
-
ScriptAttributes
Creates a new instance of ScriptAttributes.- Parameters:
_mAttributes- the collection of named attributes_bModifiable- decides whether collection of attributes is modifiable_sScope- scope name of the attribute, used only for error message texts
-
-
Method Details
-
put
public void put(String _sName, Object _value) throws UnsupportedOperationException, NullPointerException Sets an attribute to a specified value. If an attribute with the specified name already exists in the collection it is replaced by the new value.CAUTION: Be careful when storing a modifiable object. If such object is fetched and modified by a session script, the modification is visible by all sessions. Since the modification is performed concurrently with other sessions, usually some means of locking is required while doing the modification.The script is responsible for implementing common programming techniques which ensure thread-safeness when accessing such objects.
- Parameters:
_sName- the name of the attribute_value- the attribute's value- Throws:
UnsupportedOperationException- if the collection of attributes is not modifiableNullPointerException- if the passed attribute name isnull
-
putAll
public void putAll(Map<String, Object> _mAttributes) throws UnsupportedOperationException, NullPointerExceptionCopies all attributes from a specifiedMapinto this attribute collection. If an attribute already existed in the collection it is replaced by the new value.CAUTION: Be careful when adding attributes with modifiable objects. If such object is fetched and modified by a session script, the modification is visible by all sessions. Since the modification is perfomed concurrently with other sessions, usually some means of locking is required while doing the modification. The script is responsible for implementing common programming techniques which ensure thread-safeness when accessing such objects.
- Parameters:
_mAttributes- the attributes to add- Throws:
UnsupportedOperationException- if the collection of attributes is not modifiableNullPointerException- if the passed attribute name isnull
-
get
Returns a specified attribute or a specified default value if the attribute doesn't exist.CAUTION: Be careful when fetching a modifiable object. If such object is modified by a session script, the modification is visible by all sessions. Since the modification is performed concurrently with other sessions, usually some means of locking is required while doing the modification. The script is responsible for implementing common programming techniques which ensure thread-safeness when accessing such objects.
- Parameters:
_sName- the name of the attribute- Throws:
NullPointerException- if the passed attribute name isnull
-
get
Returns a specified attribute ornullif the attribute doesn't exist.CAUTION: Be careful when fetching a modifiable object. If such object is modified by a session script, the modification is visible by all sessions. Since the modification is performed concurrently with other sessions, usually some means of locking is required while doing the modification. The script is responsible for implementing common programming techniques which ensure thread-safeness when accessing such objects.
-
remove
Removes a specified attribute from the collection.- Parameters:
_sName- the name of the attribute- Throws:
UnsupportedOperationException- if the collection of attributes is not modifiableNullPointerException- if the passed attribute name isnull
-