public class FieldConfig extends SimplePropertyConfig
Unless bound is set to false, a field is bound to a property of its closest parent bean object.
Position must be set for all fields in record, or for none of them. If not set, position is determined based on the order in which the fields are added to the record.
Modifier and Type | Field and Description |
---|---|
static String |
LEFT
Left justification setting
|
static String |
RIGHT
Right justification setting
|
JSON_TYPE_ARRAY, JSON_TYPE_BOOLEAN, JSON_TYPE_NONE, JSON_TYPE_NUMBER, JSON_TYPE_OBJECT, JSON_TYPE_STRING
Constructor and Description |
---|
FieldConfig()
Constructs a new FieldConfig.
|
Modifier and Type | Method and Description |
---|---|
char |
getComponentType()
Returns the component type.
|
String |
getDefault()
Returns the textual representation of the default value for
this field when the field is not present or empty during unmarshalling.
|
String |
getJustify()
Returns the justification of this field.
|
Integer |
getLength()
Returns the length of this field in characters.
|
String |
getLiteral()
Returns the static text for this field, or null if
the field text is not static.
|
Integer |
getMaxLength()
Returns the maximum length of this field in characters.
|
Integer |
getMinLength()
Returns the minimum length of this field in characters, or null
if a minimum length should not be enforced.
|
Character |
getPadding()
Returns the character used to pad this field.
|
String |
getRegex()
Returns the regular expression pattern for validating the field text
during unmarshalling.
|
boolean |
isKeepPadding()
Returns whether a fixed length field should keep its padding
when unmarshalled.
|
boolean |
isLenientPadding()
Sets whether padding length is enforced for fixed length formatted streams.
|
boolean |
isRef()
Returns true if this field is referenced by another component.
|
boolean |
isRequired()
Returns true if this field is required when unmarshalled.
|
boolean |
isTrim()
Returns whether field text should be trimmed before validation
and type conversion.
|
void |
setDefault(String text)
Sets the textual representation of the default value of
this field when the field is not present or empty during unmarshalling.
|
void |
setJustify(String justify)
Sets the justification of this field.
|
void |
setKeepPadding(boolean keepPadding)
Sets whether a fixed length field should keep its padding when unmarshalled.
|
void |
setLength(Integer length)
Sets the length of this field in characters.
|
void |
setLenientPadding(boolean lenientPadding)
Sets whether the padding length is enforced for fixed length formatted streams.
|
void |
setLiteral(String literal)
Sets the static text for this field.
|
void |
setMaxLength(Integer maxLength)
Sets the maximum length of this field in characters.
|
void |
setMinLength(Integer minLength)
Sets the minimum length of this field in characters, or null
if a minimum length should not be enforced.
|
void |
setPadding(Character padding)
Sets the character used to pad this field.
|
void |
setRef(boolean ref)
Sets whether this field is referenced by another component.
|
void |
setRegex(String pattern)
Sets the regular expression pattern for validating the field text
during unmarshalling.
|
void |
setRequired(boolean required)
Set to true if this field is required when unmarshalled.
|
void |
setTrim(boolean trim)
Sets whether field text should be trimmed before validation
and type conversion.
|
getFormat, getTypeHandler, getTypeHandlerInstance, setFormat, setTypeHandler, setTypeHandlerInstance
getCollection, getGetter, getJsonArrayIndex, getJsonName, getJsonType, getKey, getLabel, getMaxOccurs, getMaxOccursRef, getMaxSize, getMinOccurs, getMinOccursRef, getMinSize, getOccursRef, getPosition, getSetter, getType, getUntil, getXmlType, isBound, isCollection, isIdentifier, isJsonArray, isLazy, isNillable, isRepeating, isSupportedChild, setBound, setCollection, setGetter, setIdentifier, setJsonArray, setJsonArrayIndex, setJsonName, setJsonType, setLabel, setLazy, setMaxOccurs, setMaxOccursRef, setMaxSize, setMinOccurs, setMinOccursRef, setMinSize, setNillable, setOccursRef, setPosition, setSetter, setType, setUntil, setXmlType
getOrdinal, getXmlName, getXmlNamespace, getXmlPrefix, isXmlNamespaceAware, setOrdinal, setXmlName, setXmlNamespace, setXmlNamespaceAware, setXmlPrefix
add, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, print, setName, size, sort, toParamString, toString, updateReferences
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final String LEFT
public static final String RIGHT
public char getComponentType()
ComponentConfig
getComponentType
in class ComponentConfig
ComponentConfig.GROUP
, ComponentConfig.RECORD
, ComponentConfig.SEGMENT
, ComponentConfig.FIELD
,
ComponentConfig.CONSTANT
or ComponentConfig.WRAPPER
public String getDefault()
public void setDefault(String text)
text
- the default value (as text)public Integer getMinLength()
public void setMinLength(Integer minLength)
minLength
- the minimum length, or null if not enforcedpublic Integer getMaxLength()
public void setMaxLength(Integer maxLength)
maxLength
- the maximum length, or null if not enforcedpublic boolean isTrim()
public void setTrim(boolean trim)
trim
- true if field text should be trimmedpublic String getLiteral()
public void setLiteral(String literal)
literal
- the literal text of the fieldpublic String getRegex()
public void setRegex(String pattern)
pattern
- the regular expression patternpublic boolean isRequired()
public void setRequired(boolean required)
required
- true if this field is requiredpublic Integer getLength()
public void setLength(Integer length)
length
- the length of this fieldpublic Character getPadding()
public void setPadding(Character padding)
padding
- the character used to pad this fieldpublic String getJustify()
public void setJustify(String justify)
public boolean isKeepPadding()
public void setKeepPadding(boolean keepPadding)
keepPadding
- true to keep field padding, false otherwisepublic boolean isLenientPadding()
public void setLenientPadding(boolean lenientPadding)
lenientPadding
- true if not enforced, false otherwisepublic boolean isRef()
public void setRef(boolean ref)
ref
- true if referenced