public abstract class RuleBasedConfigAspect<RuleType extends com.google.protobuf.Message,AttributeType> extends ConfigAspectBase
In many cases, RuleType == AttributeType, but in some possibly not.
| Modifier | Constructor and Description |
|---|---|
protected |
RuleBasedConfigAspect(Model model,
com.google.inject.Key<AttributeType> key,
java.lang.String aspectName,
com.google.protobuf.Descriptors.Descriptor ruleDescriptor,
java.util.List<RuleType> rules) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addToRuleBuilder(com.google.api.Service.Builder builder,
java.lang.String selector,
AttributeType attribute)
Adds a rule back to the rule builder, specialized for the given selector.
|
protected abstract void |
clearRuleBuilder(com.google.api.Service.Builder builder)
Clears the rule builder during normalization.
|
void |
endMerging()
Default implementation ending merging; does nothing.
|
protected abstract AttributeType |
evaluate(ProtoElement element,
RuleType rule,
boolean isFromIdl)
Evaluates the rule w.r.t.
|
protected RuleType |
fromIdlLayer(ProtoElement element)
Attempts to synthesize the rule from the IDL, e.g.
|
protected abstract boolean |
isApplicable(ProtoElement element)
Predicate determining whether a rule of the aspect is applicable to the element.
|
void |
merge(ProtoElement element)
Default implementation for merging an element; does nothing.
|
void |
normalize(ProtoElement element,
com.google.api.Service.Builder builder)
Default implementation to normalize an element; does nothing.
|
void |
startNormalization(com.google.api.Service.Builder builder)
Default implementation of starting normalization; does nothing.
|
asDiagCollector, endLinting, endNormalization, error, getAspectName, getDocumentation, getDocumentationTitle, getLintRuleNames, getLocationInConfig, getLocationOfRepeatedFieldInConfig, getModel, lint, lintWarning, registerLintRule, registerLintRuleName, startLinting, startMerging, warningclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmergeDependenciesprotected RuleBasedConfigAspect(Model model, com.google.inject.Key<AttributeType> key, java.lang.String aspectName, com.google.protobuf.Descriptors.Descriptor ruleDescriptor, java.util.List<RuleType> rules)
protected abstract boolean isApplicable(ProtoElement element)
@Nullable protected RuleType fromIdlLayer(ProtoElement element)
@Nullable protected abstract AttributeType evaluate(ProtoElement element, RuleType rule, boolean isFromIdl)
protected abstract void clearRuleBuilder(com.google.api.Service.Builder builder)
protected abstract void addToRuleBuilder(com.google.api.Service.Builder builder,
java.lang.String selector,
AttributeType attribute)
public void merge(ProtoElement element)
ConfigAspectBasemerge in interface ConfigAspectmerge in class ConfigAspectBasepublic void endMerging()
ConfigAspectBaseendMerging in interface ConfigAspectendMerging in class ConfigAspectBasepublic void startNormalization(com.google.api.Service.Builder builder)
ConfigAspectBasestartNormalization in interface ConfigAspectstartNormalization in class ConfigAspectBasepublic void normalize(ProtoElement element, com.google.api.Service.Builder builder)
ConfigAspectBasenormalize in interface ConfigAspectnormalize in class ConfigAspectBase