commonj.connector.metadata.discovery.properties
Interface PropertyType

All Superinterfaces:
Cloneable

public interface PropertyType
extends Cloneable

The interface that describes the nature of a property.

Since:
1.0

Method Summary
 Object getDefaultValue()
          Returns the default value for this property.
 Class getType()
          Returns the Java type represented by the property.
 Object[] getValidValues()
          Returns an array of valid values that can be set on this property.
 String[] getValidValuesAsStrings()
          Returns an array of the valid String values that can be set on this property.
 boolean isExpert()
          Indicates if this property is an Expert or Advanced property.
 boolean isHidden()
          Indicates if this property is a hidden one.
 boolean isPrimitive()
          Indicates if this property is a primitive type.
 boolean isReadOnly()
          Indicates if this property is a read only one that should not be set or altered.
 boolean isRequired()
          Indicates that a user must set a value for this property.
 boolean isSensitive()
          Indicates if the property contents should be displayed in a obsfucated manner.
 boolean isValidValuesEditable()
          Indicates whether the list of valid values returned from getValidValues(), or getValidValuesAsStrings(), are the only possible set of values for the property.
 

Method Detail

getType

Class getType()
Returns the Java type represented by the property. It is assumed that all native types are represented by their Object wrappers.
(For example: int is wrapped by java.lang.Integer)

Returns:
the non null class of the Java type represented by the property.

isHidden

boolean isHidden()
Indicates if this property is a hidden one. A hidden property is a property that is not intended to be visible to a user to manipulate. An analogy is hidden fields on an HTML form. Tool environments should never render hidden properties in their UI interfaces.

Returns:
a boolean a flag indicating if the property is hidden or not.

isReadOnly

boolean isReadOnly()
Indicates if this property is a read only one that should not be set or altered.

Returns:
a boolean flag indicating if the property is read only.

isExpert

boolean isExpert()
Indicates if this property is an Expert or Advanced property. Indicates that user should use care when setting values on this field. This flag can be used as a hint for tool environments to hide this property and only show it as an advanced property that is available if the UI is in advanced editing mode.

If it is a commonly set property this should return false.

Returns:
a boolean flag indicating if this property

isPrimitive

boolean isPrimitive()
Indicates if this property is a primitive type. This is only applicable if the type of the property is one of the primitive type object wrappers. For example: java.lang.Integer

Returns:
a boolean flag indicating if this property represents a primitive type.

getDefaultValue

Object getDefaultValue()
Returns the default value for this property.

Returns:
returns an object representing the default value for the property or null if no default exists.

getValidValues

Object[] getValidValues()
Returns an array of valid values that can be set on this property. Returns null if there are no recommended values for the property. Tool environments must also check the isValidValuesEditable()method if this method returns a non null array of recommended values. If isValidValueseEditable() returns false then the array of recommended values returned by this method are the only possible set of values for the property.

Returns:
an array of valid values that can be set on this property. Returns null if there are no recommended values for the property.
See Also:
isValidValuesEditable()

isSensitive

boolean isSensitive()
Indicates if the property contents should be displayed in a obsfucated manner. Password properties are an example of this. Sensitive properties must not have their contents displayed in plain text, and must be obsfucated in some way to avoid being copied.

Consumers of sensitive properties should never persist the values without taking appropriate security measures such as encryption. An example would be a ConnectionPersistence implementation storing the password value of a particular connection configuration.

Returns:
a boolean flag indicating if this property is sensitive or not.

isRequired

boolean isRequired()
Indicates that a user must set a value for this property.

Returns:
a boolean flag indicating if this property is required to be set by the user or not.

getValidValuesAsStrings

String[] getValidValuesAsStrings()
Returns an array of the valid String values that can be set on this property. The string values returned must be semantically equivalent to the complete object instances they represent. In other words, the object instance, and its state, must be re-creatable using the string value. This method behaves identically as getValidValues().

Returns:
A String array of valid values that can be set on this property. Returns null if there are no recommended values for the property.
See Also:
method., MultiValuedProperty.addValueAsString(String)

isValidValuesEditable

boolean isValidValuesEditable()
Indicates whether the list of valid values returned from getValidValues(), or getValidValuesAsStrings(), are the only possible set of values for the property. In other words, can values other than the set of defined valid values be used to set on the property. This information can be used by user interfaces to decide whether to show the property as an editable combo box or a non-editable one for example.

Returns:
a boolean flag indicating if the set of recommended property values is the only set of values that may be set on the property.