public final class CheckUtil extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static FullIdent |
createFullType(DetailAST typeAST)
Creates
FullIdent for given type node. |
static AccessModifierOption |
getAccessModifierFromModifiersToken(DetailAST modifiersToken)
Returns
AccessModifierOption based on the information about access modifier
taken from the given token of type TokenTypes.MODIFIERS . |
static DetailAST |
getFirstNode(DetailAST node)
Finds sub-node for given node minimal (line, column) pair.
|
static java.util.List<java.lang.String> |
getTypeParameterNames(DetailAST node)
Retrieves the names of the type parameters to the node.
|
static java.util.List<DetailAST> |
getTypeParameters(DetailAST node)
Retrieves the type parameters to the node.
|
static boolean |
isBeforeInSource(DetailAST ast1,
DetailAST ast2)
Retrieves whether ast1 is located before ast2.
|
static boolean |
isElseIf(DetailAST ast)
Returns whether a token represents an ELSE as part of an ELSE / IF set.
|
static boolean |
isEqualsMethod(DetailAST ast)
Tests whether a method definition AST defines an equals covariant.
|
static boolean |
isGetterMethod(DetailAST ast)
Returns whether an AST represents a getter method.
|
static boolean |
isNonVoidMethod(DetailAST methodDefAst)
Checks whether a method is a not void one.
|
static boolean |
isReceiverParameter(DetailAST parameterDefAst)
Checks whether a parameter is a receiver.
|
static boolean |
isSetterMethod(DetailAST ast)
Returns whether an AST represents a setter method.
|
static java.util.Set<java.lang.String> |
parseClassNames(java.lang.String... classNames)
Create set of class names and short class names.
|
static double |
parseDouble(java.lang.String text,
int type)
Returns the value represented by the specified string of the specified
type.
|
static java.lang.String |
stripIndentAndInitialNewLineFromTextBlock(java.lang.String textBlockContent)
Strip initial newline and preceding whitespace on each line from text block content.
|
public static FullIdent createFullType(DetailAST typeAST)
FullIdent
for given type node.typeAST
- a type node.FullIdent
for given type.public static boolean isEqualsMethod(DetailAST ast)
ast
- the method definition AST to test.
Precondition: ast is a TokenTypes.METHOD_DEF node.public static boolean isElseIf(DetailAST ast)
ast
- the token to checkpublic static double parseDouble(java.lang.String text, int type)
text
- the string to be parsed.type
- the token type of the text. Should be a constant of
TokenTypes
.public static DetailAST getFirstNode(DetailAST node)
node
- the root of tree for search.public static boolean isBeforeInSource(DetailAST ast1, DetailAST ast2)
ast1
- the first node.ast2
- the second node.public static java.util.List<java.lang.String> getTypeParameterNames(DetailAST node)
node
- the parameterized AST nodepublic static java.util.List<DetailAST> getTypeParameters(DetailAST node)
node
- the parameterized AST nodepublic static boolean isSetterMethod(DetailAST ast)
ast
- the AST to check withpublic static boolean isGetterMethod(DetailAST ast)
ast
- the AST to check withpublic static boolean isNonVoidMethod(DetailAST methodDefAst)
methodDefAst
- the method node.public static boolean isReceiverParameter(DetailAST parameterDefAst)
parameterDefAst
- the parameter node.public static AccessModifierOption getAccessModifierFromModifiersToken(DetailAST modifiersToken)
AccessModifierOption
based on the information about access modifier
taken from the given token of type TokenTypes.MODIFIERS
.modifiersToken
- token of type TokenTypes.MODIFIERS
.AccessModifierOption
.java.lang.IllegalArgumentException
- when expected non-null modifiersToken with type 'MODIFIERS'public static java.util.Set<java.lang.String> parseClassNames(java.lang.String... classNames)
classNames
- array of class names.public static java.lang.String stripIndentAndInitialNewLineFromTextBlock(java.lang.String textBlockContent)
textBlockContent
- the actual content of the text block.Copyright © 2001-2020. All Rights Reserved.