Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.checks
Class LeftCurlyOption  view LeftCurlyOption download LeftCurlyOption.java

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

public final class LeftCurlyOption
extends AbstractOption

Represents the options for placing the left curly brace '{'.

Version:
1

Field Summary
static LeftCurlyOption EOL
          Represents the policy for placing the brace at the end of line.
static LeftCurlyOption NL
          Represents the policy that the brace must always be on a new line.
static LeftCurlyOption NLOW
          Represents the policy that if the brace will fit on the first line of the statement, taking into account maximum line length, then apply EOL rule.
private static java.util.Map STR_TO_OPT
          maps from a string representation to an option
 
Fields inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractOption
 
Constructor Summary
private LeftCurlyOption(java.lang.String aStrRep)
          Creates a new LeftCurlyOption instance.
 
Method Summary
protected  java.util.Map getStrToOpt()
          Returns the map from string representations to options.
 
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

STR_TO_OPT

private static final java.util.Map STR_TO_OPT
maps from a string representation to an option


EOL

public static final LeftCurlyOption EOL
Represents the policy for placing the brace at the end of line. For example:
 if (condition) {
     ...
 


NLOW

public static final LeftCurlyOption NLOW
Represents the policy that if the brace will fit on the first line of the statement, taking into account maximum line length, then apply EOL rule. Otherwise apply the NL rule. NLOW is a mnemonic for "new line on wrap".

For the example above Checkstyle will enforce:

 if (condition) {
     ...
 
But for a statement spanning multiple lines, Checkstyle will enforce:
 if (condition1 && condition2 &&
     condition3 && condition4)
 {
     ...
 


NL

public static final LeftCurlyOption NL
Represents the policy that the brace must always be on a new line. For example:
 if (condition)
 {
     ...
 

Constructor Detail

LeftCurlyOption

private LeftCurlyOption(java.lang.String aStrRep)
Creates a new LeftCurlyOption instance.

Method Detail

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