Package com.google.googlejavaformat.java
Class Trees
- java.lang.Object
-
- com.google.googlejavaformat.java.Trees
-
class Trees extends java.lang.ObjectUtilities for working withTrees.
-
-
Constructor Summary
Constructors Constructor Description Trees()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (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 javax.lang.model.element.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 java.lang.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 java.lang.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.
-
-
-
Method Detail
-
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
static java.lang.String getSourceForNode(com.sun.source.tree.Tree node, com.sun.source.util.TreePath path)Returns the source text for the node.
-
getMethodName
static javax.lang.model.element.Name getMethodName(com.sun.source.tree.MethodInvocationTree methodInvocation)
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
static java.lang.String operatorName(com.sun.source.tree.ExpressionTree expression)
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.
-
-