|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.sourceflow.CodeStyle
The base class for all code styles. The code style classes allows configuring some aspects of the source code generated. The code style classes also contain helper methods for the code generators. To create new code styles, this class should be subclassed.
| Field Summary | |
static CodeStyle |
C
The default C code style. |
static CodeStyle |
CSHARP
The default C# code style. |
static CodeStyle |
JAVA
The default Java code style. |
static CodeStyle |
VISUAL_BASIC
The default Visual Basic code style. |
| Constructor Summary | |
CodeStyle(int margin,
java.lang.String indent)
Creates a new code style. |
|
| Method Summary | |
java.lang.String |
addStringEscapes(java.lang.String str,
char escape)
Adds escapes in front of all " characters in a string. |
java.lang.String |
getIndent(int level)
Returns the indentation string for the specified level. |
java.lang.String |
getLowerCase(java.lang.String str)
Returns the lower-case version of a string. |
int |
getMargin()
Returns the right print margin. |
java.lang.String |
getMixedCase(java.lang.String str,
boolean initialUpper)
Returns the mixed-case version of a string. |
java.lang.String |
getStringConstant(java.lang.String str,
char escape)
Creates a string constant from the specified string. |
java.lang.String |
getUpperCase(java.lang.String str)
Returns the upper-case version of a string. |
java.util.ArrayList |
lineBreak(java.lang.String str,
int margin)
Returns a list with all the lines in a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final CodeStyle C
public static final CodeStyle CSHARP
public static final CodeStyle JAVA
public static final CodeStyle VISUAL_BASIC
| Constructor Detail |
public CodeStyle(int margin,
java.lang.String indent)
margin - the print marginindent - the indentation string| Method Detail |
public int getMargin()
public java.lang.String getIndent(int level)
level - the indentation level
public java.lang.String getStringConstant(java.lang.String str,
char escape)
str - the string to convertescape - the escape character to use
public java.lang.String getUpperCase(java.lang.String str)
str - the string to transform
public java.lang.String getLowerCase(java.lang.String str)
str - the string to transform
public java.lang.String getMixedCase(java.lang.String str,
boolean initialUpper)
str - the string to transforminitialUpper - the first character upper-case flag
public java.lang.String addStringEscapes(java.lang.String str,
char escape)
str - the string to convertescape - the escape character to use
public java.util.ArrayList lineBreak(java.lang.String str,
int margin)
str - the string to line breakmargin - the maximum line length
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||