|
||||||||||
| 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.jdom.JDOMJNode
org.eclipse.emf.codegen.merge.java.facade.jdom.JDOMJMember
org.eclipse.emf.codegen.merge.java.facade.jdom.JDOMJMethod
public class JDOMJMethod
| Field Summary |
|---|
| Fields inherited from class org.eclipse.emf.codegen.merge.java.facade.AbstractJNode |
|---|
EMPTY_STRING_ARRAY, qualifiedName |
| Constructor Summary | |
|---|---|
JDOMJMethod(org.eclipse.jdt.core.jdom.IDOMMethod method)
|
|
| Method Summary | |
|---|---|
void |
addException(java.lang.String exceptionType)
Adds the given exception to the end of the list of exceptions this method is declared to throw. |
protected java.lang.String |
computeQualifiedName()
|
java.lang.String |
getBody()
Returns the body of this method. |
java.lang.String[] |
getExceptions()
Returns the type signatures of the exceptions this method throws, in the order declared in the source. |
java.lang.String[] |
getParameterNames()
Returns the names of parameters in this method in the order they are declared, or an empty array if no parameters are declared. |
java.lang.String[] |
getParameters()
Returns the parameters of this method in the order they are declared, or empty array if no parameters are declared. |
java.lang.String[] |
getParameterTypes()
Returns the erased type names for the parameters of this method in the order they are declared, or an empty array if no parameters are declared. |
java.lang.String |
getReturnType()
Returns the return type name, or null. |
java.lang.String[] |
getTypeParameters()
Returns the formal type parameters for this method. |
protected org.eclipse.jdt.core.jdom.IDOMMethod |
getWrappedObject()
|
boolean |
isConstructor()
Returns whether this method is a constructor. |
void |
setBody(java.lang.String body)
Sets the body of this method. |
void |
setExceptions(java.lang.String[] exceptionTypes)
Sets the names of the exception types this method throws, in the order in which they are declared in the source. |
void |
setParameterNames(java.lang.String[] names)
Sets the names of parameters in this method in the order they are to be declared. |
void |
setParameters(java.lang.String[] parameters)
Sets the parameters in this method in the order they are to be declared. |
void |
setReturnType(java.lang.String type)
Sets the return type name. |
void |
setTypeParameters(java.lang.String[] typeParameters)
Sets the formal type parameters for this method. |
| Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.jdom.JDOMJMember |
|---|
getComment, getContents, getFlags, setComment, setFlags, splitLastComment |
| Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.jdom.JDOMJNode |
|---|
dispose, getChildren, getFacadeHelper, getName, getParent, isDisposed, setFacadeHelper, setName |
| Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.AbstractJNode |
|---|
computeQualifiedName, computeQualifiedName, computeQualifiedName, getName, getQualifiedName |
| 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, getName, getParent, getQualifiedName, setFlags, setName |
| Constructor Detail |
|---|
public JDOMJMethod(org.eclipse.jdt.core.jdom.IDOMMethod method)
method - | Method Detail |
|---|
protected org.eclipse.jdt.core.jdom.IDOMMethod getWrappedObject()
getWrappedObject in class JDOMJMemberpublic boolean isConstructor()
JMethod
isConstructor in interface JMethodtrue for constructors, and false for methodspublic java.lang.String getBody()
JMethod
getBody in interface JMethodnull if the method has no body (for
example, for an abstract or native method)public void setBody(java.lang.String body)
JMethod
setBody in interface JMethodbody - the body, or null indicating the method has no body (for
example, for an abstract or native method)public java.lang.String getReturnType()
JMethodnull.
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 JMethodpublic void setReturnType(java.lang.String type)
JMethod"File", "java.io.File",
"int[]", or "void".
setReturnType in interface JMethodtype - the return typepublic java.lang.String[] getParameterNames()
JMethod
getParameterNames in interface JMethodpublic java.lang.String[] getParameterTypes()
JMethod"File", "java.io.File", or
"int[]".
getParameterTypes in interface JMethodpublic java.lang.String[] getTypeParameters()
JMethodFormal type parameters are as they appear in the source
code; for example:
"X extends List<String> & Serializable".
getTypeParameters in interface JMethod
public void setParameterNames(java.lang.String[] names)
throws java.lang.IllegalArgumentException
JMethod
setParameterNames in interface JMethodnames - the list of parameter names
java.lang.IllegalArgumentExceptionpublic java.lang.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 JMethodpublic void setExceptions(java.lang.String[] exceptionTypes)
JMethod"IOException" or "java.io.IOException".
setExceptions in interface JMethodexceptionTypes - the list of exception typespublic void addException(java.lang.String exceptionType)
JMethod"IOException" or "java.io.IOException".
This is a convenience method for setExceptions.
addException in interface JMethodexceptionType - the exception typeJMethod.setExceptions(String[])protected java.lang.String computeQualifiedName()
computeQualifiedName in class AbstractJNodepublic void setTypeParameters(java.lang.String[] typeParameters)
JMethod
setTypeParameters in interface JMethodtypeParameters - in the order declared in the source, or an empty array if no type parameters
are declaredpublic java.lang.String[] getParameters()
JMethod"File file", "java.io.File file", or
"int[][] n[]", or final @Annotation int[]... n.
getParameters in interface JMethodpublic void setParameters(java.lang.String[] parameters)
JMethod"File file", "java.io.File file", or
"int[][] n[]", or final @Annotation int[]... n.
setParameters in interface JMethodparameters - the list of parameters, or or an empty array if no parameters
are declared
|
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 | |||||||||