|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.percederberg.grammatica.code.CodeElement | +--net.percederberg.grammatica.code.CodeElementContainer | +--net.percederberg.grammatica.code.csharp.CSharpType | +--net.percederberg.grammatica.code.csharp.CSharpEnumeration
A class generating a C# enumeration declaration.
Field Summary | |
static int |
INTERNAL
The internal access modifier constant. |
static int |
NEW
The new modifier constant. |
static int |
PRIVATE
The private access modifier constant. |
static int |
PROTECTED
The protected access modifier constant. |
static int |
PROTECTED_INTERNAL
The protected internal access modifier constant. |
static int |
PUBLIC
The public access modifier constant. |
Constructor Summary | |
CSharpEnumeration(int modifiers,
java.lang.String name)
Creates a new enumeration code generator with the specified modifiers. |
|
CSharpEnumeration(java.lang.String name)
Creates a new enumeration code generator with public access. |
Method Summary | |
void |
addComment(CSharpComment comment)
Sets the type comment. |
void |
addConstant(java.lang.String name)
Adds a constant to the enumeration. |
void |
addConstant(java.lang.String name,
java.lang.String value)
Adds a constant to the enumeration. |
void |
addConstant(java.lang.String name,
java.lang.String value,
CSharpComment comment)
Adds a constant to the enumeration. |
int |
category()
Returns a numeric category number for the code element. |
void |
print(java.io.PrintWriter out,
CodeStyle style,
int indent)
Prints the code element to the specified output stream. |
protected void |
print(java.io.PrintWriter out,
CodeStyle style,
int indent,
java.lang.String type)
Prints the type to the specified stream. |
protected void |
printSeparator(java.io.PrintWriter out,
CodeStyle style,
CodeElement prev,
CodeElement next)
Prints the lines separating two elements. |
java.lang.String |
toString()
Returns the type name. |
Methods inherited from class net.percederberg.grammatica.code.CodeElementContainer |
addElement, printContents |
Methods inherited from class net.percederberg.grammatica.code.CodeElement |
compareTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int PUBLIC
public static final int PROTECTED_INTERNAL
public static final int PROTECTED
public static final int INTERNAL
public static final int PRIVATE
public static final int NEW
Constructor Detail |
public CSharpEnumeration(java.lang.String name)
name
- the enumeration namepublic CSharpEnumeration(int modifiers, java.lang.String name)
modifiers
- the modifier flag constantsname
- the enumeration nameMethod Detail |
public int category()
category
in class CodeElement
public void addConstant(java.lang.String name)
name
- the constant namepublic void addConstant(java.lang.String name, java.lang.String value)
name
- the constant namevalue
- the constant valuepublic void addConstant(java.lang.String name, java.lang.String value, CSharpComment comment)
name
- the constant namevalue
- the constant value, or nullcomment
- the constant commentpublic void print(java.io.PrintWriter out, CodeStyle style, int indent)
print
in class CodeElement
out
- the output streamstyle
- the code style to useindent
- the indentation levelprotected void printSeparator(java.io.PrintWriter out, CodeStyle style, CodeElement prev, CodeElement next)
printSeparator
in class net.percederberg.grammatica.code.csharp.CSharpType
out
- the output streamstyle
- the code style to useprev
- the previous element, or null if firstnext
- the next element, or null if lastpublic java.lang.String toString()
toString
in class java.lang.Object
public void addComment(CSharpComment comment)
comment
- the new type commentprotected void print(java.io.PrintWriter out, CodeStyle style, int indent, java.lang.String type)
out
- the output streamstyle
- the code style to useindent
- the indentation leveltype
- the type name
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |