public class GenericWhitespaceCheck extends Check
Checks that the whitespace around the Generic tokens (angle brackets) "<" and ">" are correct to the typical convention. The convention is not configurable.
Left angle bracket ("<"):
Right angle bracket (">"):
Examples with correct spacing:
public void <K, V extends Number> boolean foo(K, V) {} // Generic methods definitions
class name<T1, T2, ..., Tn> {} // Generic type definition
OrderedPair<String, Box<Integer>> p; // Generic type reference
boolean same = Util.<Integer, String>compare(p1, p2); // Generic preceded method name
Pair<Integer, String> p1 = new Pair<>(1, "apple");// Diamond operator
| Constructor and Description |
|---|
GenericWhitespaceCheck() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTree(DetailAST rootAST)
Called before the starting to process a tree.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLine, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic GenericWhitespaceCheck()
public int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic void beginTree(DetailAST rootAST)
Checkpublic void visitToken(DetailAST ast)
CheckvisitToken in class Checkast - the token to processCopyright © 2001–2015. All rights reserved.