public final class CorePatternLanguageHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static PatternBody |
containerPatternBody(ValueReference val) |
static java.util.Map<java.lang.String,java.lang.Object> |
evaluateAnnotationParameters(Annotation annotation) |
static java.util.Collection<org.eclipse.xtext.xbase.XExpression> |
getAllTopLevelXBaseExpressions(org.eclipse.emf.ecore.EObject patternOrBody) |
static org.eclipse.emf.common.util.EList<Variable> |
getAllVariablesInBody(PatternBody body,
org.eclipse.emf.common.util.EList<Variable> previous) |
static java.util.Collection<ValueReference> |
getAnnotationParameters(Annotation annotation,
java.lang.String parameterName)
Returns all annotation parameters with a selected name
|
static java.util.Collection<Annotation> |
getAnnotationsByName(Pattern pattern,
java.lang.String name)
Returns the collection of annotations of a pattern by a name.
|
static Annotation |
getFirstAnnotationByName(Pattern pattern,
java.lang.String name)
Returns the first annotation of a given name from a pattern.
|
static ValueReference |
getFirstAnnotationParameter(Annotation annotation,
java.lang.String parameterName)
Returns the first annotation parameter with a selected name.
|
static java.lang.String |
getFullyQualifiedName(Pattern pattern)
Returns the name of the pattern, qualified by package name.
|
static java.lang.String |
getPackageName(Pattern pattern)
Returns the name of the container package of the selected pattern
|
static Variable |
getParameterByName(Pattern pattern,
java.lang.String name)
Returns the parameter of a pattern by name
|
static java.util.Map<java.lang.String,java.lang.Integer> |
getParameterPositionsByName(Pattern pattern)
Compiles a map for name-based lookup of symbolic parameter positions.
|
static java.util.Set<Pattern> |
getReferencedPatterns(Pattern sourcePattern)
Finds all patterns referenced from the given pattern.
|
static java.util.Set<Pattern> |
getReferencedPatternsTransitive(Pattern pattern) |
static java.util.Set<Variable> |
getReferencedPatternVariablesOfXExpression(org.eclipse.xtext.xbase.XExpression xExpression,
org.eclipse.xtext.xbase.jvmmodel.IJvmModelAssociations associations)
Finds all pattern variables referenced from the given XExpression.
|
static java.util.List<Variable> |
getUnnamedRunningVariables(PatternBody patternBody) |
static java.util.List<Variable> |
getUsedVariables(org.eclipse.xtext.xbase.XExpression xExpression,
java.lang.Iterable<Variable> allVariables) |
static boolean |
getValueOfFirstBooleanAnnotationParameter(Annotation annotation,
java.lang.String parameterName,
boolean defaultValue)
Returns the value of the first Boolean annotation parameter with the given name.
|
static java.util.Set<Variable> |
getVariablesFromValueReference(ValueReference valueReference) |
static boolean |
hasXBaseExpression(Pattern pattern) |
static boolean |
isPrivate(Pattern pattern) |
public static java.lang.String getPackageName(Pattern pattern)
public static java.lang.String getFullyQualifiedName(Pattern pattern)
public static boolean isPrivate(Pattern pattern)
pattern
- public static boolean hasXBaseExpression(Pattern pattern)
pattern
- public static java.util.Collection<org.eclipse.xtext.xbase.XExpression> getAllTopLevelXBaseExpressions(org.eclipse.emf.ecore.EObject patternOrBody)
public static Variable getParameterByName(Pattern pattern, java.lang.String name)
pattern
- name
- public static java.util.Map<java.lang.String,java.lang.Integer> getParameterPositionsByName(Pattern pattern)
public static java.util.Set<Variable> getReferencedPatternVariablesOfXExpression(org.eclipse.xtext.xbase.XExpression xExpression, org.eclipse.xtext.xbase.jvmmodel.IJvmModelAssociations associations)
Warning This method cannot be used in JvmModelInferrer, as that is used to set up the list of available local variables.
public static java.util.List<Variable> getUsedVariables(org.eclipse.xtext.xbase.XExpression xExpression, java.lang.Iterable<Variable> allVariables)
public static org.eclipse.emf.common.util.EList<Variable> getAllVariablesInBody(PatternBody body, org.eclipse.emf.common.util.EList<Variable> previous)
public static java.util.Set<Pattern> getReferencedPatterns(Pattern sourcePattern)
public static java.util.Set<Pattern> getReferencedPatternsTransitive(Pattern pattern)
public static Annotation getFirstAnnotationByName(Pattern pattern, java.lang.String name)
getAnnotationsByName(Pattern, String)
pattern
- the pattern instancename
- the name of the annotation to returnpublic static java.util.Collection<Annotation> getAnnotationsByName(Pattern pattern, java.lang.String name)
#getAnnotationByName(Pattern, String)
pattern
- the pattern instancename
- the name of the annotation to returnpublic static java.util.Collection<ValueReference> getAnnotationParameters(Annotation annotation, java.lang.String parameterName)
annotation
- parameterName
- public static ValueReference getFirstAnnotationParameter(Annotation annotation, java.lang.String parameterName)
annotation
- parameterName
- public static boolean getValueOfFirstBooleanAnnotationParameter(Annotation annotation, java.lang.String parameterName, boolean defaultValue)
annotation
- parameterName
- defaultValue
- public static java.util.Set<Variable> getVariablesFromValueReference(ValueReference valueReference)
valueReference
- public static PatternBody containerPatternBody(ValueReference val)
public static java.util.List<Variable> getUnnamedRunningVariables(PatternBody patternBody)
patternBody
- public static java.util.Map<java.lang.String,java.lang.Object> evaluateAnnotationParameters(Annotation annotation)