|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MultiValuedProperty
A property descriptor that represents a multiple valued property such as an array, vector, collection, etc. A MultiValuedProperty has no bounds on the size of values it can hold.
Field Summary | |
---|---|
static int |
MULTI_SELECT
Constant indicating many values can be selected. |
static int |
SINGLE_SELECT
Constant indicating that only one value can be selected. |
Method Summary | |
---|---|
void |
addValue(Object value)
Appends the specified value to the end of this list of values for the property. |
void |
addValue(Object value,
int index)
Inserts the specified value at the specified position in this properties list of values. |
void |
addValueAsString(String value)
Adds a value to the current set of values for the property. |
void |
addValueAsString(String value,
int index)
Adds a value to the current set of values for the property. |
boolean |
allowDuplicateValues()
Returns boolean indicating if duplicate values are allowed. |
Object |
get(int index)
Returns the value at the specified position in this property. |
int |
getSelectionStyle()
Returns one of the enumerated selection constants: SINGLE_SELECT ,
or MULTI_SELECT . |
Object[] |
getValues()
Returns the current set of values for the property. |
String[] |
getValuesAsStrings()
Returns the current set of values for the property as String values. |
Object |
removeValue(int index)
Removes the element at the specified position in this list (optional operation). |
boolean |
removeValue(Object value)
Removes the first occurrence in this property of the specified value. |
boolean |
removeValueAsString(String value)
Removes a value from the current set of values for the property.The string value used must be semantically equivalent to the complete object instance it represents. |
void |
setSelection(int[] indices)
Sets the currently selected values in this property. |
Methods inherited from interface commonj.connector.metadata.discovery.properties.SingleTypedProperty |
---|
getPropertyType |
Methods inherited from interface commonj.connector.metadata.discovery.properties.Property |
---|
getValidationMessage, isSet, isValid, unSet |
Methods inherited from interface commonj.connector.metadata.discovery.properties.PropertyDescriptor |
---|
addPropertyChangeListener, clone, getDescription, getDisplayName, getID, getName, isEnabled, removePropertyChangeListener |
Field Detail |
---|
static final int SINGLE_SELECT
static final int MULTI_SELECT
Method Detail |
---|
Object[] getValues()
null
array of the current set of
values for the property. If the property has no values set then
the array must be of length zero.void addValue(Object value) throws MetadataException
value
- -
the value to add.
MetadataException
- -
thrown if an error occurs or if the addition was refused.
Properties may place limitations on what values may be added
to them. In particular, some properties will refuse to add
null values, while others will impose restrictions on the
type of values that may be added. A MetadataException must
always be thrown in cases where the value addition was
refused. Ideally, the message field of the MetadataException
would indicate the reason for refusal.void addValue(Object value, int index) throws MetadataException, IndexOutOfBoundsException
value
- -
the value to add.index
- index at which the specified value is to be inserted.
IndexOutOfBoundsException
- if the index is out of range
MetadataException
- -
thrown if an error occurs or if the addition was refused.
Properties may place limitations on what values may be added
to them. In particular, some properties will refuse to add
null values, while others will impose restrictions on the
type of values that may be added. A MetadataException must
always be thrown in cases where the value addition was
refused. Ideally, the message field of the MetadataException
would indicate the reason for refusal.boolean removeValue(Object value)
(value==null ? get(i)==null : o.equals(get(i)))
(if such
an element exists).
value
- -
the value to remove.
Object removeValue(int index)
index
-
null
if none existed.String[] getValuesAsStrings()
null
String array of the current
set of values for the property. If the property has no values set
then the array must be of length zero.void addValueAsString(String value) throws MetadataException
addValue(Object)
method.
value
- -
the value to add.
MetadataException
- -
thrown if an error occurs or if the addition was refused.
Properties may place limitations on what values may be added
to them. In particular, some properties will refuse to add
null values, while others will impose restrictions on the
type of values that may be added. A MetadataException must
always be thrown in cases where the value addition was
refused. Ideally, the message field of the MetadataException
would indicate the reason for refusal.addValue(Object)
void addValueAsString(String value, int index) throws MetadataException, IndexOutOfBoundsException
addValue(Object, int)
method.
value
- -
the value to add.index
- index at which the specified value is to be inserted.
IndexOutOfBoundsException
- if the index is out of range
MetadataException
- thrown if an error occurs or if the addition was refused.
Properties may place limitations on what values may be added
to them. In particular, some properties will refuse to add
null values, while others will impose restrictions on the
type of values that may be added. A MetadataException must
always be thrown in cases where the value addition was
refused. Idealy, the message field of the MetadataException
would indicate the reason for refusal.addValue(Object, int)
boolean removeValueAsString(String value)
removeValue(Object)
method.
value
- -
the value to remove.
removeValue(Object)
Object get(int index) throws IndexOutOfBoundsException
index
- index of element to return.
IndexOutOfBoundsException
- if the index is out of rangevoid setSelection(int[] indices)
indices
- of currently selected values.boolean allowDuplicateValues()
true
if duplicate values are allowed, and false
if duplicate values are not allowed.int getSelectionStyle()
SINGLE_SELECT
,
or MULTI_SELECT
. This is used by tool environments
to determine the selection behaviour to permit when displaying the
values to users.
This is used with setSelection(int[])
and
PropertyEvent.MULTI_VALUED_PROPERTY_SELECTION
. Listeners will
know whether they need to support a selection with one or more values.
MULTI_SELECT
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |