|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.codegen.merge.java.facade.AbstractJNode
org.eclipse.emf.codegen.merge.java.facade.ast.ASTJNode
org.eclipse.emf.codegen.merge.java.facade.ast.ASTJMember
org.eclipse.emf.codegen.merge.java.facade.ast.ASTJMethod
Field Summary |
Fields inherited from class org.eclipse.emf.codegen.merge.java.facade.AbstractJNode |
EMPTY_STRING_ARRAY, facadeHelper, qualifiedName, wrappedObject |
Constructor Summary | |
ASTJMethod(org.eclipse.jdt.core.dom.MethodDeclaration methodDeclaration)
|
Method Summary | |
void |
addException(String exceptionType)
Adds the given exception to the end of the list of exceptions this method is declared to throw. |
protected String |
computeQualifiedName()
|
protected org.eclipse.jdt.core.dom.MethodDeclaration |
getASTMethodDeclaration()
|
String |
getBody()
Returns the body of this method. |
String[] |
getExceptions()
Returns the type signatures of the exceptions this method throws, in the order declared in the source. |
String |
getName()
Returns the name of this node. |
String[] |
getParameterNames()
Returns the names of parameters in this method in the order they are declared, or null if no parameters are declared.
|
String[] |
getParameterTypes()
Returns the type names for the parameters of this method in the order they are declared, or null if no parameters are declared.
|
String |
getReturnType()
Returns the return type name, or null .
|
String[] |
getTypeParameters()
Returns the formal type parameters for this method. |
boolean |
isConstructor()
Returns whether this method is a constructor. |
void |
setBody(String body)
Sets the body of this method. |
void |
setExceptions(String[] exceptionTypes)
Sets the names of the exception types this method throws, in the order in which they are declared in the source. |
void |
setParameters(String[] types,
String[] names)
Sets the types and names of parameters in this method in the order they are to be declared. |
void |
setReturnType(String type)
Sets the return type name. |
Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.ast.ASTJMember |
getASTBodyDeclaration, getComment, getFlags, setComment |
Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.ast.ASTJNode |
getASTNode, getChildren, getContents, getContents, getParent, setFlags, toString |
Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.AbstractJNode |
computeQualifiedName, computeQualifiedName, computeQualifiedName, dispose, getFacadeHelper, getName, getQualifiedName, getWrappedObject, setFacadeHelper |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.codegen.merge.java.facade.JMember |
getComment, setComment |
Methods inherited from interface org.eclipse.emf.codegen.merge.java.facade.JNode |
getChildren, getContents, getFlags, getParent, getQualifiedName, setFlags |
Constructor Detail |
public ASTJMethod(org.eclipse.jdt.core.dom.MethodDeclaration methodDeclaration)
Method Detail |
protected org.eclipse.jdt.core.dom.MethodDeclaration getASTMethodDeclaration()
public boolean isConstructor()
JMethod
isConstructor
in interface JMethod
true
for constructors, and false
for methodspublic String getName()
JNode
getName
in interface JNode
null
if it has no namepublic String getReturnType()
JMethod
null
.
Returns null
for constructors.
The syntax for return type name corresponds to ReturnType in
MethodDeclaration (JLS2 8.4). Names are returned as they appear in the source
code; for example: "File"
, "java.io.File"
,
"int[]"
, or "void"
.
getReturnType
in interface JMethod
public void setReturnType(String type)
JMethod
"File"
, "java.io.File"
,
"int[]"
, or "void"
.
setReturnType
in interface JMethod
type
- the return typepublic String[] getTypeParameters()
JMethod
Formal type parameters are as they appear in the source
code; for example:
"X extends List<String> & Serializable"
.
getTypeParameters
in interface JMethod
public String[] getParameterNames()
JMethod
null
if no parameters are declared.
The syntax for parameter names is defined by Formal Parameters (JLS2 8.4.1).
getParameterNames
in interface JMethod
public String[] getParameterTypes()
JMethod
null
if no parameters are declared.
The syntax for type names is defined by Formal Parameters (JLS2 8.4.1).
Type names must be specified as they would appear in source code. For
example: "File"
, "java.io.File"
, or
"int[]"
.
getParameterTypes
in interface JMethod
public void setParameters(String[] types, String[] names) throws IllegalArgumentException
JMethod
types
and names
are null
this indicates that this method has no parameters.
The syntax for parameter names is defined by Formal Parameters (JLS2 8.4.1).
The syntax for type names is defined by Formal Parameters (JLS2 8.4.1).
Type names must be specified as they would appear in source code. For
example: "File"
, "java.io.File"
, or
"int[]"
.
setParameters
in interface JMethod
types
- the list of type namesnames
- the list of parameter name
IllegalArgumentException
public String[] getExceptions()
JMethod
For example, a source method declaring "throws IOException"
,
would return the array {"QIOException;"}
.
The type signatures may be either unresolved (for source types) or resolved (for binary types), and either basic (for basic types) or rich (for parameterized types).
getExceptions
in interface JMethod
public void setExceptions(String[] exceptionTypes)
JMethod
"IOException"
or "java.io.IOException"
.
setExceptions
in interface JMethod
exceptionTypes
- the list of exception typespublic void addException(String exceptionType)
JMethod
"IOException"
or "java.io.IOException"
.
This is a convenience method for setExceptions
.
addException
in interface JMethod
exceptionType
- the exception typeJMethod.setExceptions(String[])
public String getBody()
JMethod
getBody
in interface JMethod
null
if the method has no body (for
example, for an abstract or native method)public void setBody(String body)
JMethod
setBody
in interface JMethod
body
- the body, or null
indicating the method has no body (for
example, for an abstract or native method)protected String computeQualifiedName()
computeQualifiedName
in class AbstractJNode
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |