static class ConformanceRules.BannedProperty extends ConformanceRules.AbstractRule
Modifier and Type | Class and Description |
---|---|
private static class |
ConformanceRules.BannedProperty.Property |
Modifier and Type | Field and Description |
---|---|
private com.google.common.collect.ImmutableList<ConformanceRules.BannedProperty.Property> |
props |
private Requirement.Type |
requirementType |
compiler, message, onlyApplyTo, onlyApplyToRegexp, whitelist, whitelistRegexp
Constructor and Description |
---|
BannedProperty(AbstractCompiler compiler,
Requirement requirement) |
Modifier and Type | Method and Description |
---|---|
protected ConformanceRules.ConformanceResult |
checkConformance(NodeTraversal t,
Node n) |
private ConformanceRules.ConformanceResult |
checkConformance(NodeTraversal t,
Node n,
ConformanceRules.BannedProperty.Property prop) |
private static java.lang.String |
getClassFromDeclarationName(java.lang.String specName)
From a provide name extract the class name.
|
private static java.lang.String |
getPropertyFromDeclarationName(java.lang.String specName)
From a provide name extract the method name.
|
private boolean |
isCandidatePropUse(Node n,
ConformanceRules.BannedProperty.Property prop)
Determines if
n is a potentially banned use of prop . |
private boolean |
matchesPrototype(JSType type,
JSType maybePrototype) |
check, report, shouldCheckConformance
private final com.google.common.collect.ImmutableList<ConformanceRules.BannedProperty.Property> props
private final Requirement.Type requirementType
BannedProperty(AbstractCompiler compiler, Requirement requirement) throws CheckConformance.InvalidRequirementSpec
protected ConformanceRules.ConformanceResult checkConformance(NodeTraversal t, Node n)
checkConformance
in class ConformanceRules.AbstractRule
private ConformanceRules.ConformanceResult checkConformance(NodeTraversal t, Node n, ConformanceRules.BannedProperty.Property prop)
private boolean isCandidatePropUse(Node n, ConformanceRules.BannedProperty.Property prop)
n
is a potentially banned use of prop
.
Specifically this is the case if n
is a use of a property with
the name specified by prop
. Furthermore, if the conformance
requirement under consideration only bans assignment to the property,
n
is only a candidate if it is an l-value.private static java.lang.String getPropertyFromDeclarationName(java.lang.String specName)
private static java.lang.String getClassFromDeclarationName(java.lang.String specName)