public class ConditionalBlockUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.EnumSet<EConditionalType> |
BLOCKS_CORRESPONDING_TO_IF
The blocks that correspond to an if block.
|
static java.util.EnumSet<EConditionalType> |
BLOCKS_CORRESPONDING_TO_SWITCH
The blocks that correspond to a switch block.
|
static java.util.EnumSet<EConditionalType> |
BLOCKS_WITH_CONDITION
The blocks that have a condition.
|
static java.util.EnumSet<EConditionalType> |
BLOCKS_WITHOUT_CONDITION
The blocks that do not have a condition.
|
static java.util.EnumSet<ETokenType> |
UNWANTED_TOKEN_TYPES_IN_CONDITION
The token types that get sorted out when extracting the condition
|
Constructor and Description |
---|
ConditionalBlockUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<IToken> |
extractCondition(ShallowEntity entity)
Extracts the tokens describing the condition out of the given list of tokens.
|
static EConditionalType |
getBlockTypeFromEntity(ShallowEntity entity)
Extracts the
EConditionalType from the given ShallowEntity . |
static EConditionalType |
getBlockTypeFromEntitySubtype(java.lang.String subtype)
Converts the Subtype of an entity represented by a string to the
corresponding
EConditionalType . |
public static final java.util.EnumSet<EConditionalType> BLOCKS_WITH_CONDITION
public static final java.util.EnumSet<EConditionalType> BLOCKS_WITHOUT_CONDITION
public static final java.util.EnumSet<EConditionalType> BLOCKS_CORRESPONDING_TO_IF
public static final java.util.EnumSet<EConditionalType> BLOCKS_CORRESPONDING_TO_SWITCH
public static final java.util.EnumSet<ETokenType> UNWANTED_TOKEN_TYPES_IN_CONDITION
public ConditionalBlockUtils()
public static EConditionalType getBlockTypeFromEntity(ShallowEntity entity) throws java.lang.IllegalArgumentException
EConditionalType
from the given ShallowEntity
.java.lang.IllegalArgumentException
public static EConditionalType getBlockTypeFromEntitySubtype(java.lang.String subtype) throws java.lang.IllegalArgumentException
EConditionalType
.java.lang.IllegalArgumentException
public static java.util.List<IToken> extractCondition(ShallowEntity entity)