Annotation Type Segment


  • @Retention(RUNTIME)
    @Target({FIELD,METHOD})
    public @interface Segment
    Segment annotation applied to class members or methods.
    Since:
    2.1.0
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      int at
      The absolute position of the segment.
      java.lang.Class<?> collection
      The collection class bound to this segment, if one cannot be derived from the annotated field or method.
      java.lang.String getter
      The getter method.
      java.lang.String key
      The name of a child component to use for the key value if this segment is bound to a Map.
      boolean lazy
      Whether the class bound to this segment should be instantiated if all child fields are null or empty strings.
      int maxOccurs
      The maximum occurrences.
      int minOccurs
      The minimum occurrences.
      java.lang.String name
      The segment name.
      boolean nillable
      Whether the element is nillable.
      java.lang.String occursRef
      The name of a preceding field that governs the number of occurrences of this segment.
      int ordinal
      The relative position of the segment.
      java.lang.String setter
      The setter method.
      java.lang.Class<?> type
      The class bound to this segment, if one cannot be derived from the annotated field or method.
      int until
      The maximum position of a segment that repeats for an indeterminate number of times.
      java.lang.String value
      The name of a child component to use for the value of this segment in lieu of a type.
      java.lang.String xmlName
      The XML attribute or element name.
      java.lang.String xmlNamespace
      The XML namespace URI of this segment.
      java.lang.String xmlPrefix
      The XML namespace prefix of this segment.
      XmlType xmlType
      The XML type of this segment.
    • Element Detail

      • name

        java.lang.String name
        The segment name.
        Returns:
        the segment name
        Default:
        ""
      • at

        int at
        The absolute position of the segment.
        Returns:
        the absolute position
        Default:
        -2147483648
      • until

        int until
        The maximum position of a segment that repeats for an indeterminate number of times.
        Returns:
        the maximum position
        Default:
        -2147483648
      • ordinal

        int ordinal
        The relative position of the segment.
        Returns:
        the relative position
        Default:
        -2147483648
      • getter

        java.lang.String getter
        The getter method.
        Returns:
        the getter method name
        Default:
        ""
      • setter

        java.lang.String setter
        The setter method.
        Returns:
        the setter method name
        Default:
        ""
      • type

        java.lang.Class<?> type
        The class bound to this segment, if one cannot be derived from the annotated field or method.
        Returns:
        the class
        Default:
        java.lang.Void.class
      • lazy

        boolean lazy
        Whether the class bound to this segment should be instantiated if all child fields are null or empty strings. Also causes empty collections to returned as null.
        Returns:
        whether the segment is lazily created
        Default:
        false
      • collection

        java.lang.Class<?> collection
        The collection class bound to this segment, if one cannot be derived from the annotated field or method.
        Returns:
        the collection class
        Default:
        java.lang.Void.class
      • minOccurs

        int minOccurs
        The minimum occurrences.
        Returns:
        the minimum occurrences
        Default:
        -2147483648
      • maxOccurs

        int maxOccurs
        The maximum occurrences.
        Returns:
        the maximum occurrences, or -1 if unbounded
        Default:
        -2147483648
      • occursRef

        java.lang.String occursRef
        The name of a preceding field that governs the number of occurrences of this segment. Does not apply to XML formatted streams.
        Returns:
        the name of the field
        Default:
        ""
      • key

        java.lang.String key
        The name of a child component to use for the key value if this segment is bound to a Map.
        Returns:
        the component name of the key
        Default:
        ""
      • value

        java.lang.String value
        The name of a child component to use for the value of this segment in lieu of a type.
        Returns:
        the component name of the value
        Default:
        ""
      • xmlType

        XmlType xmlType
        The XML type of this segment.
        Returns:
        the XmlType
        Default:
        org.beanio.builder.XmlType.DEFAULT
      • xmlName

        java.lang.String xmlName
        The XML attribute or element name.
        Returns:
        the XML name
        Default:
        "{undefined}"
      • xmlPrefix

        java.lang.String xmlPrefix
        The XML namespace prefix of this segment.
        Returns:
        the namespace prefix
        Default:
        "{undefined}"
      • xmlNamespace

        java.lang.String xmlNamespace
        The XML namespace URI of this segment.
        Returns:
        the namespace URI
        Default:
        "{undefined}"
      • nillable

        boolean nillable
        Whether the element is nillable.
        Returns:
        true if nillable, false otherwise
        Default:
        false