public class RuleReplaceWith extends Rule
runtimeRebindRuleGenerator
Constructor and Description |
---|
RuleReplaceWith(String typeName) |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
generateRuntimeRebindClasses(TreeLogger logger,
ModuleDef module,
GeneratorContext context)
Generate runtime rebind classes that perform the same rebinding behavior represented by the
current Rule.
|
String |
getReplacementTypeName() |
RebindResult |
realize(TreeLogger logger,
StandardGeneratorContext context,
String typeName) |
String |
toString() |
dispose, getFallbackEvaluationCost, getRootCondition, isApplicable
public RuleReplaceWith(String typeName)
public void generateRuntimeRebindClasses(TreeLogger logger, ModuleDef module, GeneratorContext context) throws UnableToCompleteException
Rule
generateRuntimeRebindClasses
in class Rule
UnableToCompleteException
public String getReplacementTypeName()
public RebindResult realize(TreeLogger logger, StandardGeneratorContext context, String typeName) throws UnableToCompleteException
realize
in class Rule
UnableToCompleteException
protected String generateCreateInstanceExpression()
Rule
generateCreateInstanceExpression
in class Rule
protected String generateMatchesExpression()
Rule
generateMatchesExpression
in class Rule
Copyright © 2018. All rights reserved.