com.ibm.wbiserver.brules.mgmt

Interface PropertyList

All Superinterfaces:
BusinessRuleChangeDetector, java.lang.Iterable<Property>, java.io.Serializable

  1. public interface PropertyList
  2. extends BusinessRuleChangeDetector, java.io.Serializable, java.lang.Iterable<Property>
This interface represents a list of properties. Specific methods are provided for getting an iterator over the list, to get the element at a specified index, and to add and remove elements from the list. In order to change an existing Property in the list, obtain the Property that you want to change using either an iterator or the get method and then simply use set methods to change the object. Note that only UserDefinedProperty objects are changeable so you must check the subclass of the Property object before you can change it.

This class also has methods to create a new UserDefinedProperty object.


Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
COPYRIGHT

Method Summary

Modifier and Type Method and Description
  1. void
addProperty(UserDefinedProperty newProperty)
Add the specified property to the list.
  1. Property
get(int index)
Get the property at the specified index in the list.
  1. Property
getByName(java.lang.String propertyName)
Get the property with the specified name from the list.
  1. boolean
isEmpty()
Determine whether or not this list is empty.
  1. java.util.Iterator<Property>
iterator()
Get an iterator over this list.
  1. UserDefinedProperty
newUserDefinedProperty(java.lang.String name,java.lang.String value)
Create a new UserDefinedProperty object with the specified name and value.
  1. boolean
removeProperty(UserDefinedProperty property)
Remove the specified user-defined property from the list.
  1. UserDefinedProperty
removePropertyByName(java.lang.String propertyName)
Remove the user-defined property with the specified name from the list.
  1. void
setPropertyValue(java.lang.String name,java.lang.String value)
Set the value of the property with the specified name to the specified value.
  1. int
size()
Get the number of properties in this list.
Methods inherited from interface com.ibm.wbiserver.brules.mgmt.BusinessRuleChangeDetector
hasChanges

Field Detail

  1. static final java.lang.String COPYRIGHT
See Also:

Method Detail

iterator

  1. java.util.Iterator<Property> iterator( )
Get an iterator over this list. The iterator returned does not support making changes to the underlying list, i.e. it does not support the remove method of the Iterator interface. If that method is called, an UnsupportedOperationException is thrown.

In order to add or remove elements from the list, the addProperty or removeProperty methods should be used. These two methods synchronize on this PropertyList object. If the client code is multi-threaded, then the client should synchronize on the PropertyList object while using the iterator.

Specified by:
iterator in interface java.lang.Iterable<Property>
Returns:
An iterator over the underlying list that does not support modifications.

get

  1. Property get(int index)
Get the property at the specified index in the list.
Parameters:
index - The index of the property to be returned. The first element in the list is at index 0.
Returns:
The Property object at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range.

getByName

  1. Property getByName(java.lang.String propertyName)
Get the property with the specified name from the list. If there is no property with the specified name in this list, null is returned.
Parameters:
propertyName - The name of the property to retrieve. Must not be null.
Returns:
The Property object from this list with the specified name. null if no such Property exists.
Throws:
java.lang.IllegalArgumentException - if the propertyName argument is null.

newUserDefinedProperty

  1. UserDefinedProperty newUserDefinedProperty( java.lang.String name,
  2. java.lang.String value)
Create a new UserDefinedProperty object with the specified name and value. No validation is performed on either the name or the value. The name will be validated when the user-defined property is added to a PropertyList to ensure that it is unique in that list. The value is completely defined by the user and hence is never validated by the API.
Parameters:
name - The name of the new user-defined property. Must not be null and must contain at least one non-whitespace character.
value - The value for the new user-defined property. Must not be null.
Returns:
A new UserDefinedProperty object with the specified name and value.
Throws:
java.lang.IllegalArgumentException - if name is null or does not contain at least one non-whitespace character, or if value is null.

addProperty

  1. void addProperty(UserDefinedProperty newProperty)
  2. throws ValidationException
Add the specified property to the list. This method synchronizes on the object on which it is called. Clients using an iterator to iterate over the list should also synchronize on this object to ensure thread safety.

Note: this method is not intended to change the value of an existing property. To change the value of an existing property, simply get the Property object that you want to change and use its set methods.

Parameters:
newProperty - The Property object to be added to the list. A new UserDefinedProperty object can be created using the newUserDefinedProperty method on this interface.
Throws:
ValidationException - if there is already a property with the specified name in this list.
java.lang.IllegalArgumentException - if newProperty is null.

removeProperty

  1. boolean removeProperty(UserDefinedProperty property)
Remove the specified user-defined property from the list. If the specified user-defined property does not exist in the list, then no action is taken and the list remains unchanged.

This method synchronizes on the object on which it is called. Clients using an iterator to iterate over the list should also synchronize on this object to ensure thread-safety.

Parameters:
property - The UserDefinedProperty to be removed. Must not be null.
Returns:
true if the PropertyList contained the specified property. Otherwise false.

removePropertyByName

  1. UserDefinedProperty removePropertyByName( java.lang.String propertyName)
Remove the user-defined property with the specified name from the list. If no user-defined property exists with the specified name, then no action is taken and the list remains unchanged.

This method synchronizes on the object on which it is called. Clients using an iterator to iterate over the list should also synchronize on this object to ensure thread-safety.

Parameters:
propertyName - The name of the user-defined property to be removed. Must not be null.
Returns:
The UserDefinedProperty object that was removed from the list. If no UserDefinedProperty was found with the specified name, then null is return.

setPropertyValue

  1. void setPropertyValue(java.lang.String name,
  2. java.lang.String value)
Set the value of the property with the specified name to the specified value. If a user-defined property with the specified name already exists, then its value is changed to the specified value. If no property exists with the specified name, then a new property is defined with the specified name and value. If the specified value is null and the property is currently defined, then the property will be removed from this business rule group. If the specified value is null and the property is not currently defined, then no action is taken. If a system-defined property exists with the specified name, then a SystemPropertyNotChangeableException is thrown.

This method synchronizes on the object on which it is called. Clients using an iterator to iterate over the list should also synchronize on this object to ensure thread-safety.

Parameters:
name - The name of the property whose value is to be set. Must not be null or the zero-length string.
value - The value that the property should be set to. May be null.
Throws:
java.lang.IllegalArgumentException - if the name parameter is null or is the zero-length string.
SystemPropertyNotChangeableException - if a property with the specified name already exists and it is system-defined.

size

  1. int size()
Get the number of properties in this list.
Returns:
The number of properties in this list.

isEmpty

  1. boolean isEmpty()
Determine whether or not this list is empty.
Returns:
true if this list is empty; otherwise false.