public enum CommentHandlers extends Enum<CommentHandlers> implements CommentHandler
| Enum Constant and Description |
|---|
DOUBLE_SLASH |
HASH |
SLASH_BLOCK
Block comments delineated by
|
| Modifier and Type | Method and Description |
|---|---|
static String |
extractComment(BufferedReader reader,
CommentHandler... allowedHeaderTypes) |
Optional<String> |
extractHeader(BufferedReader reader) |
Collection<String> |
toComment(Collection<String> lines)
Convert the given lines into a comment
|
static CommentHandlers |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CommentHandlers[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CommentHandlers HASH
public static final CommentHandlers DOUBLE_SLASH
public static final CommentHandlers SLASH_BLOCK
public static CommentHandlers[] values()
for (CommentHandlers c : CommentHandlers.values()) System.out.println(c);
public static CommentHandlers valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Optional<String> extractHeader(BufferedReader reader) throws IOException
extractHeader in interface CommentHandlerIOExceptionpublic Collection<String> toComment(Collection<String> lines)
CommentHandlertoComment in interface CommentHandlerlines - The lines to make a commentpublic static String extractComment(BufferedReader reader, CommentHandler... allowedHeaderTypes) throws IOException
IOExceptionCopyright © 2014–2017. All rights reserved.