|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.grammatica.code.CodeStyle
The abstract 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.
Field Summary | |
static CodeStyle |
CSHARP
The default C# code style. |
static CodeStyle |
JAVA
The default Java 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)
Adds '\' escapes in front of all '"' and '\' 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)
Creates a string constant from the specified string. |
java.lang.String |
getUpperCase(java.lang.String str)
Returns the upper-case version of 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 JAVA
public static final CodeStyle CSHARP
Constructor Detail |
public CodeStyle(int margin, java.lang.String indent)
margin
- the print marginindent
- the indentation stringMethod Detail |
public int getMargin()
public java.lang.String getIndent(int level)
level
- the indentation level
public java.lang.String getStringConstant(java.lang.String str)
str
- the string to convert
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)
str
- the string to convert
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |