org.jibx.schema.codegen
Class MethodBuilder

java.lang.Object
  extended by org.jibx.schema.codegen.ASTBuilderBase
      extended by org.jibx.schema.codegen.BodyBuilderBase
          extended by org.jibx.schema.codegen.MethodBuilder

public class MethodBuilder
extends BodyBuilderBase

Abstract syntax tree method declaration builder. This adds convenience methods and control information to the base builder.


Field Summary
private  MethodDeclaration m_method
          Method invocation.
 
Fields inherited from class org.jibx.schema.codegen.BodyBuilderBase
m_declaration, m_source
 
Fields inherited from class org.jibx.schema.codegen.ASTBuilderBase
m_ast
 
Constructor Summary
MethodBuilder(ClassBuilder source, MethodDeclaration method)
          Constructor.
 
Method Summary
 SingleVariableDeclaration addParameter(java.lang.String name, java.lang.String type)
          Add a method parameter.
 SingleVariableDeclaration addParameter(java.lang.String name, Type type)
          Add a method parameter.
 void addThrows(java.lang.String type)
          Add an exception type to those thrown by the method.
 BlockBuilder createBlock()
          Create a block builder for the method body.
 MethodDeclaration getDeclaration()
          Get the method declaration.
 
Methods inherited from class org.jibx.schema.codegen.BodyBuilderBase
addSourceComment, addSourceComment, setFinal, setPrivate, setPrivateFinal, setPrivateStaticFinal, setPublic, setPublicStatic, setPublicStaticFinal, setStatic
 
Methods inherited from class org.jibx.schema.codegen.ASTBuilderBase
numberLiteral, setFinal, setPrivate, setPrivateFinal, setPrivateStaticFinal, setPublic, setPublicStatic, setPublicStaticFinal, setStatic, stringLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_method

private final MethodDeclaration m_method
Method invocation.

Constructor Detail

MethodBuilder

public MethodBuilder(ClassBuilder source,
                     MethodDeclaration method)
Constructor.

Parameters:
source -
method -
Method Detail

getDeclaration

public MethodDeclaration getDeclaration()
Get the method declaration.

Returns:
declaration

addParameter

public SingleVariableDeclaration addParameter(java.lang.String name,
                                              Type type)
Add a method parameter.

Parameters:
name -
type -
Returns:
declaration

addParameter

public SingleVariableDeclaration addParameter(java.lang.String name,
                                              java.lang.String type)
Add a method parameter.

Parameters:
name -
type - fully-qualfied type name, or primitive name, with optional array suffixes
Returns:
declaration

addThrows

public void addThrows(java.lang.String type)
Add an exception type to those thrown by the method.

Parameters:
type - exception type

createBlock

public BlockBuilder createBlock()
Create a block builder for the method body.

Returns:
builder


Project Web Site