public final class DocumentNoteField extends Object
DocumentNoteType) consists of one or more of these fields.
Constructed using the various create*NoteField factory methods in this class.| Modifier and Type | Class and Description |
|---|---|
static class |
DocumentNoteField.Types
All of the available note field types.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(SimpleListener listener)
Add a listener which will be notified when any changes are made to this field (eg.
|
static DocumentNoteField |
createBooleanNoteField(String name,
String description,
String code,
boolean allowUserModification)
Construct a DocumentNoteField that represents a boolean (true/false) value
|
static DocumentNoteField |
createDateNoteField(String name,
String description,
String code,
List<Constraint> constraints,
boolean allowUserModification)
Construct a DocumentNoteField that represents a date value
|
static DocumentNoteField |
createDecimalNoteField(String name,
String description,
String code,
List<Constraint> constraints,
boolean allowUserModification)
Construct a DocumentNoteField that represents a decimal (real number) value
|
static DocumentNoteField |
createEnumeratedNoteField(String[] enumerationValues,
String name,
String description,
String code,
boolean allowUserModification)
Construct a DocumentNoteField that represents a String (text) value that must be from a set of predefined values.
|
static DocumentNoteField |
createIntegerNoteField(String name,
String description,
String code,
List<Constraint> constraints,
boolean allowUserModification)
Construct a DocumentNoteField that represents an integer (whole number) value
|
static DocumentNoteField |
createTextNoteField(String name,
String description,
String code,
List<Constraint> constraints,
boolean allowUserModification)
Construct a DocumentNoteField that represents a String (text) value.
|
boolean |
equals(Object o) |
String |
getCode()
An internal code unique on each note type used for identifying this field.
|
List<Constraint> |
getConstraints()
These are enforced by
DocumentNote.setFieldValue(String, Object). |
String |
getDescription()
Getter for the document field's description property.
|
DocumentField |
getDocumentFieldCopy() |
String[] |
getEnumerationValues()
Provides an array of the possible values this field can take.
|
String |
getName()
Getter for the document field's name property.
|
Class |
getValueType()
Gets the class of the value represented by this field.
|
int |
hashCode() |
boolean |
isEnumeratedField()
An enumerated field can only take a value from a predifined set of values (of String type).
|
boolean |
isUserModificationAllowed()
If false then the user should not be allowed to modify or remove this note field
through any user interface.
|
void |
removeChangeListener(SimpleListener listener)
Remove a change listener added using
addChangeListener(org.virion.jam.util.SimpleListener). |
void |
setConstraints(List<Constraint> constraints)
Set constraints on the value that can be given to this field.
|
void |
setDescription(String description)
Setter for the document field's description property.
|
void |
setEnumerationValues(String[] enumerationValues)
Set the list of values that this field may take.
|
void |
setName(String name)
Setter for the document field's name property.
|
void |
setUserModificationAllowed(boolean modificationAllowed)
Sets whether users are allowed to modify or remove this field.
|
public DocumentField getDocumentFieldCopy()
DocumentField with the same properties as the one this DocumentNoteField is delegating to. Note that
subsequent calls to mutators on this object will mean that the returned DocumentField no longer reflects the internal DocumentField.public void setName(String name)
name - to setpublic void setDescription(String description)
description - to setpublic void setEnumerationValues(String[] enumerationValues)
isEnumeratedField()
will return true. This will replace any existing enumeration values.enumerationValues - to setpublic boolean isUserModificationAllowed()
public void setUserModificationAllowed(boolean modificationAllowed)
modificationAllowed - false to disallow users to modify or remove this field, true otherwisepublic List<Constraint> getConstraints()
DocumentNote.setFieldValue(String, Object). Never null.public void setConstraints(List<Constraint> constraints)
DocumentNote.setFieldValue(String, Object) will return false
if a value that doesn't meet the constraints is passed in for this
field.
This will replace all existing constraints.constraints - to setpublic String getCode()
public String getName()
public String getDescription()
public Class getValueType()
public String[] getEnumerationValues()
isEnumeratedField()public boolean isEnumeratedField()
DocumentNote.setFieldValue(String, Object) such that a note may
never have a value that is not in the enumeration values.getEnumerationValues()public void addChangeListener(SimpleListener listener)
removeChangeListener(org.virion.jam.util.SimpleListener).listener - public void removeChangeListener(SimpleListener listener)
addChangeListener(org.virion.jam.util.SimpleListener).listener - public static DocumentNoteField createTextNoteField(String name, String description, String code, List<Constraint> constraints, boolean allowUserModification)
name - of the fielddescription - of the fieldcode - of the field (must be a valid xml tag name - ie no spaces or unusual characters) and cannot contain '.' charactersconstraints - on the field's value, see getConstraints(). Must not be null, use empty list instead.allowUserModification - see isUserModificationAllowed()public static DocumentNoteField createBooleanNoteField(String name, String description, String code, boolean allowUserModification)
name - of the fielddescription - of the fieldcode - of the field (must be a valid xml tag name - ie no spaces or unusual characters) and cannot contain '.' charactersallowUserModification - see isUserModificationAllowed()public static DocumentNoteField createIntegerNoteField(String name, String description, String code, List<Constraint> constraints, boolean allowUserModification)
name - of the fielddescription - of the fieldcode - of the field (must be a valid xml tag name - ie no spaces or unusual characters) and cannot contain '.' charactersconstraints - on the field's value, see getConstraints(). Must not be null, use empty list instead.allowUserModification - see isUserModificationAllowed()public static DocumentNoteField createDecimalNoteField(String name, String description, String code, List<Constraint> constraints, boolean allowUserModification)
name - of the fielddescription - of the fieldcode - of the field (must be a valid xml tag name - ie no spaces or unusual characters) and cannot contain '.' charactersconstraints - on the field's value, see getConstraints(). Must not be null, use empty list instead.allowUserModification - see isUserModificationAllowed()public static DocumentNoteField createDateNoteField(String name, String description, String code, List<Constraint> constraints, boolean allowUserModification)
name - of the fielddescription - of the fieldcode - of the field (must be a valid xml tag name - ie no spaces or unusual characters) and cannot contain '.' characters. Must not be nullconstraints - on the field's value, see getConstraints(). Must not be null, use empty list instead.allowUserModification - see isUserModificationAllowed()public static DocumentNoteField createEnumeratedNoteField(String[] enumerationValues, String name, String description, String code, boolean allowUserModification)
enumerationValues - the set of values that this field may take, see getEnumerationValues().name - of the fielddescription - of the fieldcode - of the field (must be a valid xml tag name - ie no spaces or unusual characters) and cannot contain '.' charactersallowUserModification - see isUserModificationAllowed()