public interface ComplexType extends Type
Complex types can describe and validate java Map objects
.
Modifier and Type | Method and Description |
---|---|
Field |
addField(String name,
Type type,
String defaultValue,
int flags)
Adds a field to this complex type.
|
Field |
getField(QName name)
Gets the field having the given name.
|
Field |
getField(String name)
Gets the field with the given name.
|
Collection<Field> |
getFields()
Gets all fields as a (field name, field type) map.
|
int |
getFieldsCount()
Gets the number of fields defined for this complex type.
|
Namespace |
getNamespace()
Gets the namespace used by this complex type.
|
boolean |
hasField(String name)
Tests whether this type defines the given field name.
|
boolean |
hasFields()
Tests whether this type has any field defined.
|
convert, decode, encode, getName, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isComplexType, isCompositeType, isListType, isSimpleType, isSuperTypeOf, newInstance, validate
Namespace getNamespace()
Namespace.DEFAULT_NS
if none was
specifiedField getField(String name)
If the name is non-prefixed the first matching field is returned if any is found. If the name is prefixed then the right field is returned if any is found.
name
- the field nameField getField(QName name)
name
- the nameField addField(String name, Type type, String defaultValue, int flags)
If the given name is not prefixed it will be prefixed with the type prefix. If one was specified otherwise the default prefix will be used (e.g. "" - no prefix). If the given name is prefixed it will be stored as is (using the specified prefix).
name
- the field nametype
- the field typedefaultValue
- an optional default value (null if none)flags
- optional flagsboolean hasField(String name)
The name is supposed to be non prefixed.
name
- the field nameboolean hasFields()
If a complex type has no fields, it is considered as unstructured and it accepts any field with any type and name.
Collection<Field> getFields()
int getFieldsCount()
Copyright © 2013 Nuxeo SA. All Rights Reserved.