Class QueryTypeComputer
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.stringliteral.contenttypes.QueryTypeComputer
-
- All Implemented Interfaces:
ContentTypeComputer
,TypeComputer
,TypeValidator
- Direct Known Subclasses:
QueryDcsTypeComputer
public class QueryTypeComputer extends Object implements ContentTypeComputer, TypeValidator
The computer and validator of Query type in literal by it's content without code context.
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMENT_START_TAG
The comment symbolsstatic String
QUERY_START_STRING
The start of QuerySchema object in Englishstatic String
QUERY_START_STRING_RU
The start of QuerySchema object in Russian
-
Constructor Summary
Constructors Constructor Description QueryTypeComputer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
computeIsValidForSupportedType(StringLiteral literal, List<String> content, Collection<LiteralType> contextTypes)
Computes that the specified literal is valid for supported type of this computer.String
getSupportedType()
Returns the supported type ID of this computer.protected boolean
isStartWithSelect(List<String> content, org.eclipse.xtext.util.CancelIndicator monitor)
Checks if the literal content starts with "SELECT" keyword.int
order()
Order of call to compute string literal type.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 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
-
-
-
-
Field Detail
-
QUERY_START_STRING
public static final String QUERY_START_STRING
The start of QuerySchema object in English- See Also:
- Constant Field Values
-
QUERY_START_STRING_RU
public static final String QUERY_START_STRING_RU
The start of QuerySchema object in Russian- See Also:
- Constant Field Values
-
COMMENT_START_TAG
public static final String COMMENT_START_TAG
The comment symbols- See Also:
- Constant Field Values
-
-
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
-
getSupportedType
public String getSupportedType()
Description copied from interface:TypeComputer
Returns the supported type ID of this computer.- Specified by:
getSupportedType
in interfaceTypeComputer
- Specified by:
getSupportedType
in interfaceTypeValidator
- Returns:
- the supported type ID, registered in extension point.
-
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
.
-
computeIsValidForSupportedType
public boolean computeIsValidForSupportedType(StringLiteral literal, List<String> content, Collection<LiteralType> contextTypes)
Description copied from interface:ContentTypeComputer
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 interfaceContentTypeComputer
- Parameters:
literal
- the literal to check, cannot benull
.content
- the content of string literal, cannot benull
.contextTypes
- the context types that already computed, cannot benull
.- Returns:
- true, if the literal is valid for supported type.
-
isStartWithSelect
protected boolean isStartWithSelect(List<String> content, org.eclipse.xtext.util.CancelIndicator monitor)
Checks if the literal content starts with "SELECT" keyword.- Parameters:
content
- the content, cannot benull
.monitor
- the monitor, cannot benull
.- Returns:
- true, if it starts with SELECT
-
-