Class ListTypeImpl

    • Method Detail

      • setLimits

        public void setLimits​(int minOccurs,
                              int maxOccurs)
        Description copied from interface: ListType
        Sets list limits.
        Specified by:
        setLimits in interface ListType
      • getFieldName

        public String getFieldName()
        Description copied from interface: ListType
        The field name if any was specified.

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

        Specified by:
        getFieldName in interface ListType
        Returns:
        the field name
      • getFieldType

        public Type getFieldType()
        Description copied from interface: ListType
        Get the field describing the element type the list accept.
        Specified by:
        getFieldType in interface ListType
        Returns:
        the field describing the list element types
      • getField

        public Field getField()
        Description copied from interface: ListType
        Get the field defining the elements stored by this list.
        Specified by:
        getField in interface ListType
        Returns:
        the field
      • getMinCount

        public int getMinCount()
        Description copied from interface: ListType
        Gets the required minimum count of elements in this list.
        Specified by:
        getMinCount in interface ListType
        Returns:
        the minimum count of required elements
      • getMaxCount

        public int getMaxCount()
        Description copied from interface: ListType
        Gets the required maximum count of allowed elements in this list.
        Specified by:
        getMaxCount in interface ListType
        Returns:
        the maximum count of allowed elements
      • isListType

        public boolean isListType()
        Description copied from interface: Type
        Tests whether this type is a list type.
        Specified by:
        isListType in interface Type
        Overrides:
        isListType in class AbstractType
        Returns:
        true if is a list type, false otherwise
      • decode

        public Object decode​(String string)
        Description copied from interface: Type
        Decodes the string representation into an object of this type.

        Returns null if the string can not be decoded.

        Specified by:
        decode in interface Type
        Overrides:
        decode in class AbstractType
        Parameters:
        string - the string to decode
        Returns:
        the converted object that can be use as a value for an object of this type or null if the given object cannot be converted
      • validate

        public boolean validate​(Object object)
                         throws TypeException
        Description copied from interface: Type
        Tests whether the given object is of this type.
        Specified by:
        validate in interface Type
        Overrides:
        validate in class AbstractType
        Parameters:
        object - the object to test
        Returns:
        true if the given object if of this type, false otherwise
        Throws:
        TypeException - if an error occurs trying to retrieve the supertypes
      • convert

        public Object convert​(Object object)
                       throws TypeException
        Description copied from interface: Type
        Converts the given value to an object compatible with the associated type.
        Specified by:
        convert in interface Type
        Parameters:
        object - the value to convert
        Returns:
        the converted value
        Throws:
        TypeException - if the value to convert is not compatible with the associated type
      • isArray

        public boolean isArray()
        Description copied from interface: ListType
        Whether the instances of this list are arrays.
        Specified by:
        isArray in interface ListType
      • isScalarList

        public boolean isScalarList()
        Description copied from interface: ListType
        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.
        Specified by:
        isScalarList in interface ListType
        Returns:
        true if the list items are of a scalar type TODO FIXME XXX remove the method and use instead isArray