Class FieldBuilder

    • Constructor Detail

      • FieldBuilder

        public FieldBuilder​(java.lang.String name)
        Constructs a new FieldBuilder.
        Parameters:
        name - the field name
    • Method Detail

      • rid

        public FieldBuilder rid()
        Indicates this field is used to identify the record.
        Returns:
        this
      • at

        public FieldBuilder at​(int at)
        Sets the position of the field.
        Parameters:
        at - the position
        Returns:
        this
      • until

        public FieldBuilder until​(int until)
        Sets the maximum position of this field if it repeats an indeterminate number of times
        Parameters:
        until - the maximum position
        Returns:
        this FieldBuilder
      • trim

        public FieldBuilder trim()
        Indicates the field text should be trimmed before validation and type conversion.
        Returns:
        this FieldBuilder
      • required

        public FieldBuilder required()
        Indicates this field is required and must contain at least one character.
        Returns:
        this FieldBuilder
      • occursRef

        public FieldBuilder occursRef​(java.lang.String ref)
        Indicates the number of occurrences of this field is governed by another field.
        Parameters:
        ref - the name of the field that governs the occurrences of this field
        Returns:
        this FieldBuilder
      • minLength

        public FieldBuilder minLength​(int n)
        Sets the minimum expected length of the field text.
        Returns:
        this FieldBuilder
      • maxLength

        public FieldBuilder maxLength​(int n)
        Sets the maximum expected length of the field text.
        Returns:
        this FieldBuilder
      • regex

        public FieldBuilder regex​(java.lang.String pattern)
        Sets the regular expression the field text must match.
        Returns:
        this FieldBuilder
      • literal

        public FieldBuilder literal​(java.lang.String literal)
        Sets the literal text the field text must match.
        Returns:
        this FieldBuilder
      • defaultValue

        public FieldBuilder defaultValue​(java.lang.String value)
        Sets the default value of this field.
        Returns:
        this FieldBuilder
      • format

        public FieldBuilder format​(java.lang.String pattern)
        Sets the pattern used to format this field by the type handler.
        Parameters:
        pattern - the pattern
        Returns:
        this FieldBuilder
      • ignore

        public FieldBuilder ignore()
        Indicates this field is not bound to a property of the class assigned to its parent record or segment.
        Returns:
        this FieldBuilder
      • length

        public FieldBuilder length​(int length)
        Sets the padded length of this field.
        Parameters:
        length - the length
        Returns:
        this FieldBuilder
      • padding

        public FieldBuilder padding​(char c)
        Sets the character used to pad this field. Defaults to a space.
        Parameters:
        c - the padding character
        Returns:
        this FieldBuilder
      • keepPadding

        public FieldBuilder keepPadding()
        Indicates this field should not be unpadded during unmarshalling.
        Returns:
        this FieldBuilder
      • lenientPadding

        public FieldBuilder lenientPadding()
        Indicates the padding length should not be enforced for this field. Only applies to fixed length formatted streams.
        Returns:
        this FieldBuilder
      • align

        public FieldBuilder align​(Align align)
        Sets the alignment or justification of this field if padded.
        Parameters:
        align - the alignment
        Returns:
        this FieldBuilder
      • nillable

        public FieldBuilder nillable()
        Indicates this field is nillable for XML formatted streams.
        Returns:
        this FieldBuilder
      • typeHandler

        public FieldBuilder typeHandler​(java.lang.String name)
        Sets the type handler used for parsing and formatting field text.
        Parameters:
        name - the type handler name
        Returns:
        this FieldBuilder
      • typeHandler

        public FieldBuilder typeHandler​(java.lang.Class<? extends TypeHandler> handler)
        Sets the type handler used for parsing and formatting field text.
        Parameters:
        handler - the type handler class
        Returns:
        this FieldBuilder
      • build

        public FieldConfig build()
        Builds this field.
        Returns:
        the field configuration