Class TemplateModelInterpreted
- java.lang.Object
 - 
- jetbrains.mps.generator.runtime.TemplateModelBase
 - 
- jetbrains.mps.generator.impl.interpreted.TemplateModelInterpreted
 
 
 
- 
- All Implemented Interfaces:
 TemplateModel,TemplateModel2
public class TemplateModelInterpreted extends TemplateModelBase implements TemplateModel2
Evgeny Gryaznov, Nov 29, 2010 
- 
- 
Constructor Summary
Constructors Constructor Description TemplateModelInterpreted(TemplateModule module, SModel model, Class<? extends GeneratorQueryProvider> queryProviderClass) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<TemplateMappingConfiguration>getConfigurations()StringgetLongName()GeneratorQueryProvidergetQueryProvider()FIXME PROVISIONAL CODE (return value), expose GQP in generator.runtime package Besides, now the caching is done in QueryProviderCache, so implementation is not obliged to keep the instance.SModelReferencegetSModelReference()Collection<TemplateSwitchMapping>getSwitches()booleanisStale()INTERNAL METHOD, DON'T USE OUTSIDE OF GENERATOR IMPLEMENTATION 'public' just to give access from TemplateModuleInterpreted2TemplateDeclarationloadTemplate(TemplateDeclarationKey tdKey)This method is to replaceTemplateModel.loadTemplate(SNodeReference, Object...).- 
Methods inherited from class jetbrains.mps.generator.runtime.TemplateModelBase
getModule 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface jetbrains.mps.generator.runtime.TemplateModel
getModule, loadTemplate 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
TemplateModelInterpreted
public TemplateModelInterpreted(@NotNull TemplateModule module, @Nullable SModel model, @NotNull Class<? extends GeneratorQueryProvider> queryProviderClass)
 
 - 
 
- 
Method Detail
- 
isStale
public boolean isStale()
INTERNAL METHOD, DON'T USE OUTSIDE OF GENERATOR IMPLEMENTATION 'public' just to give access from TemplateModuleInterpreted2 
- 
getSwitches
public Collection<TemplateSwitchMapping> getSwitches()
- Specified by:
 getSwitchesin interfaceTemplateModel
 
- 
getConfigurations
public Collection<TemplateMappingConfiguration> getConfigurations()
- Specified by:
 getConfigurationsin interfaceTemplateModel
 
- 
loadTemplate
@Nullable public TemplateDeclaration loadTemplate(TemplateDeclarationKey tdKey)
Description copied from interface:TemplateModel2This method is to replaceTemplateModel.loadTemplate(SNodeReference, Object...). TemplateModel implementation is advised though not required to cache supplied TemplateDeclaration instances.- Specified by:
 loadTemplatein interfaceTemplateModel2- Parameters:
 tdKey- identity of template declaration to load- Returns:
 - null if no template with the supplied identity found
 
 
- 
getLongName
public String getLongName()
- Specified by:
 getLongNamein interfaceTemplateModel
 
- 
getSModelReference
public SModelReference getSModelReference()
- Specified by:
 getSModelReferencein interfaceTemplateModel
 
- 
getQueryProvider
public GeneratorQueryProvider getQueryProvider()
Description copied from interface:TemplateModelFIXME PROVISIONAL CODE (return value), expose GQP in generator.runtime package Besides, now the caching is done in QueryProviderCache, so implementation is not obliged to keep the instance. It could, however. XXX On one hand, we need a generic API to access queries and thus shall override the method in generated templates, OTOH, it's unlikely (error?) to use QueryProvider of a generated template as the code there invokes queries without the need for GQP (unless I decide to use QueryKey there and hold query instances). There might be another reason to give access to GQP from generated templates! If we enable a 'forced interpretation' mode when we interpret templates otherwise available as compiled. Not sure there's need for such functionality though, no requests have been made so far, nevertheless, I can't preclude a need like that one e.g. for bootstrap reasons.- Specified by:
 getQueryProviderin interfaceTemplateModel- Overrides:
 getQueryProviderin classTemplateModelBase- Returns:
 nullif there's no generated provider, or it had failed to load
 
 - 
 
 -