Package jetbrains.mps.persistence
Class PersistenceRegistry
- java.lang.Object
 - 
- org.jetbrains.mps.openapi.persistence.PersistenceFacade
 - 
- jetbrains.mps.persistence.PersistenceRegistry
 
 
 
- 
- All Implemented Interfaces:
 CoreComponent
public class PersistenceRegistry extends PersistenceFacade implements CoreComponent
evgeny, 10/23/12 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class org.jetbrains.mps.openapi.persistence.PersistenceFacade
PersistenceFacade.IncorrectModelReferenceFormatException, PersistenceFacade.IncorrectNodeIdFormatException 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_MODEL_ROOTstatic StringJAVA_CLASSES_ROOTstatic StringOBSOLETE_MODEL_ROOT- 
Fields inherited from class org.jetbrains.mps.openapi.persistence.PersistenceFacade
INSTANCE 
 - 
 
- 
Constructor Summary
Constructors Constructor Description PersistenceRegistry(ModelFactoryService modelFactoryService, DataSourceFactoryRuleService dsRegistry) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFindUsagesParticipant(FindUsagesParticipant participant)voidaddNavigationParticipant(NavigationParticipant participant)StringasString(SModelId modelId)Serialize counterpart forPersistenceFacade.createModelId(String), persistence-ready presentation of a model identifier.StringasString(SModelReference modelRef)Serialize counterpart forPersistenceFacade.createModelReference(String), persistence-ready presentation of a model referenceStringasString(SNodeReference nodeRef)Serialize counterpart forPersistenceFacade.createNodeReference(String), persistence-ready presentation of a node reference.StringasString(SModuleId moduleId)StringasString(SModuleReference reference)Serialize counterpart forPersistenceFacade.createModuleReference(String).SModelIdcreateModelId(String text)Creates an SModelId from a given text identifier.SModelReferencecreateModelReference(String text)Creates an SModelReference from a given text identifier.SModelReferencecreateModelReference(SModuleReference module, SModelId modelId, String modelName)Creates an SModelReference in a module with a given model id and model name.SModelReferencecreateModelReference(SModuleReference module, SModelId modelId, SModelName modelName)Creates an SModelReference in a module with a given model id and model name.SModuleIdcreateModuleId(String text)SModuleReferencecreateModuleReference(String text)SModuleReferencecreateModuleReference(SModuleId moduleId, String moduleName)SNodeIdcreateNodeId(String nodeIdString)Creates an SNodeId from a given text identifier.SNodeReferencecreateNodeReference(String text)voiddisableFastFindUsages()voiddispose()voidenableFastFindUsages()ModelFactorygetDefaultModelFactory()Deprecated.Set<FindUsagesParticipant>getFindUsagesParticipants()Find usages participants speed-up usages search by indexing the content.static PersistenceRegistrygetInstance()Deprecated.ModelFactorygetModelFactory(String extension)Deprecated.ModelFactorygetModelFactory(DataSourceType dataSourceType)ModelFactorygetModelFactory(ModelFactoryType type)ModelRootFactorygetModelRootFactory(String type)Retrieves the factory associated with the given typeSet<NavigationParticipant>getNavigationParticipants()Navigation participants speed-up building Go to lists by indexing the available targets.Iterable<String>getTypeIds()Retrieves all registered types of model roots FIXME shall rename to smth more meaningful (to reflect it's about model roots)voidinit()booleanisFastSearch()voidremoveFindUsagesParticipant(FindUsagesParticipant participant)voidremoveNavigationParticipant(NavigationParticipant participant)voidsetModelIdFactory(String type, SModelIdFactory factory)Registers the factory with the model id type, overwriting potential earlier registration.voidsetModelRootFactory(String type, ModelRootFactory factory)Registers the factory with the given type, overwriting potential earlier registration.voidsetNodeIdFactory(String type, SNodeIdFactory factory)Registers the factory with the node id type, overwriting potential earlier registration.- 
Methods inherited from class org.jetbrains.mps.openapi.persistence.PersistenceFacade
asString 
 - 
 
 - 
 
- 
- 
Field Detail
- 
DEFAULT_MODEL_ROOT
public static final String DEFAULT_MODEL_ROOT
- See Also:
 - Constant Field Values
 
 
- 
OBSOLETE_MODEL_ROOT
public static final String OBSOLETE_MODEL_ROOT
- See Also:
 - Constant Field Values
 
 
- 
JAVA_CLASSES_ROOT
public static final String JAVA_CLASSES_ROOT
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
PersistenceRegistry
public PersistenceRegistry(ModelFactoryService modelFactoryService, DataSourceFactoryRuleService dsRegistry)
 
 - 
 
- 
Method Detail
- 
getInstance
@Deprecated public static PersistenceRegistry getInstance()
Deprecated.access the component usingComponentHost#findComponent(PersitenceFacade.class) 
- 
getModelRootFactory
public ModelRootFactory getModelRootFactory(@NotNull String type)
Description copied from class:PersistenceFacadeRetrieves the factory associated with the given type- Specified by:
 getModelRootFactoryin classPersistenceFacade
 
- 
setModelRootFactory
public void setModelRootFactory(@NotNull String type, @Nullable ModelRootFactory factory)
Description copied from class:PersistenceFacadeRegisters the factory with the given type, overwriting potential earlier registration.- Specified by:
 setModelRootFactoryin classPersistenceFacadefactory- The factory to register,nullto clear the registration for the given type.
 
- 
getModelFactory
@Deprecated public ModelFactory getModelFactory(@Nullable String extension)
Deprecated.Description copied from class:PersistenceFacadeRetrieves the factory associated with the given file extension.- Specified by:
 getModelFactoryin classPersistenceFacade
 
- 
getModelFactory
@Nullable public ModelFactory getModelFactory(@NotNull ModelFactoryType type)
- Specified by:
 getModelFactoryin classPersistenceFacade- Returns:
 - the ModelFactory which was registered last.
 Use 
ModelFactoryRegisterextension point in order to register a custom ModelFactory. 
 
- 
getModelFactory
@Nullable public final ModelFactory getModelFactory(@NotNull DataSourceType dataSourceType)
- Specified by:
 getModelFactoryin classPersistenceFacade- Returns:
 - the ModelFactory which was registered last and has in its 
ModelFactory.getPreferredDataSourceTypes()the dataSourceType. 
 
- 
getDefaultModelFactory
@Deprecated public ModelFactory getDefaultModelFactory()
Deprecated.Description copied from class:PersistenceFacadeRetrieves the factory for default MPS storage format (xml-based).- Specified by:
 getDefaultModelFactoryin classPersistenceFacade
 
- 
createModuleId
@NotNull public SModuleId createModuleId(@NotNull String text)
- Specified by:
 createModuleIdin classPersistenceFacade- Returns:
 - module identity object created from persistence text
 
 
- 
asString
@NotNull public String asString(@NotNull SModuleId moduleId)
- Specified by:
 asStringin classPersistenceFacade- Returns:
 - textual representation of the identifier ready for persistence
 
 
- 
asString
public String asString(@NotNull SModuleReference reference)
Description copied from class:PersistenceFacadeSerialize counterpart forPersistenceFacade.createModuleReference(String).- Specified by:
 asStringin classPersistenceFacade- Parameters:
 reference- module reference to serialize- Returns:
 - persistence-ready presentation of a module identifier
 
 
- 
createModuleReference
public SModuleReference createModuleReference(@NotNull String text)
- Specified by:
 createModuleReferencein classPersistenceFacade
 
- 
createModuleReference
public SModuleReference createModuleReference(@NotNull SModuleId moduleId, String moduleName)
- Specified by:
 createModuleReferencein classPersistenceFacade- Returns:
 - module identity constructed from the fragments supplied
 
 
- 
createModelId
public SModelId createModelId(@NotNull String text)
Description copied from class:PersistenceFacadeCreates an SModelId from a given text identifier. Allows implementations to provide their own version of SModelId.- Specified by:
 createModelIdin classPersistenceFacade- Parameters:
 text- A text that the custom implementation of SModelIdFactory could use to build its own SModelId. The text comes in the following format: "type:restInterpretedByTheConcreteTypeProvider" The actual type of the model id is followed by implementation-specific text.- See Also:
 PersistenceFacade.asString(org.jetbrains.mps.openapi.model.SModelId)
 
- 
asString
public String asString(@NotNull SModelId modelId)
Description copied from class:PersistenceFacadeSerialize counterpart forPersistenceFacade.createModelId(String), persistence-ready presentation of a model identifier.- Specified by:
 asStringin classPersistenceFacade- Parameters:
 modelId- model identity- Returns:
 - textual representation of a model identifier ready for persistence
 
 
- 
createModelReference
@NotNull public SModelReference createModelReference(@NotNull String text)
Description copied from class:PersistenceFacadeCreates an SModelReference from a given text identifier.- Specified by:
 createModelReferencein classPersistenceFacade
 
- 
asString
public String asString(@NotNull SModelReference modelRef)
Description copied from class:PersistenceFacadeSerialize counterpart forPersistenceFacade.createModelReference(String), persistence-ready presentation of a model reference- Specified by:
 asStringin classPersistenceFacade- Parameters:
 modelRef- model reference to serialize- Returns:
 - textual representation of a model reference
 
 
- 
createModelReference
public SModelReference createModelReference(SModuleReference module, @NotNull SModelId modelId, @NotNull String modelName)
Description copied from class:PersistenceFacadeCreates an SModelReference in a module with a given model id and model name. PreferPersistenceFacade.createModelReference(SModuleReference, SModelId, SModelName)alternative that takesSModelName.- Specified by:
 createModelReferencein classPersistenceFacade- Parameters:
 module- can be null only if modelId is globally unique (i.e. can be resolved without a module)
 
- 
createModelReference
public SModelReference createModelReference(SModuleReference module, @NotNull SModelId modelId, @NotNull SModelName modelName)
Description copied from class:PersistenceFacadeCreates an SModelReference in a module with a given model id and model name.- Specified by:
 createModelReferencein classPersistenceFacade- Parameters:
 module- can be null only if modelId is globally unique (i.e. can be resolved without a module)modelId- identity of a model either globally or within a modulemodelName- user-friendly name of a model
 
- 
setModelIdFactory
public void setModelIdFactory(String type, SModelIdFactory factory)
Description copied from class:PersistenceFacadeRegisters the factory with the model id type, overwriting potential earlier registration.- Specified by:
 setModelIdFactoryin classPersistenceFacadefactory- The factory to register, null to clear the registration for the given type.
 
- 
createNodeId
@Nullable public SNodeId createNodeId(@NotNull String nodeIdString)
Description copied from class:PersistenceFacadeCreates an SNodeId from a given text identifier. Allows implementations to provide their own version of SNodeId.- Specified by:
 createNodeIdin classPersistenceFacade- Parameters:
 nodeIdString- A text that the custom implementation of SNodeIdFactory could use to build its own SNodeId. The text comes in the following format: "type:restInterpretedByTheConcreteTypeProvider" The actual type of the node id is followed by implementation-specific text.
 
- 
asString
@NotNull public String asString(@NotNull SNodeReference nodeRef)
Description copied from class:PersistenceFacadeSerialize counterpart forPersistenceFacade.createNodeReference(String), persistence-ready presentation of a node reference.- Specified by:
 asStringin classPersistenceFacade- Parameters:
 nodeRef- node reference to serialize- Returns:
 - textual representation of node reference
 
 
- 
createNodeReference
public SNodeReference createNodeReference(@NotNull String text)
- Specified by:
 createNodeReferencein classPersistenceFacade
 
- 
setNodeIdFactory
public void setNodeIdFactory(String type, SNodeIdFactory factory)
Description copied from class:PersistenceFacadeRegisters the factory with the node id type, overwriting potential earlier registration.- Specified by:
 setNodeIdFactoryin classPersistenceFacadefactory- The factory to register, null to clear the registration for the given type.
 
- 
getTypeIds
public Iterable<String> getTypeIds()
Description copied from class:PersistenceFacadeRetrieves all registered types of model roots FIXME shall rename to smth more meaningful (to reflect it's about model roots)- Specified by:
 getTypeIdsin classPersistenceFacade
 
- 
addFindUsagesParticipant
public void addFindUsagesParticipant(FindUsagesParticipant participant)
- Specified by:
 addFindUsagesParticipantin classPersistenceFacade
 
- 
removeFindUsagesParticipant
public void removeFindUsagesParticipant(FindUsagesParticipant participant)
- Specified by:
 removeFindUsagesParticipantin classPersistenceFacade
 
- 
getFindUsagesParticipants
public Set<FindUsagesParticipant> getFindUsagesParticipants()
Description copied from class:PersistenceFacadeFind usages participants speed-up usages search by indexing the content. seeFindUsagesParticipant- Specified by:
 getFindUsagesParticipantsin classPersistenceFacade
 
- 
isFastSearch
public boolean isFastSearch()
 
- 
addNavigationParticipant
public void addNavigationParticipant(NavigationParticipant participant)
- Specified by:
 addNavigationParticipantin classPersistenceFacade
 
- 
removeNavigationParticipant
public void removeNavigationParticipant(NavigationParticipant participant)
- Specified by:
 removeNavigationParticipantin classPersistenceFacade
 
- 
getNavigationParticipants
public Set<NavigationParticipant> getNavigationParticipants()
Description copied from class:PersistenceFacadeNavigation participants speed-up building Go to lists by indexing the available targets. seeNavigationParticipant- Specified by:
 getNavigationParticipantsin classPersistenceFacade
 
- 
init
public void init()
- Specified by:
 initin interfaceCoreComponent
 
- 
dispose
public void dispose()
- Specified by:
 disposein interfaceCoreComponent
 
- 
disableFastFindUsages
public void disableFastFindUsages()
 
- 
enableFastFindUsages
public void enableFastFindUsages()
 
 - 
 
 -