public final class Matchers
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Matcher |
allOf(Matcher... matchers)
Returns a Matcher that returns true only if all of the provided
matchers match.
|
static Matcher |
anyOf(Matcher... matchers)
Returns a Matcher that returns true if any of the provided matchers match.
|
static Matcher |
anything()
Returns a Matcher that matches every node.
|
static Matcher |
assignmentWithRhs(Matcher rhsMatcher)
Returns a Matcher that matches an ASSIGN node where the RHS of the assignment matches the given
rhsMatcher.
|
static Matcher |
constructor()
Returns a matcher that matches any constructor definitions.
|
static Matcher |
constructor(java.lang.String name)
Returns a matcher that matches constructor definitions of the specified
name.
|
static Matcher |
constructorPropertyDeclaration()
Returns a Matcher that matches against properties that are declared in the constructor.
|
static Matcher |
enumDefinition()
Returns a Matcher that matches definitions of any enum.
|
static Matcher |
enumDefinitionOfType(java.lang.String type)
Returns a Matcher that matches definitions of an enum of the given type.
|
static Matcher |
functionCall()
Returns a Matcher that matches any function call.
|
static Matcher |
functionCall(java.lang.String name)
Returns a Matcher that matches all nodes that are function calls that match the provided name.
|
static Matcher |
functionCallWithNumArgs(int numArgs)
Returns a Matcher that matches any function call that has the given
number of arguments.
|
static Matcher |
functionCallWithNumArgs(java.lang.String name,
int numArgs)
Returns a Matcher that matches any function call that has the given
number of arguments and the given name.
|
static Matcher |
googModule() |
static Matcher |
googModuleOrProvide() |
static Matcher |
googRequire() |
static Matcher |
googRequire(java.lang.String namespace) |
static Matcher |
isPrivate()
Returns a Matcher that matches against nodes that are declared
@private . |
static Matcher |
jsDocType(java.lang.String type)
Returns a Matcher that matches nodes that contain JS Doc that specify the
@type annotation equivalent to the provided type. |
static Matcher |
newClass()
Returns a Matcher that matches constructing new objects.
|
static Matcher |
newClass(java.lang.String className)
Returns a Matcher that matches constructing objects of the provided class
name.
|
static Matcher |
not(Matcher matcher)
Returns a Matcher that matches the opposite of the provided matcher.
|
static Matcher |
propertyAccess()
Returns a Matcher that matches any property access.
|
static Matcher |
propertyAccess(java.lang.String name)
Returns a Matcher that matches nodes representing a GETPROP access of
an object property.
|
static Matcher |
prototypeMethodDeclaration()
Returns a Matcher that matches a declaration of a method on the
prototype of a class.
|
static Matcher |
prototypeVariableDeclaration()
Returns a Matcher that matches a declaration of a variable on the
prototype of a class.
|
public static Matcher anything()
public static Matcher allOf(Matcher... matchers)
public static Matcher anyOf(Matcher... matchers)
public static Matcher not(Matcher matcher)
public static Matcher constructor()
public static Matcher constructor(java.lang.String name)
name
- The name of the class constructor to match.public static Matcher newClass()
public static Matcher newClass(java.lang.String className)
className
- The name of the class to return matching NEW nodes.public static Matcher functionCall()
public static Matcher functionCall(java.lang.String name)
name
- The name of the function to match. For non-static functions, this must be the fully
qualified name that includes the type of the object. For instance: ns.AppContext.prototype.get
will match appContext.get
and this.get
when
called from the AppContext class.public static Matcher functionCallWithNumArgs(int numArgs)
public static Matcher functionCallWithNumArgs(java.lang.String name, int numArgs)
name
- The name of the function to match. For non-static functions,
this must be the fully qualified name that includes the type of the
object. For instance: ns.AppContext.prototype.get
will match
appContext.get
and this.get
when called from the
AppContext class.public static Matcher googRequire(java.lang.String namespace)
public static Matcher googRequire()
public static Matcher googModule()
public static Matcher googModuleOrProvide()
public static Matcher propertyAccess()
public static Matcher propertyAccess(java.lang.String name)
name
- The name of the property to match. For non-static properties,
this must be the fully qualified name that includes the type of the
object. For instance: ns.AppContext.prototype.root
will match appContext.root
and this.root
when accessed
from the AppContext.public static Matcher enumDefinition()
public static Matcher enumDefinitionOfType(java.lang.String type)
public static Matcher assignmentWithRhs(Matcher rhsMatcher)
public static Matcher prototypeVariableDeclaration()
public static Matcher prototypeMethodDeclaration()
public static Matcher jsDocType(java.lang.String type)
@type
annotation equivalent to the provided type.public static Matcher constructorPropertyDeclaration()
public static Matcher isPrivate()
@private
.Copyright © 2009-2018 Google. All Rights Reserved.