Extension SDK

oracle.jdeveloper.jot
Interface JotMethod

All Superinterfaces:
JotElement, JotHasCodeBlock, JotHasModifiers, JotMember, JotNameable
All Known Subinterfaces:
JotConstructor

public interface JotMethod
extends JotMember, JotHasCodeBlock, JotNameable

The read-only JOT representation of Java method declarations. JotMethod instances represent class methods and interface abstract methods in JotClass instances.

A JotMethod instance provides only a read-only view of a method.

See Also:
"The Java Language Specification, sections 8.4 and 9.4"

Field Summary
static java.lang.String VOID_TYPE_NAME
          The void return type.
 
Method Summary
 void addExceptionType(int idx, java.lang.String typeName)
          Adds a new Exception type to this method at a specific location within the throws clause.
 void addExceptionType(java.lang.String typeName)
          Adds a new Exception type to this method.
 JotParameter addParameter(int idx, java.lang.String pType, java.lang.String pName)
          Adds a new parameter to this method.
 JotParameter addParameter(java.lang.String pType, java.lang.String pName)
          Adds a new parameter to this method.
 JotType[] getExceptionTypes()
          Retrieves the exception types declared in this method's throws-clause.
 JotParameter getFirstParameter()
          Retrieves this method's first parameter.
 JotParameter getParameter(java.lang.String name)
          Deprecated.  
 JotParameter[] getParameters()
          Retrieves this method's parameters.
 JotType[] getParameterTypes()
          Retrieves the types of this method's parameters.
 JotType getReturnType()
          Retrieves the type returned by this method.
 void removeExceptionType(java.lang.String typeName)
          Removes an exception type from the throws clause of this method.
 void removeParameter(JotParameter param)
          Removes an existing parameter from this method.
 void setReturnType(java.lang.String typeName)
          Sets the return type of this method.
 
Methods inherited from interface oracle.jdeveloper.jot.JotMember
getDeclaringClass, isDeprecated, isSource
 
Methods inherited from interface oracle.jdeveloper.jot.JotHasModifiers
getModifiers, setModifiers
 
Methods inherited from interface oracle.jdeveloper.jot.JotElement
getElementName, getElementType, getEndOffset, getID, getJotWorkArea, getParent, getStartOffset, isExistent, isReadOnly, isStructureKnown, setParent
 
Methods inherited from interface oracle.jdeveloper.jot.JotHasCodeBlock
getCodeBlock, setCodeBlockText
 
Methods inherited from interface oracle.jdeveloper.jot.JotNameable
getName, setName
 

Field Detail

VOID_TYPE_NAME

public static final java.lang.String VOID_TYPE_NAME
The void return type.

See Also:
Constant Field Values
Method Detail

getReturnType

public JotType getReturnType()
Retrieves the type returned by this method.

Returns:
the JOT representation of a type.

setReturnType

public void setReturnType(java.lang.String typeName)
                   throws JotException
Sets the return type of this method.

Parameters:
typeName - the new type name.
Throws:
JotException

getParameterTypes

public JotType[] getParameterTypes()
Retrieves the types of this method's parameters.

Returns:
an array of parameter types.

getParameters

public JotParameter[] getParameters()
Retrieves this method's parameters. A parameter is composed of a name and a type.

Returns:
an array of method parameters.

getFirstParameter

public JotParameter getFirstParameter()
Retrieves this method's first parameter. A parameter is composed of a name and a type.

Returns:
a method parameter, or null if this method takes no arguments.

getParameter

public JotParameter getParameter(java.lang.String name)
Deprecated.  

Retrieves the named parameter. A parameter is composed of a name and a type.

Parameters:
name - a parameter name.
Returns:
a method parameter, or null if name is not found.

addParameter

public JotParameter addParameter(java.lang.String pType,
                                 java.lang.String pName)
                          throws JotException
Adds a new parameter to this method.

Parameters:
pType - the type of the new parameter
pName - the name of the new parameter
Returns:
a JotParameter representing the new parameter.
Throws:
JotException

addParameter

public JotParameter addParameter(int idx,
                                 java.lang.String pType,
                                 java.lang.String pName)
                          throws JotException
Adds a new parameter to this method.

Parameters:
idx - the location to insert the new parameter.
pType - the type of the new parameter
pName - the name of the new parameter
Returns:
a JotParameter representing the new parameter.
Throws:
JotException

removeParameter

public void removeParameter(JotParameter param)
                     throws JotException
Removes an existing parameter from this method.

Parameters:
param - the parameter to remove. If the parameter does not currently exist in this method, nothing is done.
Throws:
JotException

getExceptionTypes

public JotType[] getExceptionTypes()
Retrieves the exception types declared in this method's throws-clause.

Returns:
an array of types.

addExceptionType

public void addExceptionType(java.lang.String typeName)
                      throws JotException
Adds a new Exception type to this method.

Parameters:
typeName - the name of the exception type. The type name does not need to be fully qualified; however, the name should be resolveable in the current file context. For example, Exception or java.io.IOException>/code>.
Throws:
JotException

addExceptionType

public void addExceptionType(int idx,
                             java.lang.String typeName)
                      throws JotException
Adds a new Exception type to this method at a specific location within the throws clause.

Parameters:
idx - the location to insert the new exception type.
typeName - the name of the exception type. The type name does not need to be fully qualified; however, the name should be resolveable in the current file context. For example, Exception or java.io.IOException>/code>.
Throws:
JotException

removeExceptionType

public void removeExceptionType(java.lang.String typeName)
                         throws JotException
Removes an exception type from the throws clause of this method. If the type is not currently declared as being thrown, nothing happens.

Parameters:
typeName - the name of the exception type to remove.
Throws:
JotException

Extension SDK

 

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