com.borland.jbuilder.jot
Interface JotMethodSource

All Superinterfaces:
JotMarker, JotMethod
All Known Subinterfaces:
JotConstructorSource

public interface JotMethodSource
extends JotMethod, JotMarker

This interface provides additional methods for manipulating a method's source. For more information about methods see section 8.4 of the Java Language Specification.


Method Summary
 JotParameterDeclaration addParameter(JotMarker marker, boolean before, java.lang.String type, java.lang.String value)
          Creates a JotParameterDeclaration object with the specified name and type and adds it to this method's declaration.
 JotType addThrowSpecifier(JotMarker marker, boolean before, java.lang.String type)
          Creates a JotType object with the specified type and adds it to the throws clause of this method's declaration.
 JotCodeBlock getCodeBlock()
          Returns the body of this method, or null if this is an abstract method.
 int getDeclaredModifiers()
          Returns only the modifiers actually declared in the file.
 JotStatement[] getStatements()
          Returns an array of JotStatement objects which represent the statements contained in the body of this method.
 void removeParameter(JotParameter param)
          Removes the specified parameter from this method's declaration.
 void removeThrowSpecifier(JotType spec)
          Removes the specified exception from this method's declaration.
 void setModifiers(int modifiers)
          Sets the modifiers for the method.
 void setName(java.lang.String name)
          Sets the name of the method.
 void setParameterText(java.lang.String parameters)
          Sets the parameters of the method as a single string, e.g.
 void setReturnType(java.lang.String type)
          Sets the return type of the method.
 
Methods inherited from interface com.borland.jbuilder.jot.JotMethod
getDeclaringClass, getFirstParameter, getModifiers, getName, getParameter, getParameters, getParameterTypes, getReturnType, getThrowSpecifiers
 
Methods inherited from interface com.borland.jbuilder.jot.JotMarker
addUserData, getEndPosition, getStartPosition, getUserData
 

Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the method.

setReturnType

public void setReturnType(java.lang.String type)
Sets the return type of the method.

getDeclaredModifiers

public int getDeclaredModifiers()
Returns only the modifiers actually declared in the file. Use with the static methods of java.lang.reflect.Modifier to determine whether a specific modifer is set.
See Also:
Modifier

setModifiers

public void setModifiers(int modifiers)
Sets the modifiers for the method. Use the static variables of java.lang.reflect.Modifier to create the combination of modifiers desired.
See Also:
Modifier

setParameterText

public void setParameterText(java.lang.String parameters)
Sets the parameters of the method as a single string, e.g. "boolean foo, String bar".

addParameter

public JotParameterDeclaration addParameter(JotMarker marker,
                                            boolean before,
                                            java.lang.String type,
                                            java.lang.String value)
Creates a JotParameterDeclaration object with the specified name and type and adds it to this method's declaration.

removeParameter

public void removeParameter(JotParameter param)
Removes the specified parameter from this method's declaration.

addThrowSpecifier

public JotType addThrowSpecifier(JotMarker marker,
                                 boolean before,
                                 java.lang.String type)
Creates a JotType object with the specified type and adds it to the throws clause of this method's declaration.

removeThrowSpecifier

public void removeThrowSpecifier(JotType spec)
Removes the specified exception from this method's declaration.

getCodeBlock

public JotCodeBlock getCodeBlock()
Returns the body of this method, or null if this is an abstract method.

getStatements

public JotStatement[] getStatements()
Returns an array of JotStatement objects which represent the statements contained in the body of this method. If this method is abstract or it's body is empty, then returns a zero-length array.