|
|||||||||||
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.csharp.CSharpMethod
A class generating a C# method declaration.
Field Summary | |
static int |
ABSTRACT
The abstract modifier constant. |
static int |
EXTERN
The extern modifier constant. |
static int |
INTERNAL
The internal access modifier constant. |
static int |
NEW
The new modifier constant. |
static int |
OVERRIDE
The override 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. |
static int |
SEALED
The sealed modifier constant. |
static int |
STATIC
The static modifier constant. |
static int |
VIRTUAL
The virtual modifier constant. |
Constructor Summary | |
CSharpMethod(int modifiers,
java.lang.String name,
java.lang.String args,
java.lang.String returnType)
Creates a new method with the specified arguments. |
|
CSharpMethod(java.lang.String name)
Creates a new method with the specified name. |
|
CSharpMethod(java.lang.String name,
java.lang.String args)
Creates a new method with the specified name and arguments. |
|
CSharpMethod(java.lang.String name,
java.lang.String args,
java.lang.String returnType)
Creates a new method with the specified arguments. |
Method Summary | |
void |
addCode(java.lang.String codeLines)
Adds one or more lines of actual code. |
void |
addComment(CSharpComment comment)
Sets a comment for this method. |
boolean |
canPrintCode()
Checks if the method source code can the printed. |
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. |
void |
setPrintCode(boolean value)
Sets the print code flag. |
Methods inherited from class net.percederberg.grammatica.code.CodeElement |
compareTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 STATIC
public static final int NEW
public static final int VIRTUAL
public static final int SEALED
public static final int OVERRIDE
public static final int ABSTRACT
public static final int EXTERN
Constructor Detail |
public CSharpMethod(java.lang.String name)
name
- the method namepublic CSharpMethod(java.lang.String name, java.lang.String args)
name
- the method nameargs
- the argument list, excluding parenthesispublic CSharpMethod(java.lang.String name, java.lang.String args, java.lang.String returnType)
name
- the method nameargs
- the argument list, excluding parenthesisreturnType
- the return typepublic CSharpMethod(int modifiers, java.lang.String name, java.lang.String args, java.lang.String returnType)
modifiers
- the modifier flags to usename
- the method nameargs
- the argument list, excluding parenthesisreturnType
- the return typeMethod Detail |
public void addCode(java.lang.String codeLines)
codeLines
- the lines of Java code to addpublic void addComment(CSharpComment comment)
comment
- the new method commentpublic int category()
category
in class CodeElement
public boolean canPrintCode()
public void setPrintCode(boolean value)
value
- the new print code flag valuepublic 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 level
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |