
public class RuleGenerateWith extends Rule
| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
ALL_PROPERTIES |
runtimeRebindRuleGenerator| Constructor and Description |
|---|
RuleGenerateWith(Class<? extends Generator> generatorClass) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
caresAboutProperties(Set<String> propertyNames)
Returns whether the output of the Generator being managed by this rule is modified by or
whether the rules embedded condition is judging any of the properties whose names have been
passed.
Makes it possible for external callers to watch the changing property environment and only trigger Generators within Rules whose output might have changed. |
boolean |
contentDependsOnTypes()
Returns whether the output of the Generator being managed by this rule depends on access to the
global set of types to be able to run accurately.
|
boolean |
equals(Object obj) |
void |
generate(TreeLogger logger,
Properties moduleProperties,
GeneratorContext context,
String typeName)
Generate all possible Generator output for the wrapped Generator in combination with the scope
of Properties and values known about by the passed GeneratorContext.
|
protected String |
generateCreateInstanceExpression()
Generate and return a String of Java source that will create an instance of whatever type this
Rule intends to rebind to.
|
protected String |
generateMatchesExpression()
Generate and return a String of Java source that will act as a condition to filter the runtime
environment and only pass when the Rule's intended conditions are met.
|
static Set<String> |
getAccessedPropertyNames(Class<? extends Generator> generatorClass)
Returns a Set of the names of properties that will be accessed by the given Generator.
|
protected Generator |
getGenerator() |
String |
getName()
Returns the name of the class of Generator being managed here.
|
int |
hashCode() |
RebindResult |
realize(TreeLogger logger,
StandardGeneratorContext context,
String typeName) |
boolean |
relevantPropertiesAreFinal(Properties currentProperties,
Properties finalProperties) |
String |
toString() |
dispose, generateRuntimeRebindClasses, getFallbackEvaluationCost, getRootCondition, isApplicablepublic static Set<String> getAccessedPropertyNames(Class<? extends Generator> generatorClass)
public boolean caresAboutProperties(Set<String> propertyNames)
public boolean contentDependsOnTypes()
public void generate(TreeLogger logger, Properties moduleProperties, GeneratorContext context, String typeName) throws UnableToCompleteException
UnableToCompleteExceptionpublic String getName()
public RebindResult realize(TreeLogger logger, StandardGeneratorContext context, String typeName) throws UnableToCompleteException
realize in class RuleUnableToCompleteExceptionpublic boolean relevantPropertiesAreFinal(Properties currentProperties, Properties finalProperties)
protected String generateCreateInstanceExpression()
RulegenerateCreateInstanceExpression in class Ruleprotected String generateMatchesExpression()
RulegenerateMatchesExpression in class Ruleprotected Generator getGenerator()
Copyright © 2018. All rights reserved.