Class NstrTypeComputer
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.stringliteral.contenttypes.AbstractInvocationTypeComputer
-
- com._1c.g5.v8.dt.bsl.stringliteral.contenttypes.NstrTypeComputer
-
- All Implemented Interfaces:
ContextTypeComputer
,TypeComputer
,TypeValidator
public class NstrTypeComputer extends AbstractInvocationTypeComputer implements TypeValidator
The computer and validator of formating string passing to NStr() function.
-
-
Constructor Summary
Constructors Constructor Description NstrTypeComputer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<org.eclipse.xtext.util.Pair<String,Integer>>
getStaticInvocationParams(StaticFeatureAccess featureAccess)
Gets the static invocation parameters.String
getSupportedType()
Returns the supported type ID of the string literal content validator.static boolean
isNls(Invocation nlsInvocation)
Checks if theInvocation
is NLS functionNStr
org.eclipse.core.runtime.IStatus
validate(StringLiteral literal, List<String> content, org.eclipse.xtext.util.CancelIndicator monitor)
Checks that content of string literal is valid for the declared content type.-
Methods inherited from class com._1c.g5.v8.dt.bsl.stringliteral.contenttypes.AbstractInvocationTypeComputer
computeIsValidForSupportedType, getDynamicInvocationParams, getDynamicInvocationSourceTypes, isValidModule, isValidSourceType, order
-
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, isSupport
-
-
-
-
Method Detail
-
getSupportedType
public String getSupportedType()
Description copied from interface:TypeValidator
Returns the supported type ID of the string literal content validator.- Specified by:
getSupportedType
in interfaceTypeComputer
- Specified by:
getSupportedType
in interfaceTypeValidator
- Returns:
- the supported type, cannot return
null
.
-
validate
public org.eclipse.core.runtime.IStatus validate(StringLiteral literal, List<String> content, org.eclipse.xtext.util.CancelIndicator monitor)
Description copied from interface:TypeValidator
Checks that content of string literal is valid for the declared content type.- Specified by:
validate
in interfaceTypeValidator
- Parameters:
literal
- the string literal, cannot benull
.content
- the content of lines of the string literal, cannot benull
.monitor
- the monitor to check cancel status, cannot benull
.- Returns:
- the status of validation, cannot return
null
.
-
isNls
public static boolean isNls(Invocation nlsInvocation)
Checks if theInvocation
is NLS functionNStr
- Parameters:
nlsInvocation
- the invocation to check, can benull
- Returns:
- true, if the invocation is NLS
-
getStaticInvocationParams
protected Set<org.eclipse.xtext.util.Pair<String,Integer>> getStaticInvocationParams(StaticFeatureAccess featureAccess)
Description copied from class:AbstractInvocationTypeComputer
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.- Overrides:
getStaticInvocationParams
in classAbstractInvocationTypeComputer
- 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.
-
-