Interface ListType

All Superinterfaces:
Serializable, Type
All Known Implementing Classes:
ListTypeImpl

public interface ListType extends Type
A list of typed objects.

The List type can validate java array and/or java Collection.

  • Method Details

    • getFieldType

      Type getFieldType()
      Get the field describing the element type the list accept.
      Returns:
      the field describing the list element types
    • getFieldName

      String getFieldName()
      The field name if any was specified.

      This is used to more for outputting the list as XML and for compatibility with XSD.

      Returns:
      the field name
    • getField

      Field getField()
      Get the field defining the elements stored by this list.
      Returns:
      the field
    • getMinCount

      int getMinCount()
      Gets the required minimum count of elements in this list.
      Returns:
      the minimum count of required elements
    • getMaxCount

      int getMaxCount()
      Gets the required maximum count of allowed elements in this list.
      Returns:
      the maximum count of allowed elements
    • getDefaultValue

      Object getDefaultValue()
      Gets the default value of the list elements, if any.
      Returns:
      the default value or null if none
    • setDefaultValue

      void setDefaultValue(String value)
      Sets the default value encoded as a string.
    • setLimits

      void setLimits(int minOccurs, int maxOccurs)
      Sets list limits.
    • isArray

      boolean isArray()
      Whether the instances of this list are arrays.
    • isScalarList

      boolean isScalarList()
      This method is provided for compatibility. Existing code is mapping scalar lists to arrays but this should be changed in order to map only explicit scalar list (those declared using xs:list) to arrays and not all list that have scalar items.
      Returns:
      true if the list items are of a scalar type TODO FIXME XXX remove the method and use instead isArray