public class LongFieldDesc extends FieldDesc<java.lang.Long>
Constructor and Description |
---|
LongFieldDesc()
Default constructor with no arguments, useful for cases where the
descriptor is configured from XML elements.
|
LongFieldDesc(java.lang.String fieldName)
Constructor taking a field name.
|
LongFieldDesc(java.lang.String fieldName,
long min,
long 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
|
long |
getMaxValue()
Get the maximum value allowed by this descriptor.
|
long |
getMinValue()
Get the minimum value allowed by this descriptor.
|
boolean |
isValid(java.lang.Long value)
Return whether a field value is valid.
|
java.lang.Long |
parse(java.lang.String stringVal)
Parse the value into the format for this field description.
|
java.lang.Long |
parseValueIntoRecord(DataRecord rec,
java.lang.String value)
Parse the string value, and store it in an Long field in the specified
data record.
|
protected void |
setValues(org.w3c.dom.NodeList valueList)
Set the values for this Long 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 LongFieldDesc()
public LongFieldDesc(java.lang.String fieldName)
fieldName
- the field name for this descriptorpublic LongFieldDesc(java.lang.String fieldName, long min, long max)
fieldName
- the field name for this descriptormin
- the minimum valuemax
- the maximum valuepublic DataType getFieldType()
getFieldType
in class FieldDesc<java.lang.Long>
public long getMaxValue()
public long getMinValue()
public boolean isValid(java.lang.Long value)
public java.lang.Long parse(java.lang.String stringVal) throws java.text.ParseException
public java.lang.Long parseValueIntoRecord(DataRecord rec, java.lang.String value) throws java.text.ParseException
parseValueIntoRecord
in class FieldDesc<java.lang.Long>
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.Long>
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.