org.fuin.srcgen4javassist
Class SgConstructor

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

public final class SgConstructor
extends SgBehavior

A constructor.


Constructor Summary
SgConstructor(SgClass owner)
          Constructor with class.
SgConstructor(SgClass owner, String modifiers)
          Constructor with class and modifiers.
 
Method Summary
 void addBodyLine(String line)
          Add a new line to the body.
 List<String> getBody()
          Returns the body of the constructor.
 String getSignature()
          Returns the "signature" of the constructor.
 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

SgConstructor

public SgConstructor(SgClass owner)
Constructor with class. Modifier defaults to "public". The constructor will automatically be added to the owner.

Parameters:
owner - Class the behavior belongs to - Cannot be null.

SgConstructor

public SgConstructor(SgClass owner,
                     String modifiers)
Constructor with class and modifiers. The constructor 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).
Method Detail

getBody

public final List<String> getBody()
Returns the body of the constructor.

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

addBodyLine

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

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

getSignature

public final String getSignature()
Returns the "signature" of the constructor.

Returns:
Modifiers and arguments.

toString

public final String toString()

Overrides:
toString in class Object


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