Package com._1c.g5.v8.dt.bsl.extension
Class ModuleExtentionService
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.extension.ModuleExtentionService
-
- All Implemented Interfaces:
IModuleExtensionService
,ISourceModuleExtensionCache
public class ModuleExtentionService extends Object implements IModuleExtensionService, ISourceModuleExtensionCache
Default implementation ofIModuleExtensionService
-
-
Constructor Summary
Constructors Constructor Description ModuleExtentionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearSourceModuleCache(Module extensionModule)
Clears cache of sourceModule
sMap<Pragma,Method>
getExtensionMethods(Module extensionModule, String methodName)
Gets extension method overriding adoptable method with namemethodName
Collection<Module>
getExtensionModules(Module sourceModule)
Gets all extensionModule
by sourceString
getExtensionPrefix(Module module)
Gets prefix of extension project by extension Bsl moduleMap<Pragma,Method>
getSourceMethod(Method extentionMethod)
Gets adoptable method by extension methodMethod
getSourceMethodForFormEventHandler(Module extensionModule, String methodName, BslEventsService eventService)
Gets adoptable method by event handler method name from extension form moduleMap<CaseInsensitiveString,Collection<Pragma>>
getSourceMethodNames(Method extentionMethod)
Gets adoptable method names by extension methodMap<Method,org.eclipse.xtext.util.Pair<Method,String>>
getSourceMethodsForFormEventHandler(Module adoptableModule, Module extensionModule, BslEventsService eventService)
Gets correspondence between methods from source module (this method is event handler for form item event) and their extension methods from extension moduleModule
getSourceModule(Module module)
Gets adoptableModule
by extension Bsl moduleorg.eclipse.emf.ecore.EObject
getSourceObject(org.eclipse.emf.ecore.EObject object)
Gets adoptableEObject
by extensionEObject
.boolean
isAnnotationPragmaAllowed(IV8Project project)
Checks that annotation available for methods of this module.boolean
isCorrectVersionForAnnotationPragma(Module module)
Checks that annotation available for methods of this module.boolean
isExtensionModule(Module module)
Checks that thisModule
corresponding to the extension of configuration
-
-
-
Method Detail
-
getSourceMethod
public Map<Pragma,Method> getSourceMethod(Method extentionMethod)
Description copied from interface:IModuleExtensionService
Gets adoptable method by extension method- Specified by:
getSourceMethod
in interfaceIModuleExtensionService
- Parameters:
extentionMethod
- extensionMethod
from extension Method, can't benull
- Returns:
- correspondence between adoptable method and
Pragma
expression from extension method, nevernull
-
isExtensionModule
public boolean isExtensionModule(Module module)
Description copied from interface:IModuleExtensionService
Checks that thisModule
corresponding to the extension of configuration- Specified by:
isExtensionModule
in interfaceIModuleExtensionService
- Parameters:
module
- checkingModule
, can't benull
- Returns:
true
if thisModule
corresponding to the extension of configuration,false
otherwise
-
getSourceModule
public Module getSourceModule(Module module)
Description copied from interface:IModuleExtensionService
Gets adoptableModule
by extension Bsl module- Specified by:
getSourceModule
in interfaceIModuleExtensionService
- Parameters:
module
- extension BslModule
, can't benull
- Returns:
- adoptable
Module
by extension Bsl module, can benull
if there is no adoptable module
-
getSourceMethodNames
public Map<CaseInsensitiveString,Collection<Pragma>> getSourceMethodNames(Method extentionMethod)
Description copied from interface:IModuleExtensionService
Gets adoptable method names by extension method- Specified by:
getSourceMethodNames
in interfaceIModuleExtensionService
- Parameters:
extentionMethod
- extensionMethod
from extension Method, can't benull
- Returns:
- correspondence between adoptable method name and collection of
Pragma
s expression from extension method, nevernull
-
getExtensionPrefix
public String getExtensionPrefix(Module module)
Description copied from interface:IModuleExtensionService
Gets prefix of extension project by extension Bsl module- Specified by:
getExtensionPrefix
in interfaceIModuleExtensionService
- Parameters:
module
- extension Bsl module, can't benull
- Returns:
- prefix of extension project by extension Bsl module, never
null
-
getSourceObject
public org.eclipse.emf.ecore.EObject getSourceObject(org.eclipse.emf.ecore.EObject object)
Description copied from interface:IModuleExtensionService
Gets adoptableEObject
by extensionEObject
. See methodIModelObjectAdopter#getSourceModule(EObject)
- Specified by:
getSourceObject
in interfaceIModuleExtensionService
- Parameters:
object
- extensionEObject
, can't benull
- Returns:
- adoptable
EObject
, can benull
if adoptable object wasn't found
-
getExtensionMethods
public Map<Pragma,Method> getExtensionMethods(Module extensionModule, String methodName)
Description copied from interface:IModuleExtensionService
Gets extension method overriding adoptable method with namemethodName
- Specified by:
getExtensionMethods
in interfaceIModuleExtensionService
- Parameters:
extensionModule
- extension module, can't benull
methodName
- name of the adoptable method, can't benull
- Returns:
- extension methods by
Pragma
literalc correspondence to the adoptable method with namemethodName
, nevernull
-
getSourceMethodForFormEventHandler
public Method getSourceMethodForFormEventHandler(Module extensionModule, String methodName, BslEventsService eventService)
Description copied from interface:IModuleExtensionService
Gets adoptable method by event handler method name from extension form module- Specified by:
getSourceMethodForFormEventHandler
in interfaceIModuleExtensionService
- Parameters:
extensionModule
- form module extension, can't benull
methodName
- name of the event handler extension, can't benull
eventService
- actualBslEventsService
, can't benull
- Returns:
- adoptable method by event handler method name from extension form module, can be
null
if adoptable method wasn't found
-
getSourceMethodsForFormEventHandler
public Map<Method,org.eclipse.xtext.util.Pair<Method,String>> getSourceMethodsForFormEventHandler(Module adoptableModule, Module extensionModule, BslEventsService eventService)
Description copied from interface:IModuleExtensionService
Gets correspondence between methods from source module (this method is event handler for form item event) and their extension methods from extension module- Specified by:
getSourceMethodsForFormEventHandler
in interfaceIModuleExtensionService
- Parameters:
adoptableModule
- sourceModule
, can't benull
extensionModule
- extensionModule
, can't benull
eventService
- actualBslEventsService
, can't benull
- Returns:
- map with key
Method
from source module and value is extensionMethod
of sourceMethod
and its string presentation of call type annotation, nevernull
-
isCorrectVersionForAnnotationPragma
public boolean isCorrectVersionForAnnotationPragma(Module module)
Description copied from interface:IModuleExtensionService
Checks that annotation available for methods of this module. Annotation is unsupported for project version is less than 8.3.9 or for configuration with compatibility mode less than 8.3.9- Specified by:
isCorrectVersionForAnnotationPragma
in interfaceIModuleExtensionService
- Parameters:
module
- checkingModule
, can't benull
- Returns:
true
if annotation available for methods of this module,false
otherwise
-
isAnnotationPragmaAllowed
public boolean isAnnotationPragmaAllowed(IV8Project project)
Description copied from interface:IModuleExtensionService
Checks that annotation available for methods of this module. Annotation is unsupported for project version is less than 8.3.9 or for configuration with compatibility mode less than 8.3.9- Specified by:
isAnnotationPragmaAllowed
in interfaceIModuleExtensionService
- Parameters:
project
- checkingIV8Project
, can't benull
- Returns:
true
if annotation available for methods of this module,false
otherwise
-
getExtensionModules
public Collection<Module> getExtensionModules(Module sourceModule)
Description copied from interface:IModuleExtensionService
Gets all extensionModule
by source- Specified by:
getExtensionModules
in interfaceIModuleExtensionService
- Parameters:
sourceModule
- sourceModule
, can't benull
- Returns:
- collection of extension
Module
, nevernull
-
clearSourceModuleCache
public void clearSourceModuleCache(Module extensionModule)
Description copied from interface:ISourceModuleExtensionCache
Clears cache of sourceModule
s- Specified by:
clearSourceModuleCache
in interfaceISourceModuleExtensionCache
- Parameters:
extensionModule
-Module
from extension project for deleting sourceModule
of it from cache, cannot benull
-
-