Enhydra 5.1 API

org.enhydra.xml.xmlc.codegen
Class JavaMethod

java.lang.Object
  |
  +--org.enhydra.xml.xmlc.codegen.JavaMethod

public final class JavaMethod
extends java.lang.Object

Object that is used to assemble the Java source for a method.


Field Summary
protected  int fModifiers
          Modifiers of the method
 
Constructor Summary
JavaMethod(java.lang.String name, java.lang.String returnType, int modifiers, JavaParameter[] parameters, java.lang.String[] doc)
          Constructor.
 
Method Summary
 JavaCode getCode()
          Get the code object associate with the method body.
 int getModifiers()
          Get the modifiers.
 java.lang.String getName()
          Get the name.
 java.lang.String getReturnType()
          Get the return type.
 void print(IndentWriter out, boolean printBody)
          Print the method.
 void printMethodSignature(IndentWriter out, boolean beginBody)
          Print the method signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fModifiers

protected int fModifiers
Modifiers of the method

Constructor Detail

JavaMethod

public JavaMethod(java.lang.String name,
                  java.lang.String returnType,
                  int modifiers,
                  JavaParameter[] parameters,
                  java.lang.String[] doc)
Constructor.

Parameters:
returnType - The type the method returns. Specify null for a constructor.
name - The name of the method. If name is null, then this creates a static initializer.
parameters - A array describing the parameters; null or empty if no parameters.
modifiers - The method modifier bit set.
doc - The documentation to include. The parameter documentation will be appended to this, so should not be repeated. Each row of the array is a line of documentation.
Method Detail

getCode

public JavaCode getCode()
Get the code object associate with the method body.


getName

public java.lang.String getName()
Get the name.


getReturnType

public java.lang.String getReturnType()
Get the return type.


getModifiers

public int getModifiers()
Get the modifiers.


printMethodSignature

public void printMethodSignature(IndentWriter out,
                                 boolean beginBody)
Print the method signature. This is public, since it used in generating method listings as well as code.

Parameters:
out - Write to this stream.
beginBody - If true, start a method body, otherwise end with a semicolon.

print

public void print(IndentWriter out,
                  boolean printBody)
Print the method.


Enhydra 5.1 API