public class RuleUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AnnotationExtensions |
_annotationExtensions |
protected ElementsExtensions |
_elementsExtensions |
protected ELSupport |
_eLSupport |
protected GenerateClassContext |
_generateClassContext |
protected GenExtensions |
_genExtensions |
protected MessageCollector |
_messageCollector |
protected RuleFactory |
_ruleFactory |
protected TypesExtensions |
_typesExtensions |
static org.eclipse.xtext.xbase.lib.Functions.Function0<Boolean> |
ALWAYS_ACTIVE |
static org.eclipse.xtext.xbase.lib.Functions.Function0<String> |
NO_NAME |
static org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Iterable<?>> |
SINGLE_SRC_ELEMENT |
static org.eclipse.xtext.xbase.lib.Functions.Function1<? super Object,?> |
templateAnnotationValueTransformer |
protected TypesRegistry |
typesRegistry |
protected TypeResolver |
typesResolver |
| Constructor and Description |
|---|
RuleUtils() |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> |
createActivationRule(AnnotationMirror metaAnnotation,
String avPrefix) |
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> |
createActivationRule(AnnotationMirror metaAnnotation,
String avPrefix,
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> defaultValue)
AV "cond" to enable or disable a rule
|
org.eclipse.xtext.xbase.lib.Functions.Function1<? super GenElement,? extends List<? extends AnnotationMirror>> |
createAnnotationMappingRules(AnnotationMirror metaAnnotation,
Element template,
String avPrefix)
Copies annotations from template at first (if there are any ) and then applies the annotation mappings
|
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends CharSequence> |
createCommentRule(AnnotationMirror metaAnnotation,
Element template,
String avPrefix,
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends CharSequence> defaultComment) |
ArrayList<ELVariableRule> |
createELVariableRules(AnnotationMirror metaAnnotation,
Element metaElement,
String avPrefix) |
org.eclipse.xtext.xbase.lib.Functions.Function0<?> |
createExpressionOrFunctionCallAndFilterRule(AnnotationMirror metaAnnotation,
Element metaElement,
String exprAV,
String funAV,
String langAV,
String filterExprAV,
String filterFunAV,
String collectExprAV,
String collectFunAV,
String toSetAV,
String groupByAV,
String groupByFunAV,
String typeAV,
String avPrefix,
org.eclipse.xtext.xbase.lib.Functions.Function0<?> defaultValue,
boolean nullable,
String uniqueAV)
Evaluates and expression and / or function(s) and optionally filters the results.
|
ArrayList<LibraryRule> |
createLibraryRules(AnnotationMirror metaAnnotation,
String avPrefix) |
List<MatcherRule> |
createMatcherRules(AnnotationMirror annotation,
CharSequence avName)
Gets a list of element matchers from an annotation.
|
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Set<Modifier>> |
createModifiersRule(AnnotationMirror metaAnnotation,
Element template,
String avPrefix) |
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends String> |
createNameExprRule(AnnotationMirror metaAnnotation,
Element template,
String avPrefix)
To set the name of the generated element either statically (AV: name) or dynamically (AV: nameExpr)
|
org.eclipse.xtext.xbase.lib.Functions.Function1<? super CharSequence,? extends Boolean> |
createNameInSetRule(AnnotationMirror metaAnnotation,
String avName) |
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends List<? extends GenParameter>> |
createParamRule(AnnotationMirror paramAnnotation,
VariableElement template,
String avPrefix) |
protected org.eclipse.xtext.xbase.lib.Functions.Function0<? extends List<? extends GenParameter>> |
createParamRules(AnnotationMirror paramsAnnotation,
ExecutableElement template,
String avPrefix) |
<T> ScopeRule<T> |
createScopeRule(AnnotationMirror metaAnnotation,
Element metaElement,
boolean isLibrary,
String avPrefix) |
<T> ScopeRule<T> |
createScopeRule(AnnotationMirror metaAnnotation,
Element metaElement,
boolean isLibrary,
String avPrefix,
boolean createSrcRule)
Rule that creates a new scope for each src element given by the source rule and executes the given closure within that scope.
|
<T> ScopeRule<T> |
createScopeRule(AnnotationMirror metaAnnotation,
Element metaElement,
String avPrefix)
Scope rule that gets the source element from "src" AV
|
<T> ScopeRule<T> |
createScopeRule(AnnotationMirror metaAnnotation,
Element metaElement,
String avPrefix,
org.eclipse.xtext.xbase.lib.Functions.Function0<?> srcRule) |
org.eclipse.xtext.xbase.lib.Functions.Function0<?> |
createSrcRule(AnnotationMirror metaAnnotation,
String avPrefix)
Provides the source element(s) for rules
|
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends TypeMirror> |
createTypeRule(AnnotationMirror metaAnnotation,
TypeMirror template,
String avPrefix) |
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends TypeMirror> |
createTypeRule(AnnotationMirror metaAnnotation,
TypeMirror template,
String avName,
String avPrefix,
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends TypeMirror> defaultValue) |
<T> T |
handleException(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> errorResult,
String avName,
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> closure) |
boolean |
isVariable(Element memberElement) |
StringBuffer |
replaceExpressionInTemplate(CharSequence template,
boolean noSyntaxRestrictions,
String lang,
boolean autoCamelCase) |
ScopeRule |
scopeWithCurrentSrc() |
static String |
withPrefix(CharSequence name,
String prefix) |
@Extension protected final transient ElementsExtensions _elementsExtensions
@Extension protected final transient ELSupport _eLSupport
@Extension protected final transient MessageCollector _messageCollector
@Extension protected final transient AnnotationExtensions _annotationExtensions
@Extension protected final transient GenExtensions _genExtensions
@Extension protected final transient TypeResolver typesResolver
@Extension protected final transient GenerateClassContext _generateClassContext
@Extension protected final transient TypesExtensions _typesExtensions
@Extension protected final transient RuleFactory _ruleFactory
@Extension protected final transient TypesRegistry typesRegistry
public static final org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Iterable<?>> SINGLE_SRC_ELEMENT
public static final org.eclipse.xtext.xbase.lib.Functions.Function0<Boolean> ALWAYS_ACTIVE
public static final org.eclipse.xtext.xbase.lib.Functions.Function0<String> NO_NAME
public static final org.eclipse.xtext.xbase.lib.Functions.Function1<? super Object,?> templateAnnotationValueTransformer
public static String withPrefix(CharSequence name, String prefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<?> createSrcRule(AnnotationMirror metaAnnotation, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<?> createExpressionOrFunctionCallAndFilterRule(AnnotationMirror metaAnnotation, Element metaElement, String exprAV, String funAV, String langAV, String filterExprAV, String filterFunAV, String collectExprAV, String collectFunAV, String toSetAV, String groupByAV, String groupByFunAV, String typeAV, String avPrefix, org.eclipse.xtext.xbase.lib.Functions.Function0<?> defaultValue, boolean nullable, String uniqueAV)
public <T> ScopeRule<T> createScopeRule(AnnotationMirror metaAnnotation, Element metaElement, String avPrefix)
public <T> ScopeRule<T> createScopeRule(AnnotationMirror metaAnnotation, Element metaElement, boolean isLibrary, String avPrefix)
public <T> ScopeRule<T> createScopeRule(AnnotationMirror metaAnnotation, Element metaElement, String avPrefix, org.eclipse.xtext.xbase.lib.Functions.Function0<?> srcRule)
public <T> ScopeRule<T> createScopeRule(AnnotationMirror metaAnnotation, Element metaElement, boolean isLibrary, String avPrefix, boolean createSrcRule)
public ArrayList<LibraryRule> createLibraryRules(AnnotationMirror metaAnnotation, String avPrefix)
public ScopeRule scopeWithCurrentSrc()
public ArrayList<ELVariableRule> createELVariableRules(AnnotationMirror metaAnnotation, Element metaElement, String avPrefix)
public boolean isVariable(Element memberElement)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> createActivationRule(AnnotationMirror metaAnnotation, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> createActivationRule(AnnotationMirror metaAnnotation, String avPrefix, org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Boolean> defaultValue)
public StringBuffer replaceExpressionInTemplate(CharSequence template, boolean noSyntaxRestrictions, String lang, boolean autoCamelCase)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends String> createNameExprRule(AnnotationMirror metaAnnotation, Element template, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function1<? super GenElement,? extends List<? extends AnnotationMirror>> createAnnotationMappingRules(AnnotationMirror metaAnnotation, Element template, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends Set<Modifier>> createModifiersRule(AnnotationMirror metaAnnotation, Element template, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends TypeMirror> createTypeRule(AnnotationMirror metaAnnotation, TypeMirror template, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends TypeMirror> createTypeRule(AnnotationMirror metaAnnotation, TypeMirror template, String avName, String avPrefix, org.eclipse.xtext.xbase.lib.Functions.Function0<? extends TypeMirror> defaultValue)
protected org.eclipse.xtext.xbase.lib.Functions.Function0<? extends List<? extends GenParameter>> createParamRules(AnnotationMirror paramsAnnotation, ExecutableElement template, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends List<? extends GenParameter>> createParamRule(AnnotationMirror paramAnnotation, VariableElement template, String avPrefix)
public org.eclipse.xtext.xbase.lib.Functions.Function0<? extends CharSequence> createCommentRule(AnnotationMirror metaAnnotation, Element template, String avPrefix, org.eclipse.xtext.xbase.lib.Functions.Function0<? extends CharSequence> defaultComment)
public org.eclipse.xtext.xbase.lib.Functions.Function1<? super CharSequence,? extends Boolean> createNameInSetRule(AnnotationMirror metaAnnotation, String avName)
public List<MatcherRule> createMatcherRules(AnnotationMirror annotation, CharSequence avName)
public <T> T handleException(org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> errorResult,
String avName,
org.eclipse.xtext.xbase.lib.Functions.Function0<? extends T> closure)
Copyright © 2018. All rights reserved.