Class BlockCommentPosition
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.utils.BlockCommentPosition
-
public final class BlockCommentPosition extends java.lang.Object
Utility class that has methods to check javadoc comment position in java file.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isOnAnnotationDef(DetailAST blockComment)
Node is on annotation definition.static boolean
isOnAnnotationField(DetailAST blockComment)
Node is on annotation field declaration.static boolean
isOnClass(DetailAST blockComment)
Node is on class definition.static boolean
isOnCompactConstructor(DetailAST blockComment)
Node is on compact constructor, note that we don't need to check for a plain token here, since a compact constructor must be public.static boolean
isOnConstructor(DetailAST blockComment)
Node is on constructor.static boolean
isOnEnum(DetailAST blockComment)
Node is on enum definition.static boolean
isOnEnumConstant(DetailAST blockComment)
Node is on enum constant.static boolean
isOnField(DetailAST blockComment)
Node is on field declaration.static boolean
isOnInterface(DetailAST blockComment)
Node is on interface definition.static boolean
isOnMember(DetailAST blockComment)
Node is on type member declaration.static boolean
isOnMethod(DetailAST blockComment)
Node is on method declaration.static boolean
isOnPackage(DetailAST blockComment)
Node is on package definition.static boolean
isOnRecord(DetailAST blockComment)
Node is on record definition.static boolean
isOnType(DetailAST blockComment)
Node is on type definition.
-
-
-
Method Detail
-
isOnType
public static boolean isOnType(DetailAST blockComment)
Node is on type definition.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before class, interface, enum or annotation.
-
isOnClass
public static boolean isOnClass(DetailAST blockComment)
Node is on class definition.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before class
-
isOnRecord
public static boolean isOnRecord(DetailAST blockComment)
Node is on record definition.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before class
-
isOnPackage
public static boolean isOnPackage(DetailAST blockComment)
Node is on package definition.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before package
-
isOnInterface
public static boolean isOnInterface(DetailAST blockComment)
Node is on interface definition.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before interface
-
isOnEnum
public static boolean isOnEnum(DetailAST blockComment)
Node is on enum definition.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before enum
-
isOnAnnotationDef
public static boolean isOnAnnotationDef(DetailAST blockComment)
Node is on annotation definition.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before annotation
-
isOnMember
public static boolean isOnMember(DetailAST blockComment)
Node is on type member declaration.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before method, field, constructor, enum constant or annotation field
-
isOnMethod
public static boolean isOnMethod(DetailAST blockComment)
Node is on method declaration.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before method
-
isOnField
public static boolean isOnField(DetailAST blockComment)
Node is on field declaration.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before field
-
isOnConstructor
public static boolean isOnConstructor(DetailAST blockComment)
Node is on constructor.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before constructor
-
isOnCompactConstructor
public static boolean isOnCompactConstructor(DetailAST blockComment)
Node is on compact constructor, note that we don't need to check for a plain token here, since a compact constructor must be public.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before compact constructor
-
isOnEnumConstant
public static boolean isOnEnumConstant(DetailAST blockComment)
Node is on enum constant.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before enum constant
-
isOnAnnotationField
public static boolean isOnAnnotationField(DetailAST blockComment)
Node is on annotation field declaration.- Parameters:
blockComment
- DetailAST- Returns:
- true if node is before annotation field
-
-