com.puppycrawl.tools.checkstyle.checks
Class LineSeparatorOption

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.checks.AbstractOption
      extended bycom.puppycrawl.tools.checkstyle.checks.LineSeparatorOption
All Implemented Interfaces:
java.io.Serializable

public final class LineSeparatorOption
extends AbstractOption

Represents the options for line separator settings.

Author:
lkuehne
See Also:
NewlineAtEndOfFileCheck, Serialized Form

Field Summary
static LineSeparatorOption CR
          Mac-style line separators.
static LineSeparatorOption CRLF
          Windows-style line separators.
static LineSeparatorOption LF
          Unix-style line separators.
static LineSeparatorOption SYSTEM
          System default line separators.
 
Method Summary
protected  java.util.Map getStrToOpt()
          Returns the map from string representations to options.
 int length()
           
 boolean matches(byte[] aBytes)
           
 
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractOption
decode, readResolve, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CRLF

public static final LineSeparatorOption CRLF
Windows-style line separators.


CR

public static final LineSeparatorOption CR
Mac-style line separators.


LF

public static final LineSeparatorOption LF
Unix-style line separators.


SYSTEM

public static final LineSeparatorOption SYSTEM
System default line separators.

Method Detail

matches

public boolean matches(byte[] aBytes)
Parameters:
aBytes - a bytes array to check
Returns:
if aBytes is equal to the byte representation of this line separator

length

public int length()
Returns:
the length of the file separator, e.g. 1 for CR, 2 for CRLF, ...

getStrToOpt

protected java.util.Map getStrToOpt()
Description copied from class: AbstractOption
Returns the map from string representations to options.

Specified by:
getStrToOpt in class AbstractOption
Returns:
Map from strings to options.
See Also:
AbstractOption

Back to the Checkstyle Home Page