public class SchemaManagerImpl extends Object implements SchemaManager
Holds basic types (String, Integer, etc.), schemas, document types and facets.
Constructor and Description |
---|
SchemaManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Unregisters all types.
|
DocumentType |
getDocumentType(String name)
Gets a document type.
|
Set<String> |
getDocumentTypeNamesExtending(String docTypeName)
Implementation details: there is a cache on each server for this Assumes
that types never change in the lifespan of this server process and that
the Core server has finished loading its types.
|
Set<String> |
getDocumentTypeNamesForFacet(String facet)
Same remarks as in
getDocumentTypeNamesExtending(java.lang.String) . |
DocumentType[] |
getDocumentTypes()
Gets the list of document types.
|
int |
getDocumentTypesCount() |
CompositeType |
getFacet(String name)
Gets a facet.
|
CompositeType[] |
getFacets()
Gets the list of facets.
|
Field |
getField(String prefixedName)
Gets the field given a prefixed name.
|
TypeHelper |
getHelper(String schema,
String type) |
PrefetchInfo |
getPrefetchInfo() |
Schema |
getSchema(String name)
Gets a schema.
|
File |
getSchemaDirectory() |
File |
getSchemaFile(String name) |
Schema |
getSchemaFromPrefix(String schemaPrefix) |
Schema |
getSchemaFromURI(String schemaURI) |
Schema[] |
getSchemas()
Gets the list of schemas.
|
int |
getSchemasCount() |
Type |
getType(String name)
Gets a property type.
|
Type |
getType(String schema,
String name)
Low level generic type lookup.
|
Type[] |
getTypes()
Gets the list of property types.
|
Type[] |
getTypes(String schema)
Gets the types defined by the given schema.
|
int |
getTypesCount() |
String |
getXmlSchemaDefinition(String name)
Get the schema definition.
|
void |
importTypes(TypeProvider provider)
Initializes initial types using a remote provider if any was specified.
|
void |
registerDocumentType(DocumentType docType) |
void |
registerDocumentType(DocumentTypeDescriptor dtd) |
void |
registerFacet(CompositeType facet) |
void |
registerFacet(FacetDescriptor fd) |
void |
registerHelper(String schema,
String type,
TypeHelper helper) |
void |
registerSchema(Schema schema) |
void |
registerType(Type type) |
URL |
resolveSchemaLocation(String location) |
void |
setPrefetchInfo(PrefetchInfo prefetchInfo) |
void |
setSchemaDirectory(File dir) |
DocumentType |
unregisterDocumentType(String name) |
CompositeType |
unregisterFacet(String name) |
void |
unregisterHelper(String schema,
String type) |
Schema |
unregisterSchema(String name) |
Type |
unregisterType(String name) |
public void importTypes(TypeProvider provider)
Should be called when a provider is registered.
public Type getType(String schema, String name)
TypeProvider
getType
in interface TypeProvider
public void registerType(Type type)
registerType
in interface SchemaManager
public Type unregisterType(String name)
unregisterType
in interface SchemaManager
public Type getType(String name)
TypeProvider
getType
in interface TypeProvider
public Type[] getTypes()
TypeProvider
getTypes
in interface TypeProvider
public Type[] getTypes(String schema)
SchemaManager
getTypes
in interface SchemaManager
public int getTypesCount()
getTypesCount
in interface SchemaManager
public void registerSchema(Schema schema)
registerSchema
in interface SchemaManager
public Schema unregisterSchema(String name)
unregisterSchema
in interface SchemaManager
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
public Field getField(String prefixedName)
SchemaManager
getField
in interface SchemaManager
public Schema[] getSchemas()
TypeProvider
getSchemas
in interface TypeProvider
public int getSchemasCount()
getSchemasCount
in interface SchemaManager
public void setPrefetchInfo(PrefetchInfo prefetchInfo)
public PrefetchInfo getPrefetchInfo()
public void registerDocumentType(DocumentType docType)
registerDocumentType
in interface SchemaManager
public void registerDocumentType(DocumentTypeDescriptor dtd)
public DocumentType unregisterDocumentType(String name)
unregisterDocumentType
in interface SchemaManager
public DocumentType getDocumentType(String name)
TypeProvider
getDocumentType
in interface TypeProvider
public DocumentType[] getDocumentTypes()
TypeProvider
getDocumentTypes
in interface TypeProvider
public int getDocumentTypesCount()
getDocumentTypesCount
in interface SchemaManager
public void registerFacet(CompositeType facet)
registerFacet
in interface SchemaManager
public void registerFacet(FacetDescriptor fd)
public CompositeType unregisterFacet(String name)
unregisterFacet
in interface SchemaManager
public CompositeType getFacet(String name)
TypeProvider
getFacet
in interface TypeProvider
public CompositeType[] getFacets()
TypeProvider
getFacets
in interface TypeProvider
public void clear()
SchemaManager
clear
in interface SchemaManager
public void setSchemaDirectory(File dir)
public File getSchemaDirectory()
public Set<String> getDocumentTypeNamesForFacet(String facet)
getDocumentTypeNamesExtending(java.lang.String)
. Tested in
nuxeo-coregetDocumentTypeNamesForFacet
in interface SchemaManager
public Set<String> getDocumentTypeNamesExtending(String docTypeName)
This is tested in nuxeo-core and SearchBackendTestCase (hence compass plugin).
getDocumentTypeNamesExtending
in interface SchemaManager
public String getXmlSchemaDefinition(String name)
SchemaManager
getXmlSchemaDefinition
in interface SchemaManager
public void registerHelper(String schema, String type, TypeHelper helper)
registerHelper
in interface SchemaManager
public void unregisterHelper(String schema, String type)
unregisterHelper
in interface SchemaManager
public TypeHelper getHelper(String schema, String type)
getHelper
in interface SchemaManager
Copyright © 2011 Nuxeo SA. All Rights Reserved.