public class Method extends JavaElement
Constructor and Description |
---|
Method()
Instantiates a new method.
|
Method(Method original)
Copy constructor.
|
Method(String name)
Instantiates a new method.
|
Modifier and Type | Method and Description |
---|---|
void |
addBodyLine(int index,
String line)
Adds the body line.
|
void |
addBodyLine(String line)
Adds the body line.
|
void |
addBodyLines(Collection<String> lines)
Adds the body lines.
|
void |
addBodyLines(int index,
Collection<String> lines)
Adds the body lines.
|
void |
addException(FullyQualifiedJavaType exception)
Adds the exception.
|
void |
addParameter(int index,
Parameter parameter)
Adds the parameter.
|
void |
addParameter(Parameter parameter)
Adds the parameter.
|
void |
addTypeParameter(int index,
TypeParameter typeParameter)
Adds the parameter.
|
void |
addTypeParameter(TypeParameter typeParameter)
Adds the type parameter.
|
List<String> |
getBodyLines()
Gets the body lines.
|
List<FullyQualifiedJavaType> |
getExceptions()
Gets the exceptions.
|
String |
getFormattedContent(int indentLevel,
boolean interfaceMethod,
CompilationUnit compilationUnit)
Gets the formatted content.
|
String |
getName()
Gets the name.
|
List<Parameter> |
getParameters()
Gets the parameters.
|
FullyQualifiedJavaType |
getReturnType()
Gets the return type.
|
List<TypeParameter> |
getTypeParameters()
Gets the type parameters.
|
boolean |
isConstructor()
Checks if is constructor.
|
boolean |
isDefault() |
boolean |
isNative()
Checks if is native.
|
boolean |
isSynchronized()
Checks if is synchronized.
|
void |
setConstructor(boolean constructor)
Sets the constructor.
|
void |
setDefault(boolean isDefault) |
void |
setName(String name)
Sets the name.
|
void |
setNative(boolean isNative)
Sets the native.
|
void |
setReturnType(FullyQualifiedJavaType returnType)
Sets the return type.
|
void |
setSynchronized(boolean isSynchronized)
Sets the synchronized.
|
addAnnotation, addFormattedAnnotations, addFormattedJavadoc, addJavaDocLine, addSuppressTypeWarningsAnnotation, getAnnotations, getJavaDocLines, getVisibility, isFinal, isStatic, setFinal, setStatic, setVisibility
public Method()
public Method(String name)
name
- the namepublic Method(Method original)
original
- the originalpublic List<String> getBodyLines()
public void addBodyLine(String line)
line
- the linepublic void addBodyLine(int index, String line)
index
- the indexline
- the linepublic void addBodyLines(Collection<String> lines)
lines
- the linespublic void addBodyLines(int index, Collection<String> lines)
index
- the indexlines
- the linespublic String getFormattedContent(int indentLevel, boolean interfaceMethod, CompilationUnit compilationUnit)
indentLevel
- the indent levelinterfaceMethod
- the interface methodcompilationUnit
- the compilation unitpublic boolean isConstructor()
public void setConstructor(boolean constructor)
constructor
- The constructor to set.public String getName()
public void setName(String name)
name
- The name to set.public List<TypeParameter> getTypeParameters()
public void addTypeParameter(TypeParameter typeParameter)
typeParameter
- the type parameterpublic void addTypeParameter(int index, TypeParameter typeParameter)
index
- the indextypeParameter
- the type parameterpublic void addParameter(Parameter parameter)
parameter
- the parameterpublic void addParameter(int index, Parameter parameter)
index
- the indexparameter
- the parameterpublic FullyQualifiedJavaType getReturnType()
public void setReturnType(FullyQualifiedJavaType returnType)
returnType
- The returnType to set.public List<FullyQualifiedJavaType> getExceptions()
public void addException(FullyQualifiedJavaType exception)
exception
- the exceptionpublic boolean isSynchronized()
public void setSynchronized(boolean isSynchronized)
isSynchronized
- the new synchronizedpublic boolean isNative()
public void setNative(boolean isNative)
isNative
- the new nativepublic boolean isDefault()
public void setDefault(boolean isDefault)
Copyright © 2006–2018 MyBatis.org. All rights reserved.