Package jetbrains.mps.persistence
Class LazyLoadFacility
- java.lang.Object
 - 
- jetbrains.mps.persistence.LazyLoadFacility
 
 
- 
public abstract class LazyLoadFacility extends Object
Internal facility around ModelFactory which is aware of partial loading approach. Initially, just an extraction of differences between LazyEditableSModelBase subclasses (DefaultSModelDescriptor, BinarySModelDescriptor and FilePerRootSModel), hence awkward API. 
- 
- 
Constructor Summary
Constructors Constructor Description LazyLoadFacility(ModelFactory modelFactory, DataSource dataSource)LazyLoadFacility(ModelFactory modelFactory, DataSource dataSource, boolean isPersistenceTextBased) 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleandoesSaveUpgradePersistence(SModelHeader header)The method is quite questionable, though better than saveModel returning != null value to indicate persistence has changed during save.ModelFactorygetModelFactory()StringgetModelHash()DataSourcegetSource()abstract SModelHeaderreadHeader()abstract ModelLoadResultreadModel(SModelHeader header, ModelLoadingState state)abstract voidsaveModel(SModelHeader header, SModelData modelData) 
 - 
 
- 
- 
Constructor Detail
- 
LazyLoadFacility
public LazyLoadFacility(@NotNull ModelFactory modelFactory, @NotNull DataSource dataSource)
 
- 
LazyLoadFacility
public LazyLoadFacility(@NotNull ModelFactory modelFactory, @NotNull DataSource dataSource, boolean isPersistenceTextBased)
 
 - 
 
- 
Method Detail
- 
getModelFactory
@NotNull public final ModelFactory getModelFactory()
 
- 
getSource
@NotNull public final DataSource getSource()
 
- 
getModelHash
public String getModelHash()
 
- 
readHeader
@NotNull public abstract SModelHeader readHeader() throws ModelReadException
- Throws:
 ModelReadException
 
- 
readModel
@NotNull public abstract ModelLoadResult readModel(@NotNull SModelHeader header, @NotNull ModelLoadingState state) throws ModelReadException
- Throws:
 ModelReadException
 
- 
doesSaveUpgradePersistence
public abstract boolean doesSaveUpgradePersistence(@NotNull SModelHeader header)
The method is quite questionable, though better than saveModel returning != null value to indicate persistence has changed during save. One of alternatives is to alter header's field (persistenceVersion) on saveModel so that caller gets a chance to find out persistence had changed- Returns:
 - true if model could not be saved with persistence version indicated in the header.
 
 
- 
saveModel
public abstract void saveModel(@NotNull SModelHeader header, SModelData modelData) throws IOException
- Throws:
 IOException
 
 - 
 
 -