edu.iu.iv.core.property
Class Property

java.lang.Object
  |
  +--edu.iu.iv.core.property.Property
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
URLProperty

public class Property
extends java.lang.Object
implements java.lang.Comparable

Author:
Team IVC

Constructor Summary
Property(java.lang.String name)
           
Property(java.lang.String name, java.lang.Class acceptableClass)
           
Property(java.lang.String name, java.lang.Class acceptableClass, int priority)
           
 
Method Summary
 int compareTo(java.lang.Object object)
           
 java.lang.Class getAcceptableClass()
          get the class that is to be used to describe this property.
 java.lang.String getName()
          get the diaplayable name of the property.
 int getPriority()
          get the priority of this property.
 boolean isPropertyValueAcceptable(java.lang.Object value)
          Returns whether the given object is acceptable as a property value for this property.
 java.lang.String toString(java.lang.Object value)
          Takes a value for this property and returns its string representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Property

public Property(java.lang.String name)

Property

public Property(java.lang.String name,
                java.lang.Class acceptableClass)

Property

public Property(java.lang.String name,
                java.lang.Class acceptableClass,
                int priority)
Method Detail

getName

public java.lang.String getName()
get the diaplayable name of the property.

Returns:
name the property name.

getAcceptableClass

public java.lang.Class getAcceptableClass()
get the class that is to be used to describe this property. The PropertyMap will only accept objects of this type when setting a plugin property for a plugin.

Returns:
the acceptable class for this Property

getPriority

public int getPriority()
get the priority of this property. this value is used to weight (lower is better) how important the property is and if properties are to be listed, what order to go in.

Returns:
the priority

isPropertyValueAcceptable

public boolean isPropertyValueAcceptable(java.lang.Object value)
Returns whether the given object is acceptable as a property value for this property.

Parameters:
value - the proposed value for this property
Returns:
if the value is acceptable

toString

public java.lang.String toString(java.lang.Object value)
Takes a value for this property and returns its string representation. Subclasses can override this if it needs to do more than just value.toString() (eg. Lists, Maps, custom data...)

Parameters:
value - the property value
Returns:
the string representation of that value.

compareTo

public int compareTo(java.lang.Object object)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)