Enum CommentHandlers
- All Implemented Interfaces:
- Serializable,- Comparable<CommentHandlers>,- CommentHandler
Defines a number of default 
CommentHandlers.- Since:
- 4.0.0
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionCommentHandlerfor comments prefixed by a//escape.CommentHandlerfor comments prefixed by the#character.CommentHandlerfor comments delineated using/* *\.CommentHandlerfor comments delineated using<!-- -->.
- 
Method SummaryModifier and TypeMethodDescriptionstatic @Nullable StringextractComment(BufferedReader reader, Iterable<CommentHandler> allowedHeaderTypes) Uses provided comment handlers to extract a comment from the reader.@Nullable StringextractHeader(BufferedReader reader) Defines the handlers behaviour for reading comments.Converts the specified lines into a comment.static CommentHandlersReturns 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.
- 
Enum Constant Details- 
HASHCommentHandlerfor comments prefixed by the#character.
- 
DOUBLE_SLASHCommentHandlerfor comments prefixed by a//escape.
- 
SLASH_BLOCKCommentHandlerfor comments delineated using/* *\.
- 
XML_STYLECommentHandlerfor comments delineated using<!-- -->.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum type has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
extractHeaderDescription copied from interface:CommentHandlerDefines the handlers behaviour for reading comments.- Specified by:
- extractHeaderin interface- CommentHandler
- Parameters:
- reader- reader to get input from
- Returns:
- an extracted comment, if any
- Throws:
- IOException- if any IO error occurs in the process
 
- 
toCommentDescription copied from interface:CommentHandlerConverts the specified lines into a comment.- Specified by:
- toCommentin interface- CommentHandler
- Parameters:
- lines- lines to make a comment
- Returns:
- transformed lines as a stream
 
- 
extractCommentpublic static @Nullable String extractComment(BufferedReader reader, Iterable<CommentHandler> allowedHeaderTypes) throws IOException Uses provided comment handlers to extract a comment from the reader.- Parameters:
- reader- to extract a comment from
- allowedHeaderTypes- handlers to try
- Returns:
- extracted comment, or null if a comment could not be extracted
- Throws:
- IOException- if an IO error occurs
- Since:
- 4.0.0
 
 
-