com.mentata.sg8
Class SG8DiscreteAttribute
java.lang.Object
com.mentata.l3d.L3DAttribute
com.mentata.sg8.SG8StringAttribute
com.mentata.sg8.SG8DiscreteAttribute
- All Implemented Interfaces:
- Comparator, SG8Attribute
- Direct Known Subclasses:
- SG8BooleanAttribute, SG8LangAttribute
- public class SG8DiscreteAttribute
- extends SG8StringAttribute
An attribute with a defined set of possible values for use with SG8 objects.
This attribute type is assigned a set of possible values. Attribute update form elements will be selection boxes, and new values are checked against permitted ones before being added. Instances can also be configured to display labels in the selection box to hide raw values.
- Since:
- 0.7
- Author:
- Jon Roberts
|
Method Summary |
String |
getUpdateHTML()
Returns HTML selection elements for updating or adding values. |
| Methods inherited from class com.mentata.l3d.L3DAttribute |
addValue, compare, getAttribute, getBind, getContext, getLabel, getLengthThreshold, getName, getObject, getObject, getPrerequisites, getShortValues, getSize, getThreshold, getValues, initialize, isBound, isExceeded, isGenerated, isLengthExceeded, isMultivalue, isRequired, removeValue, same, setGenerated, setLabel, setLengthThreshold, setPrerequisites, setThreshold, setValues |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SG8DiscreteAttribute
public SG8DiscreteAttribute()
- Constructs an empty discrete attribute.
SG8DiscreteAttribute
public SG8DiscreteAttribute(String[] options)
- Constructs an empty attribute updated with a specific range of values.
- Parameters:
options - the possible values for the attribute
SG8DiscreteAttribute
public SG8DiscreteAttribute(String[] options,
String[] labels)
- Constructs an empty attribute updated with a specific range of values and labels.
- Parameters:
options - the possible values for the attributelabels - the corresponding display labels for each value
getUpdateHTML
public String getUpdateHTML()
throws SG8Exception
- Returns HTML selection elements for updating or adding values.
- Specified by:
getUpdateHTML in interface SG8Attribute- Overrides:
getUpdateHTML in class SG8StringAttribute
- Returns:
- the HTML modification form elements
- Throws:
SG8Exception - if the attribute is generated