Package org.jibx.schema.codegen
Class MethodBuilder
java.lang.Object
org.jibx.schema.codegen.ASTBuilderBase
org.jibx.schema.codegen.BodyBuilderBase
org.jibx.schema.codegen.MethodBuilder
Abstract syntax tree method declaration builder. This adds convenience methods and control information to the base
builder.
-
Field Summary
FieldsFields inherited from class org.jibx.schema.codegen.BodyBuilderBase
m_declaration, m_sourceFields inherited from class org.jibx.schema.codegen.ASTBuilderBase
m_ast -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSingleVariableDeclarationaddParameter(String name, String type) Add a method parameter.SingleVariableDeclarationaddParameter(String name, Type type) Add a method parameter.voidAdd an exception type to those thrown by the method.Create a block builder for the method body.MethodDeclarationGet the method declaration.Methods inherited from class org.jibx.schema.codegen.BodyBuilderBase
addSourceComment, addSourceComment, setFinal, setPrivate, setPrivateFinal, setPrivateStaticFinal, setPublic, setPublicStatic, setPublicStaticFinal, setStaticMethods inherited from class org.jibx.schema.codegen.ASTBuilderBase
numberLiteral, setFinal, setPrivate, setPrivateFinal, setPrivateStaticFinal, setPublic, setPublicStatic, setPublicStaticFinal, setStatic, stringLiteral
-
Field Details
-
m_method
private final MethodDeclaration m_methodMethod invocation.
-
-
Constructor Details
-
MethodBuilder
Constructor.- Parameters:
source-method-
-
-
Method Details
-
getDeclaration
public MethodDeclaration getDeclaration()Get the method declaration.- Returns:
- declaration
-
addParameter
Add a method parameter.- Parameters:
name-type-- Returns:
- declaration
-
addParameter
Add a method parameter.- Parameters:
name-type- fully-qualfied type name, or primitive name, with optional array suffixes- Returns:
- declaration
-
addThrows
Add an exception type to those thrown by the method.- Parameters:
type- exception type
-
createBlock
Create a block builder for the method body.- Returns:
- builder
-