public class IntFieldDesc extends FieldDesc<java.lang.Integer>
Constructor and Description |
---|
IntFieldDesc()
Default constructor with no arguments, useful for cases where the
descriptor is configured from XML elements.
|
IntFieldDesc(java.lang.String fieldName)
Constructor taking a field name.
|
IntFieldDesc(java.lang.String fieldName,
int min,
int max)
Constructor taking a field name and a range.
|
Modifier and Type | Method and Description |
---|---|
DataType |
getFieldType()
Get the field type for this field description
|
int |
getMaxValue()
Get the maximum value allowed by this descriptor.
|
int |
getMinValue()
Get the minimum value allowed by this descriptor.
|
boolean |
isValid(java.lang.Integer value)
Return whether a field value is valid.
|
java.lang.Integer |
parse(java.lang.String stringVal)
Parse the value into the format for this field description.
|
java.lang.Integer |
parseValueIntoRecord(DataRecord rec,
java.lang.String value)
Parse the string value, and store it in an integer field in the
specified data record.
|
protected void |
setValues(org.w3c.dom.NodeList valueList)
Set the values for this Integer field description.
|
void |
storeDefaultIntoRecord(DataRecord rec)
Store the default value into the data record provided.
|
org.w3c.dom.Element |
toXml(org.w3c.dom.Document doc)
Convert this field description to an XML Element.
|
addSourceField, applyTransform, getDefaultValue, getFieldName, getLookupIndexField, getLookupTable, getLookupValueField, getSourceFields, getTransform, isMultiValue, loadFromXml, setDefaultValue, setFieldName, setMultiValue
public IntFieldDesc()
public IntFieldDesc(java.lang.String fieldName)
fieldName
- the field name for this descriptorpublic IntFieldDesc(java.lang.String fieldName, int min, int max)
fieldName
- the field name for this descriptormin
- the minimum valuemax
- the maximum valuepublic DataType getFieldType()
getFieldType
in class FieldDesc<java.lang.Integer>
public int getMaxValue()
public int getMinValue()
public boolean isValid(java.lang.Integer value)
public java.lang.Integer parse(java.lang.String stringVal) throws java.text.ParseException
public java.lang.Integer parseValueIntoRecord(DataRecord rec, java.lang.String value) throws java.text.ParseException
parseValueIntoRecord
in class FieldDesc<java.lang.Integer>
rec
- the DataRecord to parse the value intovalue
- the String value to be parsedjava.text.ParseException
- if the value cannot be parsed properlyjava.lang.IllegalArgumentException
- if the value is not a valid value of
this Enumerated Value fieldprotected void setValues(org.w3c.dom.NodeList valueList)
maxValue
or
maxValue
to specify the maximum and minimum values accepted
by this field.public void storeDefaultIntoRecord(DataRecord rec)
storeDefaultIntoRecord
in class FieldDesc<java.lang.Integer>
rec
- the DataRecord to store the value intopublic org.w3c.dom.Element toXml(org.w3c.dom.Document doc)
fieldDef
element, sets the fieldName and fieldType, and
creates a values child element. The values element contains the optional
maxValue and minValue text nodes. If the default value is set, this
method adds it as well.