Package org.nuxeo.ecm.core.schema.types
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 javaCollection
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.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
convert, decode, encode, getConstraints, getName, getObjectResolver, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isComplexType, isCompositeType, isListType, isSimpleType, isSuperTypeOf, newInstance, validate
-
-
-
-
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.
-
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
-
-