Interface MultiLineField

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getLine​(int line)
      Returns a specific line from the field's value.
      java.lang.String getLine​(int line, int offset)
      Returns a specific line from the field's value.

      java.util.List<java.lang.String> getLines()
      Returns the field value split into lines.
      java.util.List<java.lang.String> getLines​(int offset)
      Returns the field value starting at the offset component, split into lines.
      java.util.List<java.lang.String> getLinesBetween​(int start, int end)
      Returns a specific subset of lines from the field's value, given a range.
      java.util.List<java.lang.String> getLinesBetween​(int start, int end, int offset)
      Returns a specific subset of lines from the field's value, starting at the offset component.
    • Method Detail

      • getLine

        java.lang.String getLine​(int line)
        Returns a specific line from the field's value.
        Parameters:
        line - a reference to a specific line in the field, first line being 1
        Returns:
        line content or null if not present or if line number is above the expected
        Since:
        7.7
        See Also:
        getLine(int, int)
      • getLine

        java.lang.String getLine​(int line,
                                 int offset)
        Returns a specific line from the field's value.

        Performs a semantic line retrieval based on the field components definition, so this is not the same as just splitting the value in lines and getting one of the lines with an index.
        If the field defines the first line components as optional and those components are not present in the particular field instance, then getLine(1) will return null because according to the field definition the first line is not present.

        Also notice that a line may be composed by several components, there is no linear relation between component numbers and lines numbers.

        The offset parameter is used to count lines from a specific component instead of the first one, and it is particularly useful when combined with the component static names, for example getLine(1, Field35B.DESCRIPTION) Notice than if the query includes a component offset, the result will not contain prefix component separators. If the line for example starts with a slash character it will be removed. This is to avoid meaningless separators for components that are being skipped because of the offset parameter.

        Parameters:
        line - a reference to a specific line in the field, first line being 1
        offset - an optional component number used as offset when counting lines
        Returns:
        line content or null if not present, if line number is above the expected or if the offset is invalid
        Since:
        7.7
      • getLines

        java.util.List<java.lang.String> getLines()
        Returns the field value split into lines.
        Returns:
        found lines or empty list if value is empty
        Since:
        7.7
      • getLines

        java.util.List<java.lang.String> getLines​(int offset)
        Returns the field value starting at the offset component, split into lines.
        Parameters:
        offset - an optional component number used as offset when counting lines
        Returns:
        found lines or empty list if lines are not present or the offset is invalid
        Since:
        7.7
      • getLinesBetween

        java.util.List<java.lang.String> getLinesBetween​(int start,
                                                         int end)
        Returns a specific subset of lines from the field's value, given a range.
        Parameters:
        start - a reference to a specific line in the field, first line being 1
        end - a reference to a specific line in the field, must be greater than start
        Returns:
        found lines or empty list if value is empty
        Since:
        7.7
        See Also:
        getLinesBetween(int, int, int)
      • getLinesBetween

        java.util.List<java.lang.String> getLinesBetween​(int start,
                                                         int end,
                                                         int offset)
        Returns a specific subset of lines from the field's value, starting at the offset component.
        Parameters:
        start - a reference to a specific line in the field, first line being 1
        end - a reference to a specific line in the field, must be greater than start
        offset - an optional component number used as offset when counting lines
        Returns:
        found lines or empty list if lines are not present or the offset is invalid
        Since:
        7.7