public abstract class AbapCheckUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Set<java.lang.String> |
EVENT_TYPES
A list of entity types representing events.
|
static java.lang.String |
META_COMMENT_IS_RFC_ENABLED
Meta comment which is added by Teamsale Git importer as last source line to
indicate that an function module is RFC enabled.
|
static java.util.Set<java.lang.String> |
PARENT_TYPES_OF_CLASS_SCOPE
All entity types whose children are in class scope.
|
static java.util.Set<java.lang.String> |
PARENT_TYPES_OF_GLOBAL_SCOPE
All entity types whose children are in global scope.
|
static java.util.Set<java.lang.String> |
PARENT_TYPES_OF_LOCAL_VALID_SCOPE
All entity types whose children are in local scope.
|
static int |
SY_SUBRC_NO_ERROR
Value of return code SY-SUBRC which indicates no error
|
static java.util.Set<ETokenType> |
TOKEN_TYPES_POTENTIALLY_CONTAINING_VARIABLE_NAMES
A list of token types which can include a variable name.
|
Constructor and Description |
---|
AbapCheckUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getNormalizedStartTokensText(ShallowEntity entity,
ICheckContext context)
Gets the normalized text of the start tokens of a
ShallowEntity
(typically for statement). |
static boolean |
hasMetaCommentForRfcEnablement(java.util.List<java.lang.String> contentLines)
Checks if the given content lines contains the meta data comment for RFC
enablement in the last line
|
static boolean |
hasMetaCommentForRfcEnablement(java.lang.String unfilteredContent)
Checks if the given content, what is expected to be the unfiltered content,
contains the meta data comment for RFC enablement in the last line
|
static boolean |
isEntityWithinClassScope(ShallowEntity entity)
Checks whether an entity is within the scope of a class.
|
static boolean |
isEntityWithinGlobalScope(ShallowEntity entity)
Checks whether an entity is in global scope, i.e.
|
static boolean |
isEntityWithinLocalValidScope(ShallowEntity entity)
Checks whether an entity is within a valid, local scope.
|
static boolean |
isFunctionCallOfAny(ShallowEntity entity,
java.lang.String... functionNames)
Checks if the given entity is a function call of a function with any of the
given names.
|
static boolean |
isIgnoredForDatabaseChecks(ShallowEntity entity,
java.util.List<ShallowEntity> rootEntities,
java.lang.String uniformPath)
Disable check for inherited methods, since we cannot see their interface and
hence cannot judge whether tables are passed as parameters or refer to the
database.
|
static boolean |
isVariable(java.lang.String identifier,
ShallowEntity entity,
ITypeResolution typeResolution)
Whether the given identifier is considered a variable (rather than e.g.
|
public static final int SY_SUBRC_NO_ERROR
public static final java.util.Set<ETokenType> TOKEN_TYPES_POTENTIALLY_CONTAINING_VARIABLE_NAMES
public static final java.util.Set<java.lang.String> EVENT_TYPES
public static final java.util.Set<java.lang.String> PARENT_TYPES_OF_CLASS_SCOPE
public static final java.util.Set<java.lang.String> PARENT_TYPES_OF_GLOBAL_SCOPE
public static final java.util.Set<java.lang.String> PARENT_TYPES_OF_LOCAL_VALID_SCOPE
public static final java.lang.String META_COMMENT_IS_RFC_ENABLED
public AbapCheckUtils()
public static boolean isEntityWithinClassScope(ShallowEntity entity)
entity
- The entity to be checked.public static boolean isEntityWithinGlobalScope(ShallowEntity entity)
entity
- The entity to be checked.public static boolean isEntityWithinLocalValidScope(ShallowEntity entity)
entity
- The entity to be checked.public static boolean isIgnoredForDatabaseChecks(ShallowEntity entity, java.util.List<ShallowEntity> rootEntities, java.lang.String uniformPath)
entity
- The entity to check. May be a database statement or a macro.rootEntities
- The corresponding file's root entities.uniformPath
- The uniformPath to that file.public static boolean isVariable(java.lang.String identifier, ShallowEntity entity, ITypeResolution typeResolution)
identifier
- The identifier inside a statement to check for being a variable.entity
- The entity containing the statement. This may e.g. be an SQL
statement directly or a macro containing the statement.typeResolution
- The type resolution. This typically comes directly from the check
context.public static boolean isFunctionCallOfAny(ShallowEntity entity, java.lang.String... functionNames) throws CheckException
CheckException
public static java.lang.String getNormalizedStartTokensText(ShallowEntity entity, ICheckContext context) throws CheckException
ShallowEntity
(typically for statement). Normalization is performed as follows:
1) full comment lines (introduced with *) are removed
2) mid-line comments (introduced with ") will be removed (unless a ' follows the " since it is assumed that the " is within a String literal in that case).
3) white spaces before the closing . are removed
4) all (sequences of) white spaces are replaced by a single space
CheckException
public static boolean hasMetaCommentForRfcEnablement(java.lang.String unfilteredContent)
public static boolean hasMetaCommentForRfcEnablement(java.util.List<java.lang.String> contentLines)