Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

javax.ide.model.java.source.tree
Interface MethodT

All Superinterfaces:
HasModifiersT, HasNameT, MemberT, Tree

public interface MethodT
extends MemberT, HasNameT

A method or constructor declaration.


Field Summary
static MethodT[] EMPTY_ARRAY
           
 
Method Summary
 java.util.List getExceptions()
          Gets the ordered list of exception types.
 FormalParameterListT getFormalParameterList()
          Gets the formal parameter list object.
 java.util.List getParameters()
          Gets the ordered list of parameters.
 TypeReferenceT getReturnType()
          Gets the source return type.
 ThrowsT getThrowsClause()
          Gets the throws clause object.
 java.util.List getTypeParameters()
          Gets the ordered list of type parameters declared on this class.
 boolean isConstructor()
          True if this is a constructor.
 boolean isVarargs()
          Tests if this method is modified by ACC_VARARGS.
 void setReturnType(TypeReferenceT type)
          Attempts to set the return type of this method.
 
Methods inherited from interface javax.ide.model.java.source.tree.MemberT
getBlock, getDeclaringClass, getDocComment, setBlock, setDocComment
 
Methods inherited from interface javax.ide.model.java.source.tree.HasModifiersT
addModifiers, getAnnotations, getModifiers, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic, isStrictfp, removeModifiers, setModifiers
 
Methods inherited from interface javax.ide.model.java.source.tree.Tree
accept, addSelf, addSelf, addSelfAfter, addSelfBefore, clearProperty, cloneSelf, getChildren, getOwningFile, getParent, getPosition, getProperty, getSiblingAfter, getSiblingBefore, getSiblings, getTreeKind, isSynthetic, removeSelf, replaceSelf, setProperty
 
Methods inherited from interface javax.ide.model.java.source.tree.HasNameT
getName, getNameElement, setName, setNameElement
 

Field Detail

EMPTY_ARRAY

static final MethodT[] EMPTY_ARRAY
Method Detail

isConstructor

boolean isConstructor()
True if this is a constructor. Equivalent to asking getTreeKind() == TREE_CONSTRUCTOR_D.

Returns:
True if this is a constructor. False otherwise.

isVarargs

boolean isVarargs()
Tests if this method is modified by ACC_VARARGS.

Returns:
True if this is a variable arguments method. False otherwise.

getTypeParameters

java.util.List getTypeParameters()
Gets the ordered list of type parameters declared on this class. Remember, type parameters are not inherited by subclasses (and subinterfaces).

For classes, syntax is "javadoc mods class name {}".

Returns:
The list of type parameters.

List of TypeParameterTs.


getReturnType

TypeReferenceT getReturnType()
Gets the source return type.

Returns:
The TypeReferenceT for the return type of this method. Null if this is a constructor.

setReturnType

void setReturnType(TypeReferenceT type)
Attempts to set the return type of this method.

Throws:
java.lang.UnsupportedOperationException - if this is a constructor.

getParameters

java.util.List getParameters()
Gets the ordered list of parameters.

Returns:
The list of formal parameters. Does not include the synthetic "this$0" parameter where applicable.

List of FormalParameterTs.


getExceptions

java.util.List getExceptions()
Gets the ordered list of exception types.

Returns:
The list of declared thrown exception types. Always non-null. Will have an element for each exception type that is declared, even if it is a RuntimeException subclass or if it cannot be legally resolved.

List of TypeReferenceTs.


getFormalParameterList

FormalParameterListT getFormalParameterList()
Gets the formal parameter list object.

Returns:
The formal parameter list belonging not this method (or constructor) declaration. Always non-null. If there is no formal parameter list, then a synthetic one is returned. Note: It is a compile error if there is no formal parameter list.

getThrowsClause

ThrowsT getThrowsClause()
Gets the throws clause object.

Returns:
The throws clause belonging to this method (or constructor) declaration. Always non-null. If there is no throws clause, then a synthetic one is returned.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.