commonj.connector.metadata.discovery.properties
Interface Property

All Superinterfaces:
Cloneable, PropertyDescriptor
All Known Subinterfaces:
BindingTypeProperty, BoundedMultiValuedProperty, FileProperty, FolderProperty, JavaTypeProperty, MultiFileProperty, MultiFolderProperty, MultiJavaTypeProperty, MultiSchemaTypeProperty, MultiValuedProperty, NodeProperty, SchemaTypeProperty, SingleTypedProperty, SingleValuedProperty, TableProperty

public interface Property
extends PropertyDescriptor, Cloneable

An interface that represents an actual property who's value can be set.

Since:
1.0

Method Summary
 String getValidationMessage()
          Returns a validation message that indicates why the property value has become invalid.
 boolean isSet()
          Indicates if the value of this property has been set.
 boolean isValid()
          Indicates if the current value of the property is valid.
 void unSet()
          Resets the value of this property to its default value.
 
Methods inherited from interface commonj.connector.metadata.discovery.properties.PropertyDescriptor
addPropertyChangeListener, clone, getDescription, getDisplayName, getID, getName, isEnabled, removePropertyChangeListener
 

Method Detail

isSet

boolean isSet()
Indicates if the value of this property has been set.

For TreeProperty, or TableProperty, this indicates if any change has occured from its original state. For example a table cell value being changed.

Returns:
a boolean flag indicating if the value of the property has been explicitly set.

unSet

void unSet()
Resets the value of this property to its default value. This will cause the isSet() to return false. If the property is a multi valued property then this has the effect of clearing the contents of the property.


isValid

boolean isValid()
Indicates if the current value of the property is valid. A property's value may be initially valid. However as a result of events occuring over time, or other property value settings, the initial value may become invalid.

For all required properties, this method must only return true if the property has been set with a valid value, or if the property's default value is a valid value to use. Required properties are identified using the PropertyType.isRequired() method.

For a NodeProperty this method must only return true when the configuration properties of the node, as well as all its children, are all valid. It is up to the implementation to decide whether the configuration properties must always be valid, or only valid when the NodeProperty is selected.

For a TableProperty this method must only return true when all the cells within the table are valid.

Returns:
a boolean flag indicating if the current value of the property is valid.

getValidationMessage

String getValidationMessage()
Returns a validation message that indicates why the property value has become invalid. This method should only be called if isValid() returns false. Tool environments can use this message to inform the user of why the property value got invalidated and thus offer a better understanding on how to correct the value.

This is a locale specific object that must be separated to a ResourceBundle, translated, and retrieved using the locale of the tool environment.

Returns:
a non null String message if isValid() returns false. If isValid returns true then null is returned.
See Also:
ResourceBundle, MessageFormat