de.ispsoft.jaxme.generator.javasource
Class JavaMethod

java.lang.Object
  extended byde.ispsoft.jaxme.generator.javasource.JavaSourceObject
      extended byde.ispsoft.jaxme.generator.javasource.JavaMethod
Direct Known Subclasses:
JavaClassInitializer, JavaConstructor

public class JavaMethod
extends JavaSourceObject

Implements a Java method.

Author:
Jochen Wiedmann

Constructor Summary
JavaMethod(java.lang.String name, java.lang.String type)
          Creates a new JavaMethod with default protection.
JavaMethod(java.lang.String name, java.lang.String type, java.lang.String protection)
          Creates a new JavaMethod with the given protection.
 
Method Summary
 void addException(java.lang.String e)
          Adds an exception to this methods list of exceptions.
 void addLine(java.lang.String l)
          Adds a line to this methods body.
 void addParam(java.lang.String p)
          Adds a parameter that this method takes.
 void addParam(java.lang.String p, java.lang.String v)
          Adds a parameter that this method takes.
 java.util.ArrayList getExceptions()
          Returns the list of exceptions thrown by this method.
protected  java.lang.String getHeader()
          Adds a header line.
 java.util.ArrayList getLines()
          Returns the list of lines that this methods body holds.
 java.util.ArrayList getParams()
          Returns the list of parameters that this method takes.
 java.lang.String toString(int indent, boolean isInterface)
          Returns a string representation for this method.
 
Methods inherited from class de.ispsoft.jaxme.generator.javasource.JavaSourceObject
getComment, getFinal, getName, getProtection, getStatic, getType, isAbstract, setAbstract, setComment, setFinal, setName, setProtection, setStatic, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMethod

public JavaMethod(java.lang.String name,
                  java.lang.String type)
Creates a new JavaMethod with default protection.


JavaMethod

public JavaMethod(java.lang.String name,
                  java.lang.String type,
                  java.lang.String protection)

Creates a new JavaMethod with the given protection.

Method Detail

getExceptions

public java.util.ArrayList getExceptions()

Returns the list of exceptions thrown by this method.

See Also:
addException(java.lang.String)

addException

public void addException(java.lang.String e)

Adds an exception to this methods list of exceptions.

See Also:
getExceptions()

getLines

public java.util.ArrayList getLines()

Returns the list of lines that this methods body holds.

See Also:
addLine(java.lang.String)

addLine

public void addLine(java.lang.String l)

Adds a line to this methods body.

See Also:
getLines()

getParams

public java.util.ArrayList getParams()

Returns the list of parameters that this method takes.

See Also:
addParam(java.lang.String)

addParam

public void addParam(java.lang.String p)

Adds a parameter that this method takes.

See Also:
getParams()

addParam

public void addParam(java.lang.String p,
                     java.lang.String v)

Adds a parameter that this method takes.

See Also:
getParams()

toString

public java.lang.String toString(int indent,
                                 boolean isInterface)

Returns a string representation for this method.


getHeader

protected java.lang.String getHeader()

Adds a header line.