public class FieldBuilder extends PropertyBuilderSupport<FieldBuilder>
Modifier and Type | Field and Description |
---|---|
protected FieldConfig |
config |
Constructor and Description |
---|
FieldBuilder(String name)
Constructs a new FieldBuilder.
|
Modifier and Type | Method and Description |
---|---|
FieldBuilder |
align(Align align)
Sets the alignment or justification of this field if padded.
|
FieldBuilder |
at(int at)
Sets the position of the field.
|
FieldConfig |
build()
Builds this field.
|
FieldBuilder |
defaultValue(String value)
Sets the default value of this field.
|
FieldBuilder |
format(String pattern)
Sets the pattern used to format this field by the type handler.
|
protected FieldConfig |
getConfig()
Returns the configuration settings.
|
FieldBuilder |
ignore()
Indicates this field is not bound to a property of the class assigned
to its parent record or segment.
|
FieldBuilder |
keepPadding()
Indicates this field should not be unpadded during unmarshalling.
|
FieldBuilder |
length(int length)
Sets the padded length of this field.
|
FieldBuilder |
lenientPadding()
Indicates the padding length should not be enforced for this field.
|
FieldBuilder |
literal(String literal)
Sets the literal text the field text must match.
|
FieldBuilder |
maxLength(int n)
Sets the maximum expected length of the field text.
|
protected FieldBuilder |
me()
Returns this.
|
FieldBuilder |
minLength(int n)
Sets the minimum expected length of the field text.
|
FieldBuilder |
nillable()
Indicates this field is nillable for XML formatted streams.
|
FieldBuilder |
occursRef(String ref)
Indicates the number of occurrences of this field is governed by another field.
|
FieldBuilder |
padding(char c)
Sets the character used to pad this field.
|
FieldBuilder |
regex(String pattern)
Sets the regular expression the field text must match.
|
FieldBuilder |
required()
Indicates this field is required and must contain at least one character.
|
FieldBuilder |
rid()
Indicates this field is used to identify the record.
|
FieldBuilder |
trim()
Indicates the field text should be trimmed before validation and type conversion.
|
FieldBuilder |
typeHandler(Class<? extends TypeHandler> handler)
Sets the type handler used for parsing and formatting field text.
|
FieldBuilder |
typeHandler(String name)
Sets the type handler used for parsing and formatting field text.
|
FieldBuilder |
typeHandler(TypeHandler handler)
Sets the type handler used for parsing and formatting field text.
|
FieldBuilder |
until(int until)
Sets the maximum position of this field if it repeats an
indeterminate number of times
|
collection, getter, lazy, maxOccurs, minOccurs, occurs, occurs, setter, type, xmlName, xmlNamespace, xmlPrefix, xmlType
protected FieldConfig config
public FieldBuilder(String name)
name
- the field nameprotected FieldBuilder me()
PropertyBuilderSupport
me
in class PropertyBuilderSupport<FieldBuilder>
protected FieldConfig getConfig()
PropertyBuilderSupport
getConfig
in class PropertyBuilderSupport<FieldBuilder>
public FieldBuilder rid()
public FieldBuilder at(int at)
at
- the positionpublic FieldBuilder until(int until)
until
- the maximum positionFieldBuilder
public FieldBuilder trim()
FieldBuilder
public FieldBuilder required()
FieldBuilder
public FieldBuilder occursRef(String ref)
ref
- the name of the field that governs the occurrences of this fieldFieldBuilder
public FieldBuilder minLength(int n)
FieldBuilder
public FieldBuilder maxLength(int n)
FieldBuilder
public FieldBuilder regex(String pattern)
FieldBuilder
public FieldBuilder literal(String literal)
FieldBuilder
public FieldBuilder defaultValue(String value)
FieldBuilder
public FieldBuilder format(String pattern)
pattern
- the patternFieldBuilder
public FieldBuilder ignore()
FieldBuilder
public FieldBuilder length(int length)
length
- the lengthFieldBuilder
public FieldBuilder padding(char c)
c
- the padding characterFieldBuilder
public FieldBuilder keepPadding()
FieldBuilder
public FieldBuilder lenientPadding()
FieldBuilder
public FieldBuilder align(Align align)
align
- the alignmentFieldBuilder
public FieldBuilder nillable()
FieldBuilder
public FieldBuilder typeHandler(String name)
name
- the type handler nameFieldBuilder
public FieldBuilder typeHandler(Class<? extends TypeHandler> handler)
handler
- the type handler classFieldBuilder
public FieldBuilder typeHandler(TypeHandler handler)
handler
- the TypeHandler
FieldBuilder
public FieldConfig build()