public class CodeMethod extends CodeMember implements IdentifierScope
| Constructor and Description |
|---|
CodeMethod() |
CodeMethod(AccessModifierType access,
Class<?> returnType,
String methodName,
CodeParameterDeclarationExpression[] parameters,
CodeStatement... statements) |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(Class<?> type,
String name) |
void |
addParameter(CodeParameterDeclarationExpression parameter) |
void |
addThrows(Class<?> type) |
boolean |
equals(Object arg) |
List<CodeParameterDeclarationExpression> |
getParameters() |
Class<?> |
getReturnType() |
CodeStatementCollection |
getStatements() |
List<Class<?>> |
getThrows() |
int |
hashCode() |
boolean |
isLocalIdent(String ident)
Determines if the client ident is declared in local scope
|
boolean |
isOverride() |
String |
nextIdent(String prefix)
Gets a new unique ident with the given prefix
|
void |
setOverride(boolean value) |
void |
setReturnType(Class<?> value) |
String |
uniqueIdent(String ident)
Gets the corresponding unique server ident for the client ident
|
void |
visit(CodeVisitor visitor)
Walks this code object structure
|
CodeMethod |
withOverride() |
CodeMethod |
withThrows(Class<?>... types) |
getAccess, getName, setAccess, setName, withMetaDatagetMetaData, hasMetaData, putMetaData, removeMetaData, toStringpublic CodeMethod()
public CodeMethod(AccessModifierType access, Class<?> returnType, String methodName, CodeParameterDeclarationExpression[] parameters, CodeStatement... statements)
public Class<?> getReturnType()
public void setReturnType(Class<?> value)
public boolean isOverride()
public void setOverride(boolean value)
public CodeMethod withOverride()
public List<CodeParameterDeclarationExpression> getParameters()
public void addParameter(CodeParameterDeclarationExpression parameter)
public void addThrows(Class<?> type)
public CodeMethod withThrows(Class<?>... types)
public CodeStatementCollection getStatements()
public boolean isLocalIdent(String ident)
IdentifierScopeisLocalIdent in interface IdentifierScopepublic String uniqueIdent(String ident)
IdentifierScopeuniqueIdent in interface IdentifierScopepublic String nextIdent(String prefix)
IdentifierScopenextIdent in interface IdentifierScopepublic void visit(CodeVisitor visitor)
CodeObjectvisit in class CodeObjectpublic boolean equals(Object arg)
equals in class CodeMemberpublic int hashCode()
hashCode in class CodeMemberCopyright © 2014. All rights reserved.