Package org.nuxeo.ecm.core.schema
Class DocumentTypeImpl
java.lang.Object
org.nuxeo.ecm.core.schema.types.AbstractType
org.nuxeo.ecm.core.schema.types.ComplexTypeImpl
org.nuxeo.ecm.core.schema.types.CompositeTypeImpl
org.nuxeo.ecm.core.schema.DocumentTypeImpl
- All Implemented Interfaces:
Serializable
,DocumentType
,ComplexType
,CompositeType
,Type
Implementation of a document type.
- See Also:
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.schema.types.CompositeTypeImpl
schemas
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
ConstructorDescriptionDocumentTypeImpl
(String name) DocumentTypeImpl
(String name, DocumentType superType, List<Schema> schemas, Collection<String> facets, PrefetchInfo prefetchInfo) Constructs a document type. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of types that can effectively be created inside this type.Gets all the facets of this document type.Returns the types of the children that cannot be created inside this type.Gets the prefetch info, or null if no prefetch is defined.Returns the types of the children that can be created inside this type.boolean
hasAllowedSubtype
(String subtype) Returnstrue
if the givensubtype
type can effectively be created inside this type.boolean
Returnstrue
if this document type has the givenfacetName
facet,false otherwise
.boolean
hasForbiddenSubtype
(String subtype) Returnstrue
if the givensubtype
type was forbidden from being created inside this type.boolean
hasSubtype
(String subtype) Returnstrue
if the givensubtype
type was explicitly allowed to be created inside this type.boolean
isFile()
Tests whether this type describes a document (not a folder!)boolean
isFolder()
Tests whether this type describes a folder or not.boolean
Tests whether this type describe an ordered folder or not.void
setForbiddenSubtypes
(Collection<String> forbiddenSubtypes) Sets the types of the children that cannot be created inside the this type.void
setPrefetchInfo
(PrefetchInfo prefetchInfo) void
setSubtypes
(Collection<String> subtypes) Sets the types of the children that can be created inside the this type.Methods inherited from class org.nuxeo.ecm.core.schema.types.CompositeTypeImpl
getField, getSchema, getSchemaNames, getSchemas, hasSchema, hasSchemas, isComplexType, isCompositeType
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, getField, getFields, getFieldsCount, getNamespace, hasField, hasFields
Methods inherited from interface org.nuxeo.ecm.core.schema.types.CompositeType
getSchema, getSchemaNames, getSchemas, hasSchema, hasSchemas
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
-
Field Details
-
facets
-
prefetchInfo
-
subtypes
-
forbiddenSubtypes
-
allowedSubtypes
-
-
Constructor Details
-
DocumentTypeImpl
public DocumentTypeImpl(String name, DocumentType superType, List<Schema> schemas, Collection<String> facets, PrefetchInfo prefetchInfo) Constructs a document type. Schemas and facets must include those from the super type. -
DocumentTypeImpl
-
-
Method Details
-
setPrefetchInfo
-
getPrefetchInfo
Description copied from interface:DocumentType
Gets the prefetch info, or null if no prefetch is defined.If the prefetch info is not null, the caller should use it when instantiating a document to preload the fields defined by the prefetch info.
If no prefetch is specified by the document type, the caller is free to use a default prefetch info or no prefetch at all.
- Specified by:
getPrefetchInfo
in interfaceDocumentType
- Returns:
- the prefetch info or null
-
isFile
public boolean isFile()Description copied from interface:DocumentType
Tests whether this type describes a document (not a folder!) or not.- Specified by:
isFile
in interfaceDocumentType
- Returns:
- true if the type describes a document folder, otherwise returns false
-
isFolder
public boolean isFolder()Description copied from interface:DocumentType
Tests whether this type describes a folder or not.- Specified by:
isFolder
in interfaceDocumentType
- Returns:
- true if the type describes a folder, otherwise returns false
-
isOrdered
public boolean isOrdered()Description copied from interface:DocumentType
Tests whether this type describe an ordered folder or not.- Specified by:
isOrdered
in interfaceDocumentType
- Returns:
- true if the type describes an ordered folder, otherwise returns false
-
getFacets
Description copied from interface:DocumentType
Gets all the facets of this document type.Facets inherited from parents are taken into account.
- Specified by:
getFacets
in interfaceDocumentType
- Returns:
- the facets
-
hasFacet
Description copied from interface:DocumentType
Returnstrue
if this document type has the givenfacetName
facet,false otherwise
.- Specified by:
hasFacet
in interfaceDocumentType
-
getSubtypes
Description copied from interface:DocumentType
Returns the types of the children that can be created inside this type.- Specified by:
getSubtypes
in interfaceDocumentType
-
setSubtypes
Description copied from interface:DocumentType
Sets the types of the children that can be created inside the this type.- Specified by:
setSubtypes
in interfaceDocumentType
-
hasSubtype
Description copied from interface:DocumentType
Returnstrue
if the givensubtype
type was explicitly allowed to be created inside this type.- Specified by:
hasSubtype
in interfaceDocumentType
-
getForbiddenSubtypes
Description copied from interface:DocumentType
Returns the types of the children that cannot be created inside this type.- Specified by:
getForbiddenSubtypes
in interfaceDocumentType
-
setForbiddenSubtypes
Description copied from interface:DocumentType
Sets the types of the children that cannot be created inside the this type.- Specified by:
setForbiddenSubtypes
in interfaceDocumentType
-
hasForbiddenSubtype
Description copied from interface:DocumentType
Returnstrue
if the givensubtype
type was forbidden from being created inside this type.- Specified by:
hasForbiddenSubtype
in interfaceDocumentType
-
getAllowedSubtypes
Description copied from interface:DocumentType
Returns the list of types that can effectively be created inside this type. Allowed types results from the exclusion of the forbidden subtypes from the subtypes.- Specified by:
getAllowedSubtypes
in interfaceDocumentType
-
hasAllowedSubtype
Description copied from interface:DocumentType
Returnstrue
if the givensubtype
type can effectively be created inside this type.- Specified by:
hasAllowedSubtype
in interfaceDocumentType
-