org.fuin.srcgen4javassist
Class SgMethod

java.lang.Object
  extended by org.fuin.srcgen4javassist.SgBehavior
      extended by org.fuin.srcgen4javassist.SgMethod

public final class SgMethod
extends SgBehavior

A method.


Constructor Summary
SgMethod(SgClass owner, java.lang.String modifiers, SgClass returnType, java.lang.String name)
          Constructor.
 
Method Summary
 void addBodyLine(java.lang.String line)
          Add a new line to the body.
 java.util.List<java.lang.String> getBody()
          Returns the body of the method.
 java.lang.String getName()
          Returns the name of the method.
 java.lang.String getNameAsPackage()
          Returns the name of the method with an "underscore" inserted before all upper case characters and all characters converted to lower case.
 SgClass getReturnType()
          Return the return type of the method.
 java.lang.String getSignature()
          Returns the "signature" of the method.
 java.lang.String toString()
          
 
Methods inherited from class org.fuin.srcgen4javassist.SgBehavior
addAnnotation, addAnnotations, addArgument, addException, getAnnotations, getArguments, getArguments, getCommaSeparatedArgumentNames, getCommaSeparatedArgumentNames, getExceptions, getLastArgument, getModifiers, getOwner, hasAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SgMethod

public SgMethod(SgClass owner,
                java.lang.String modifiers,
                SgClass returnType,
                java.lang.String name)
Constructor. The method will automatically be added to the owner.

Parameters:
owner - Class the behavior belongs to - Cannot be null.
modifiers - Modifiers for the constructor/method - Cannot be null (but empty).
returnType - Return type of the method - Cannot be null (Use VOID in model class for no return value).
name - Name of the method.
Method Detail

getReturnType

public final SgClass getReturnType()
Return the return type of the method.

Returns:
Type - Always non-null.

getBody

public final java.util.List<java.lang.String> getBody()
Returns the body of the method.

Returns:
Body - Always non-null, maybe empty and is unmodifiable.

addBodyLine

public final void addBodyLine(java.lang.String line)
Add a new line to the body.

Parameters:
line - Line to add - Cannot be null (but empty).

getName

public final java.lang.String getName()
Returns the name of the method.

Returns:
Name - Always non-null.

getNameAsPackage

public final java.lang.String getNameAsPackage()
Returns the name of the method with an "underscore" inserted before all upper case characters and all characters converted to lower case.

Returns:
Name usable as a package - Always non-null.

getSignature

public final java.lang.String getSignature()
Returns the "signature" of the method.

Returns:
Modifiers, return type, name and arguments - Always non-null.

toString

public final java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.