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)
TypeProvidergetType in interface TypeProviderpublic void registerType(Type type)
registerType in interface SchemaManagerpublic Type unregisterType(String name)
unregisterType in interface SchemaManagerpublic Type getType(String name)
TypeProvidergetType in interface TypeProviderpublic Type[] getTypes()
TypeProvidergetTypes in interface TypeProviderpublic Type[] getTypes(String schema)
SchemaManagergetTypes in interface SchemaManagerpublic int getTypesCount()
getTypesCount in interface SchemaManagerpublic void registerSchema(Schema schema)
registerSchema in interface SchemaManagerpublic Schema unregisterSchema(String name)
unregisterSchema in interface SchemaManagerpublic Schema getSchema(String name)
TypeProvidergetSchema in interface TypeProviderpublic Schema getSchemaFromPrefix(String schemaPrefix)
getSchemaFromPrefix in interface SchemaManagerpublic Schema getSchemaFromURI(String schemaURI)
getSchemaFromURI in interface SchemaManagerpublic Field getField(String prefixedName)
SchemaManagergetField in interface SchemaManagerpublic Schema[] getSchemas()
TypeProvidergetSchemas in interface TypeProviderpublic int getSchemasCount()
getSchemasCount in interface SchemaManagerpublic void setPrefetchInfo(PrefetchInfo prefetchInfo)
public PrefetchInfo getPrefetchInfo()
public void registerDocumentType(DocumentType docType)
registerDocumentType in interface SchemaManagerpublic void registerDocumentType(DocumentTypeDescriptor dtd)
public DocumentType unregisterDocumentType(String name)
unregisterDocumentType in interface SchemaManagerpublic DocumentType getDocumentType(String name)
TypeProvidergetDocumentType in interface TypeProviderpublic DocumentType[] getDocumentTypes()
TypeProvidergetDocumentTypes in interface TypeProviderpublic int getDocumentTypesCount()
getDocumentTypesCount in interface SchemaManagerpublic void registerFacet(CompositeType facet)
registerFacet in interface SchemaManagerpublic void registerFacet(FacetDescriptor fd)
public CompositeType unregisterFacet(String name)
unregisterFacet in interface SchemaManagerpublic CompositeType getFacet(String name)
TypeProvidergetFacet in interface TypeProviderpublic CompositeType[] getFacets()
TypeProvidergetFacets in interface TypeProviderpublic void clear()
SchemaManagerclear in interface SchemaManagerpublic void setSchemaDirectory(File dir)
public File getSchemaDirectory()
public Set<String> getDocumentTypeNamesForFacet(String facet)
getDocumentTypeNamesExtending(java.lang.String). Tested in
nuxeo-coregetDocumentTypeNamesForFacet in interface SchemaManagerpublic Set<String> getDocumentTypeNamesExtending(String docTypeName)
This is tested in nuxeo-core and SearchBackendTestCase (hence compass plugin).
getDocumentTypeNamesExtending in interface SchemaManagerpublic String getXmlSchemaDefinition(String name)
SchemaManagergetXmlSchemaDefinition in interface SchemaManagerpublic void registerHelper(String schema, String type, TypeHelper helper)
registerHelper in interface SchemaManagerpublic void unregisterHelper(String schema, String type)
unregisterHelper in interface SchemaManagerpublic TypeHelper getHelper(String schema, String type)
getHelper in interface SchemaManagerCopyright © 2011 Nuxeo SA. All Rights Reserved.