Package org.nuxeo.ecm.core.schema.types
Class CompositeTypeImpl
- java.lang.Object
-
- org.nuxeo.ecm.core.schema.types.AbstractType
-
- org.nuxeo.ecm.core.schema.types.ComplexTypeImpl
-
- org.nuxeo.ecm.core.schema.types.CompositeTypeImpl
-
- All Implemented Interfaces:
Serializable
,ComplexType
,CompositeType
,Type
- Direct Known Subclasses:
DocumentTypeImpl
public class CompositeTypeImpl extends ComplexTypeImpl implements CompositeType
A Composite Type resolves fields for several schemas.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Schema>
schemas
The schemas for this composite type.-
Fields inherited from class org.nuxeo.ecm.core.schema.types.ComplexTypeImpl
fields, fieldsByName, ns
-
Fields inherited from class org.nuxeo.ecm.core.schema.types.AbstractType
constraints, EMPTY_SUPERTYPES, name, schema, superType
-
-
Constructor Summary
Constructors Constructor Description CompositeTypeImpl(CompositeType superType, String schema, String name, List<Schema> schemaList)
Constructs a composite type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Field
getField(QName name)
Gets the field having the given name.Schema
getSchema(String name)
Gets the composite type schema given its name.String[]
getSchemaNames()
Gets the schema names of this type.Collection<Schema>
getSchemas()
Gets all the schemas (including inherited schemas) of this composite type.boolean
hasSchema(String name)
Checks if this composite type has the given schema.boolean
hasSchemas()
Checks if this composite type has any schema defined.boolean
isComplexType()
Tests whether this type is a complex type.boolean
isCompositeType()
Tests whether this is a composite type.-
Methods inherited from class org.nuxeo.ecm.core.schema.types.ComplexTypeImpl
addField, addField, canonicalXPath, convert, getField, getFields, getFieldsCount, getNamespace, hasField, hasFields, newInstance, toString, validate
-
Methods inherited from class org.nuxeo.ecm.core.schema.types.AbstractType
addConstraints, decode, encode, getConstraints, getName, getObjectResolver, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAny, isAnyType, isListType, isSimpleType, isSuperTypeOf, validateConstraints
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.schema.types.ComplexType
addField, getField, getFields, getFieldsCount, getNamespace, hasField, hasFields
-
Methods inherited from interface org.nuxeo.ecm.core.schema.types.Type
convert, decode, encode, getConstraints, getName, getObjectResolver, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isListType, isSimpleType, isSuperTypeOf, newInstance, validate
-
-
-
-
Constructor Detail
-
CompositeTypeImpl
public CompositeTypeImpl(CompositeType superType, String schema, String name, List<Schema> schemaList)
Constructs a composite type. Schemas must include those from the super type.
-
-
Method Detail
-
hasSchemas
public boolean hasSchemas()
Description copied from interface:CompositeType
Checks if this composite type has any schema defined.- Specified by:
hasSchemas
in interfaceCompositeType
- Returns:
- true if this composite type has some schemas defined, false otherwise
-
getSchema
public Schema getSchema(String name)
Description copied from interface:CompositeType
Gets the composite type schema given its name.- Specified by:
getSchema
in interfaceCompositeType
- Parameters:
name
- the schema name- Returns:
- the schema if any or null if none was found
-
hasSchema
public boolean hasSchema(String name)
Description copied from interface:CompositeType
Checks if this composite type has the given schema.- Specified by:
hasSchema
in interfaceCompositeType
- Parameters:
name
- the schema name- Returns:
- true if the composite type has this schema, false otherwise
-
getSchemaNames
public String[] getSchemaNames()
Description copied from interface:CompositeType
Gets the schema names of this type.- Specified by:
getSchemaNames
in interfaceCompositeType
- Returns:
- the schema names
-
getSchemas
public Collection<Schema> getSchemas()
Description copied from interface:CompositeType
Gets all the schemas (including inherited schemas) of this composite type.- Specified by:
getSchemas
in interfaceCompositeType
- Returns:
- the composite type schemas
-
getField
public Field getField(QName name)
Description copied from interface:ComplexType
Gets the field having the given name.- Specified by:
getField
in interfaceComplexType
- Overrides:
getField
in classComplexTypeImpl
- Parameters:
name
- the name- Returns:
- the field or null if no field with that name was found
-
isComplexType
public boolean isComplexType()
Description copied from interface:Type
Tests whether this type is a complex type.- Specified by:
isComplexType
in interfaceType
- Overrides:
isComplexType
in classComplexTypeImpl
- Returns:
- true if this type is a complex type, false otherwise
-
isCompositeType
public boolean isCompositeType()
Description copied from interface:Type
Tests whether this is a composite type.- Specified by:
isCompositeType
in interfaceType
- Overrides:
isCompositeType
in classAbstractType
- Returns:
- true if this is a composite type, false otherwise
-
-