public class Method extends JavaElement
| 构造器和说明 |
|---|
Method()
Instantiates a new method.
|
Method(Method original)
Copy constructor.
|
Method(java.lang.String name)
Instantiates a new method.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBodyLine(int index,
java.lang.String line)
Adds the body line.
|
void |
addBodyLine(java.lang.String line)
Adds the body line.
|
void |
addBodyLines(java.util.Collection<java.lang.String> lines)
Adds the body lines.
|
void |
addBodyLines(int index,
java.util.Collection<java.lang.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.
|
java.util.List<java.lang.String> |
getBodyLines()
Gets the body lines.
|
java.util.List<FullyQualifiedJavaType> |
getExceptions()
Gets the exceptions.
|
java.lang.String |
getFormattedContent(int indentLevel,
boolean interfaceMethod,
CompilationUnit compilationUnit)
Gets the formatted content.
|
java.lang.String |
getName()
Gets the name.
|
java.util.List<Parameter> |
getParameters()
Gets the parameters.
|
FullyQualifiedJavaType |
getReturnType()
Gets the return type.
|
java.util.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(java.lang.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, setVisibilitypublic Method()
public Method(java.lang.String name)
name - the namepublic Method(Method original)
original - the originalpublic java.util.List<java.lang.String> getBodyLines()
public void addBodyLine(java.lang.String line)
line - the linepublic void addBodyLine(int index,
java.lang.String line)
index - the indexline - the linepublic void addBodyLines(java.util.Collection<java.lang.String> lines)
lines - the linespublic void addBodyLines(int index,
java.util.Collection<java.lang.String> lines)
index - the indexlines - the linespublic java.lang.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 java.lang.String getName()
public void setName(java.lang.String name)
name - The name to set.public java.util.List<TypeParameter> getTypeParameters()
public void addTypeParameter(TypeParameter typeParameter)
typeParameter - the type parameterpublic void addTypeParameter(int index,
TypeParameter typeParameter)
index - the indextypeParameter - the type parameterpublic java.util.List<Parameter> getParameters()
public 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 java.util.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 © 2018. All Rights Reserved.