Class AbstractInvocationTypeComputer
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.stringliteral.contenttypes.AbstractInvocationTypeComputer
-
- All Implemented Interfaces:
ContextTypeComputer
,TypeComputer
- Direct Known Subclasses:
AccessRightTypeComputer
,DcsParameterTypeComputer
,EventTypeComputer
,FormAttributeTypeComputer
,FormatTypeComputer
,FormNameTypeComputer
,FullNameTypeComputerDataLock
,FunctionalOptionTypeComputer
,NstrTypeComputer
,ObjectAttributeTypeComputer
,PredefinedTypeComputer
,QuerySchemaMethodTypeComputer
,SettingsKeyTypeComputer
,SortColumnsTypeComputer
,StructureKeyTypeComputer
,TemplateNameTypeComputer
,TypeTypeComputer
,XdtoFactoryPackageCollectionPackageTypeComputer
,XdtoFactoryPackageTypeComputer
,XdtoFactoryTypeTypeComputer
public abstract class AbstractInvocationTypeComputer extends Object implements ContextTypeComputer
The abstract implementation of context type computer which checksStringLiteral
as parameter ofInvocation
in code. Sub-class should override one of methods:static invocation
ordynamic invocation
ofsome object types
.- See Also:
IStringLiteralTypeComputer
-
-
Constructor Summary
Constructors Constructor Description AbstractInvocationTypeComputer()
Instantiates a new abstract invocation type computer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
computeIsValidForSupportedType(StringLiteral literal, List<String> content, Environments envs)
Computes that the specified literal is valid for supported type of this computer.protected Set<org.eclipse.xtext.util.Pair<String,Integer>>
getDynamicInvocationParams(DynamicFeatureAccess featureAccess)
Gets the dynamic invocation parameters.protected Collection<String>
getDynamicInvocationSourceTypes(DynamicFeatureAccess fa)
Gets the type names of the source of the dynamic invocation method.protected Set<org.eclipse.xtext.util.Pair<String,Integer>>
getStaticInvocationParams(StaticFeatureAccess featureAccess)
Gets the static invocation parameters.protected boolean
isValidModule(Supplier<Module> module, FeatureAccess fa)
Checks if the module is valid for this string literal content type computing in some invocation context.protected boolean
isValidSourceType(DynamicFeatureAccess fa, Environments envs)
Checks if the type ofDynamicFeatureAccess
source is valid type.int
order()
Order of call to compute string literal type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.v8.dt.bsl.stringliteral.contenttypes.TypeComputer
computeWithAnnotations, getSupportedType, isSupport
-
-
-
-
Method Detail
-
order
public int order()
Description copied from interface:TypeComputer
Order of call to compute string literal type.- Specified by:
order
in interfaceTypeComputer
- Returns:
- the order of call
-
computeIsValidForSupportedType
public boolean computeIsValidForSupportedType(StringLiteral literal, List<String> content, Environments envs)
Description copied from interface:ContextTypeComputer
Computes that the specified literal is valid for supported type of this computer. MethodTypeComputer.isSupport(StringLiteral, List)
must explicitly call before this computation. Type computer implementation may expect to use methodTypeComputer.isSupport(StringLiteral, List)
in addition before main computation of type.- Specified by:
computeIsValidForSupportedType
in interfaceContextTypeComputer
- Parameters:
literal
- the literal to check, cannot benull
.content
- the content of string literal, cannot benull
.envs
- the actual environments of the string literal, cannot benull
.- Returns:
- true, if the literal is valid for supported type.
-
getStaticInvocationParams
protected Set<org.eclipse.xtext.util.Pair<String,Integer>> getStaticInvocationParams(StaticFeatureAccess featureAccess)
Gets the static invocation parameters. Should return both English and Russian variants of method name. Clients should override this method to implement type computer on static invocation context.- Parameters:
featureAccess
- the static feature access, if need dependably compute the collection of methods.- Returns:
- the static invocation parameters, collection of global context method name and position of string literal in the invocation parameters.
-
getDynamicInvocationParams
protected Set<org.eclipse.xtext.util.Pair<String,Integer>> getDynamicInvocationParams(DynamicFeatureAccess featureAccess)
Gets the dynamic invocation parameters. Should return both English and Russian variants of method name. Clients should override this method to implement type computer on dynamic invocation context.- Parameters:
featureAccess
- the dynamic feature access, if need dependably compute the collection of methods.- Returns:
- the dynamic invocation parameters, collection of type context method name and position of string literal in the invocation parameters.
-
getDynamicInvocationSourceTypes
protected Collection<String> getDynamicInvocationSourceTypes(DynamicFeatureAccess fa)
Gets the type names of the source of the dynamic invocation method. Clients should override this method to implement type computer on dynamic invocation context.- Parameters:
fa
- the dynamic feature access to get collection of its source types, if dependable onDynamicFeatureAccess
- Returns:
- the type names of source of dynamic invocation.
-
isValidModule
protected boolean isValidModule(Supplier<Module> module, FeatureAccess fa)
Checks if the module is valid for this string literal content type computing in some invocation context. This method allows to check module type,FeatureAccess
Environments
or any other heavy computing condition if the method of invocation and string literal parameter position matches the requirement.- Parameters:
module
- the supplier of module to checkfa
- the feature access to check- Returns:
- true, if the module is valid to compute.
-
isValidSourceType
protected boolean isValidSourceType(DynamicFeatureAccess fa, Environments envs)
Checks if the type ofDynamicFeatureAccess
source is valid type.- Parameters:
fa
- the dynamic feature access to check types of its sourceenvs
- theEnvironments
- Returns:
- true, if type of source is valid
-
-