Package com.google.googlejavaformat.java
Class Trees
java.lang.Object
com.google.googlejavaformat.java.Trees
Utilities for working with
Trees.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static com.sun.source.tree.ClassTreegetEnclosingTypeDeclaration(com.sun.source.util.TreePath path) Returns the enclosing type declaration (class, enum, interface, or annotation) for the given path.(package private) static intgetEndPosition(com.sun.source.tree.Tree expression, com.sun.source.util.TreePath path) Returns the source end position of the node.(package private) static intgetLength(com.sun.source.tree.Tree tree, com.sun.source.util.TreePath path) Returns the length of the source for the node.(package private) static NamegetMethodName(com.sun.source.tree.MethodInvocationTree methodInvocation) Returns the simple name of a (possibly qualified) method invocation expression.(package private) static com.sun.source.tree.ExpressionTreegetMethodReceiver(com.sun.source.tree.MethodInvocationTree methodInvocation) Returns the receiver of a qualified method invocation expression, ornull.(package private) static StringgetSourceForNode(com.sun.source.tree.Tree node, com.sun.source.util.TreePath path) Returns the source text for the node.(package private) static intgetStartPosition(com.sun.source.tree.Tree expression) Returns the source start position of the node.(package private) static StringoperatorName(com.sun.source.tree.ExpressionTree expression) Returns the string name of an operator, including assignment and compound assignment.(package private) static intprecedence(com.sun.source.tree.ExpressionTree expression) Returns the precedence of an expression's operator.(package private) static com.sun.source.tree.ExpressionTreeskipParen(com.sun.source.tree.ExpressionTree node) Skips a single parenthesized tree.
-
Constructor Details
-
Trees
Trees()
-
-
Method Details
-
getLength
static int getLength(com.sun.source.tree.Tree tree, com.sun.source.util.TreePath path) Returns the length of the source for the node. -
getStartPosition
static int getStartPosition(com.sun.source.tree.Tree expression) Returns the source start position of the node. -
getEndPosition
static int getEndPosition(com.sun.source.tree.Tree expression, com.sun.source.util.TreePath path) Returns the source end position of the node. -
getSourceForNode
Returns the source text for the node. -
getMethodName
Returns the simple name of a (possibly qualified) method invocation expression. -
getMethodReceiver
static com.sun.source.tree.ExpressionTree getMethodReceiver(com.sun.source.tree.MethodInvocationTree methodInvocation) Returns the receiver of a qualified method invocation expression, ornull. -
operatorName
Returns the string name of an operator, including assignment and compound assignment. -
precedence
static int precedence(com.sun.source.tree.ExpressionTree expression) Returns the precedence of an expression's operator. -
getEnclosingTypeDeclaration
static com.sun.source.tree.ClassTree getEnclosingTypeDeclaration(com.sun.source.util.TreePath path) Returns the enclosing type declaration (class, enum, interface, or annotation) for the given path. -
skipParen
static com.sun.source.tree.ExpressionTree skipParen(com.sun.source.tree.ExpressionTree node) Skips a single parenthesized tree.
-