public class SchemaManagerImpl extends Object implements SchemaManager
Holds basic types (String, Integer, etc.), schemas, document types and facets.
Modifier and Type | Field and Description |
---|---|
protected List<TypeConfiguration> |
allConfigurations
All the registered configurations (prefetch).
|
protected List<DocumentTypeDescriptor> |
allDocumentTypes
All the registered document types.
|
protected List<FacetDescriptor> |
allFacets
All the registered facets.
|
protected List<ProxiesDescriptor> |
allProxies
All the registered proxy descriptors.
|
protected List<SchemaBindingDescriptor> |
allSchemas
All the registered schemas.
|
protected Map<String,Map<String,String>> |
deprecatedProperties |
protected boolean |
dirty
Whether there have been changes to the registered schemas, facets or document types that require recomputation of
the effective ones.
|
protected Map<String,DocumentTypeImpl> |
documentTypes
Effective document types.
|
protected Map<String,Set<String>> |
documentTypesExtending |
protected Map<String,Set<String>> |
documentTypesForFacet |
protected Map<String,CompositeType> |
facets
Effective facets.
|
protected Set<String> |
noPerDocumentQueryFacets |
protected PrefetchInfo |
prefetchInfo
Effective prefetch info.
|
protected Map<String,Schema> |
prefixToSchema |
protected Set<String> |
proxySchemaNames
Effective proxy schema names.
|
protected List<Schema> |
proxySchemas
Effective proxy schemas.
|
protected List<Runnable> |
recomputeCallbacks |
protected Map<String,Map<String,String>> |
removedProperties |
protected Map<String,Schema> |
schemas
Effective schemas.
|
static String |
SCHEMAS_DIR_NAME |
protected Map<String,Type> |
types
Basic type registry.
|
protected Map<String,Schema> |
uriToSchema |
Constructor and Description |
---|
SchemaManagerImpl() |
protected volatile boolean dirty
protected List<TypeConfiguration> allConfigurations
protected List<SchemaBindingDescriptor> allSchemas
protected List<FacetDescriptor> allFacets
protected List<DocumentTypeDescriptor> allDocumentTypes
protected List<ProxiesDescriptor> allProxies
protected PrefetchInfo prefetchInfo
protected final Map<String,Schema> uriToSchema
protected final Map<String,Schema> prefixToSchema
protected Map<String,CompositeType> facets
protected Set<String> noPerDocumentQueryFacets
protected Map<String,DocumentTypeImpl> documentTypes
protected Map<String,Set<String>> documentTypesExtending
protected Map<String,Set<String>> documentTypesForFacet
protected List<Schema> proxySchemas
protected Set<String> proxySchemaNames
public static final String SCHEMAS_DIR_NAME
protected List<Runnable> recomputeCallbacks
public SchemaManagerImpl()
protected void clearSchemaDir()
public File getSchemasDir()
protected void registerBuiltinTypes()
protected void registerType(Type type)
protected Collection<Type> getTypes()
public void registerConfiguration(TypeConfiguration config)
public void unregisterConfiguration(TypeConfiguration config)
public void registerSchema(SchemaBindingDescriptor sd)
public void unregisterSchema(SchemaBindingDescriptor sd)
public void registerFacet(FacetDescriptor fd)
public void unregisterFacet(FacetDescriptor fd)
public void registerDocumentType(DocumentTypeDescriptor dtd)
public void unregisterDocumentType(DocumentTypeDescriptor dtd)
public DocumentTypeDescriptor getDocumentTypeDescriptor(String name)
public FacetDescriptor getFacetDescriptor(String name)
public void recomputeDynamicFacets()
public void registerProxies(ProxiesDescriptor pd)
public void unregisterProxies(ProxiesDescriptor pd)
protected void checkDirty()
protected void recompute()
protected void recomputeConfiguration()
protected void recomputeSchemas()
protected void copySchema(SchemaBindingDescriptor sd) throws IOException
IOException
protected void loadSchema(SchemaBindingDescriptor sd) throws IOException, SAXException, TypeException
IOException
SAXException
TypeException
protected void registerSchema(Schema schema)
public Schema[] getSchemas()
TypeProvider
getSchemas
in interface TypeProvider
public Schema getSchema(String name)
TypeProvider
getSchema
in interface TypeProvider
public Schema getSchemaFromPrefix(String schemaPrefix)
getSchemaFromPrefix
in interface SchemaManager
public Schema getSchemaFromURI(String schemaURI)
getSchemaFromURI
in interface SchemaManager
protected void recomputeFacets()
protected void recomputeFacet(FacetDescriptor fd)
protected CompositeType registerFacet(String name, Set<String> schemaNames)
public CompositeType[] getFacets()
TypeProvider
getFacets
in interface TypeProvider
public CompositeType getFacet(String name)
TypeProvider
getFacet
in interface TypeProvider
public Set<String> getNoPerDocumentQueryFacets()
TypeProvider
getNoPerDocumentQueryFacets
in interface TypeProvider
protected void recomputeDocumentTypes()
protected DocumentTypeDescriptor mergeDocumentTypeDescriptors(DocumentTypeDescriptor src, DocumentTypeDescriptor dst)
protected DocumentType recomputeDocumentType(String name, Set<String> stack, Map<String,DocumentTypeDescriptor> dtds)
protected DocumentType recomputeDocumentType(String name, DocumentTypeDescriptor dtd, DocumentType parent)
protected void registerDocumentType(DocumentTypeImpl docType)
public DocumentType getDocumentType(String name)
TypeProvider
getDocumentType
in interface TypeProvider
public Set<String> getDocumentTypeNamesForFacet(String facet)
SchemaManager
getDocumentTypeNamesForFacet
in interface SchemaManager
public Set<String> getDocumentTypeNamesExtending(String docTypeName)
SchemaManager
getDocumentTypeNamesExtending
in interface SchemaManager
public DocumentType[] getDocumentTypes()
TypeProvider
getDocumentTypes
in interface TypeProvider
public int getDocumentTypesCount()
getDocumentTypesCount
in interface SchemaManager
public boolean hasSuperType(String docType, String superType)
SchemaManager
docType
is or extends superType
, false otherwise.hasSuperType
in interface SchemaManager
public Set<String> getAllowedSubTypes(String typeName)
SchemaManager
type
type.getAllowedSubTypes
in interface SchemaManager
protected void recomputeProxies()
public List<Schema> getProxySchemas(String docType)
TypeProvider
getProxySchemas
in interface TypeProvider
public boolean isProxySchema(String schema, String docType)
TypeProvider
isProxySchema
in interface TypeProvider
public Field getField(String xpath)
SchemaManager
getField
in interface SchemaManager
public Field getField(Field parent, String subFieldName)
SchemaManager
getField
in interface SchemaManager
protected Field resolveSubField(ListType listType, String subName, boolean fallbackOnSubElement)
public void flushPendingsRegistration()
public void registerRecomputeCallback(Runnable callback)
public void unregisterRecomputeCallback(Runnable callback)
protected void executeRecomputeCallbacks()
public void registerPropertyDeprecation(PropertyDeprecationDescriptor descriptor)
public void unregisterPropertyDeprecation(PropertyDeprecationDescriptor descriptor)
public PropertyDeprecationHandler getDeprecatedProperties()
getDeprecatedProperties
in interface SchemaManager
public PropertyDeprecationHandler getRemovedProperties()
getRemovedProperties
in interface SchemaManager
Copyright © 2017 Nuxeo. All rights reserved.