public class DocumentTypeImpl extends CompositeTypeImpl implements DocumentType
Modifier and Type | Field and Description |
---|---|
protected Set<String> |
allowedSubtypes |
protected Set<String> |
facets |
protected Set<String> |
forbiddenSubtypes |
protected PrefetchInfo |
prefetchInfo |
protected Set<String> |
subtypes |
schemas
fields, fieldsByName, ns
constraints, EMPTY_SUPERTYPES, name, schema, superType
Constructor and Description |
---|
DocumentTypeImpl(String name) |
DocumentTypeImpl(String name,
DocumentType superType,
List<Schema> schemas,
Collection<String> facets,
PrefetchInfo prefetchInfo)
Constructs a document type.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getAllowedSubtypes()
Returns the list of types that can effectively be created inside this type.
|
Set<String> |
getFacets()
Gets all the facets of this document type.
|
Set<String> |
getForbiddenSubtypes()
Returns the types of the children that cannot be created inside this type.
|
PrefetchInfo |
getPrefetchInfo()
Gets the prefetch info, or null if no prefetch is defined.
|
Set<String> |
getSubtypes()
Returns the types of the children that can be created inside this type.
|
boolean |
hasAllowedSubtype(String subtype)
Returns
true if the given subtype type can effectively be created inside this type. |
boolean |
hasFacet(String facetName)
Returns
true if this document type has the given facetName facet, false otherwise . |
boolean |
hasForbiddenSubtype(String subtype)
Returns
true if the given subtype type was forbidden from being created inside this type. |
boolean |
hasSubtype(String subtype)
Returns
true if the given subtype type was explicitly allowed to be created inside this type. |
boolean |
isFile()
Tests whether this type describes a document (not a folder!) or not.
|
boolean |
isFolder()
Tests whether this type describes a folder or not.
|
boolean |
isOrdered()
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.
|
getField, getSchema, getSchemaNames, getSchemas, hasSchema, hasSchemas, isComplexType, isCompositeType, validate
addField, addField, canonicalXPath, convert, getField, getFields, getFieldsCount, getNamespace, hasField, hasFields, newInstance, toString, validateMap
addConstraints, decode, encode, getConstraints, getName, getObjectResolver, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAny, isAnyType, isListType, isSimpleType, isSuperTypeOf, validateConstraints
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSchema, getSchemaNames, getSchemas, hasSchema, hasSchemas
addField, getField, getField, getFields, getFieldsCount, getNamespace, hasField, hasFields
convert, decode, encode, getConstraints, getName, getObjectResolver, getSchema, getSchemaName, getSuperType, getTypeHierarchy, isAnyType, isComplexType, isCompositeType, isListType, isSimpleType, isSuperTypeOf, newInstance, validate
protected PrefetchInfo prefetchInfo
protected Set<String> forbiddenSubtypes
protected Set<String> allowedSubtypes
public DocumentTypeImpl(String name, DocumentType superType, List<Schema> schemas, Collection<String> facets, PrefetchInfo prefetchInfo)
public DocumentTypeImpl(String name)
public void setPrefetchInfo(PrefetchInfo prefetchInfo)
public PrefetchInfo getPrefetchInfo()
DocumentType
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.
getPrefetchInfo
in interface DocumentType
public boolean isFile()
DocumentType
isFile
in interface DocumentType
public boolean isFolder()
DocumentType
isFolder
in interface DocumentType
public boolean isOrdered()
DocumentType
isOrdered
in interface DocumentType
public Set<String> getFacets()
DocumentType
Facets inherited from parents are taken into account.
getFacets
in interface DocumentType
public boolean hasFacet(String facetName)
DocumentType
true
if this document type has the given facetName
facet, false otherwise
.hasFacet
in interface DocumentType
public Set<String> getSubtypes()
DocumentType
getSubtypes
in interface DocumentType
public void setSubtypes(Collection<String> subtypes)
DocumentType
setSubtypes
in interface DocumentType
public boolean hasSubtype(String subtype)
DocumentType
true
if the given subtype
type was explicitly allowed to be created inside this type.hasSubtype
in interface DocumentType
public Set<String> getForbiddenSubtypes()
DocumentType
getForbiddenSubtypes
in interface DocumentType
public void setForbiddenSubtypes(Collection<String> forbiddenSubtypes)
DocumentType
setForbiddenSubtypes
in interface DocumentType
public boolean hasForbiddenSubtype(String subtype)
DocumentType
true
if the given subtype
type was forbidden from being created inside this type.hasForbiddenSubtype
in interface DocumentType
public Set<String> getAllowedSubtypes()
DocumentType
getAllowedSubtypes
in interface DocumentType
public boolean hasAllowedSubtype(String subtype)
DocumentType
true
if the given subtype
type can effectively be created inside this type.hasAllowedSubtype
in interface DocumentType
Copyright © 2018 Nuxeo. All rights reserved.