commonj.connector.metadata.discovery.properties
Interface SingleValuedProperty

All Superinterfaces:
Cloneable, Property, PropertyDescriptor, SingleTypedProperty
All Known Subinterfaces:
BindingTypeProperty, FileProperty, FolderProperty, JavaTypeProperty, SchemaTypeProperty

public interface SingleValuedProperty
extends SingleTypedProperty, Cloneable

An interface for a single typed property that can hold only one value. An example would be a property that represents a single Integer value.

Since:
1.0

Method Summary
 Object getValue()
          Returns the current set value for the property.
 String getValueAsString()
          Returns the current set value for the property as a String value.
 void setValue(Object newValue)
          Sets the current value for the property.
 void setValueAsString(String newValue)
          Sets the current value for the property using a String value.
 
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
 

Method Detail

getValue

Object getValue()
Returns the current set value for the property.

Returns:
Object the current value of the property.

setValue

void setValue(Object newValue)
              throws MetadataException
Sets the current value for the property.

Parameters:
newValue - - the value to be set
Throws:
MetadataException - - thrown if an error occurs or if the set was refused. Properties may place limitations on what values may be set. In particular, some properties will refuse to set null values, while others will impose restrictions on the type of values that may be set. A MetadataException must always be thrown in cases where the value specified was refused. Ideally, the message field of the MetadataException would indicate the reason for refusal.

getValueAsString

String getValueAsString()
Returns the current set value for the property as a String value. The string value returned must be semantically equivalent to the complete object instance it represents. In other words, the object instance, and its state, must be recreateable using the string value.

Returns:
The current value of the property represented as a String.

setValueAsString

void setValueAsString(String newValue)
                      throws MetadataException
Sets the current value for the property using a String value. The string value used must be semantically equivalent to the complete object instance it represents. In other words, the object instance, and its state, must be re-creatable using the string value. The behavior of this method is identical to the setValue(Object) method.

Parameters:
newValue - - the value to set.
Throws:
MetadataException - - thrown if an error occurs or if the set was refused. Properties may place limitations on what values may be set. In particular, some properties will refuse to set null values, while others will impose restrictions on the type of values that may be set. A MetadataException must always be thrown in cases where the value specified was refused. Ideally, the message field of the MetadataException would indicate the reason for refusal.
See Also:
setValue(Object)