Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.schema.types
Interface ListType

All Superinterfaces:
Serializable, Type, ValueConverter
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.

Author:
Bogdan Stefanescu

Field Summary
 
Fields inherited from interface org.nuxeo.ecm.core.schema.types.Type
ANY
 
Method Summary
 Object getDefaultValue()
          Gets the default value of the list elements, if any.
 Field getField()
          Get the field defining the elements stored by this list.
 String getFieldName()
          The field name if any was specified.
 Type getFieldType()
          Get the field describing the element type the list accept.
 int getMaxCount()
          Gets the required maximum count of allowed elements in this list.
 int getMinCount()
          Gets the required minimum count of elements in this list.
 TypeRef<ListType> getRef()
          Gets a proxy (or reference to this type).
 boolean isArray()
          Whether the instances of this list are arrays.
 boolean isScalarList()
          This method is provided for compatibility.
 void setDefaultValue(String value)
          Sets the default value encoded as a string.
 void setLimits(int minOccurs, int maxOccurs)
          Sets list limits.
 
Methods inherited from interface org.nuxeo.ecm.core.schema.types.Type
decode, encode, getHelper, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isComplexType, isCompositeType, isListType, isNotNull, isReadOnly, isSimpleType, isSuperTypeOf, newInstance, validate
 
Methods inherited from interface org.nuxeo.ecm.core.schema.types.ValueConverter
convert
 

Method Detail

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.

Parameters:
value -

setLimits

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

Parameters:
minOccurs -
maxOccurs -

getRef

TypeRef<ListType> getRef()
Description copied from interface: Type
Gets a proxy (or reference to this type).

Specified by:
getRef in interface Type
Returns:
a reference to the type

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

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.