org.jboss.forge.parser.java
Interface Method<O>

All Superinterfaces:
Abstractable<Method<O>>, AnnotationTarget<O,Method<O>>, Internal, Member<O,Method<O>>, Origin<O>, VisibilityScoped<Method<O>>

public interface Method<O>
extends Abstractable<Method<O>>, Member<O,Method<O>>, Origin<O>

Represents a Java Method.

Author:
Lincoln Baxter, III

Method Summary
 Method<O> addThrows(Class<? extends Exception> type)
          Add a thrown Exception to this method's signature.
 Method<O> addThrows(String type)
          Add a thrown Exception to this method's signature.
 String getBody()
          Get the inner body of this Method
 List<Parameter> getParameters()
          Get a list of this Method's parameters.
 String getReturnType()
          Get the return type of this Method or return null if the return type is void.
 List<String> getThrownExceptions()
          Get a list of qualified (if possible) Exception class names thrown by this method.
 boolean isConstructor()
          Return true if this Method is a constructor for the class in which it is defined.
 boolean isReturnTypeVoid()
          Return true if this Method has a return type of 'void'
 Method<O> removeThrows(Class<? extends Exception> type)
          Remove a thrown Exception to this method's signature.
 Method<O> removeThrows(String type)
          Remove a thrown Exception to this method's signature.
 Method<O> setBody(String body)
          Set the inner body of this Method
 Method<O> setConstructor(boolean constructor)
          Toggle this method as a constructor.
 Method<O> setName(String name)
          Set the name of this Method
 Method<O> setParameters(String string)
          Set this Method's parameters.
 Method<O> setReturnType(Class<?> type)
          Set this Method to return the given type.
 Method<O> setReturnType(JavaSource<?> type)
          Set this Method to return the given JavaSource type.
 Method<O> setReturnType(String type)
          Set this Method to return the given type.
 Method<O> setReturnTypeVoid()
          Set this Method to return 'void'
 String toSignature()
          Convert this Method into a string representing its unique signature.
 
Methods inherited from interface org.jboss.forge.parser.java.Abstractable
isAbstract, setAbstract
 
Methods inherited from interface org.jboss.forge.parser.java.Member
getName, isFinal, isStatic, setFinal, setStatic
 
Methods inherited from interface org.jboss.forge.parser.java.VisibilityScoped
getVisibility, isPackagePrivate, isPrivate, isProtected, isPublic, setPackagePrivate, setPrivate, setProtected, setPublic, setVisibility
 
Methods inherited from interface org.jboss.forge.parser.java.AnnotationTarget
addAnnotation, addAnnotation, addAnnotation, getAnnotation, getAnnotation, getAnnotations, hasAnnotation, hasAnnotation, removeAnnotation
 
Methods inherited from interface org.jboss.forge.parser.Internal
getInternal
 
Methods inherited from interface org.jboss.forge.parser.Origin
getOrigin
 

Method Detail

getBody

String getBody()
Get the inner body of this Method


setBody

Method<O> setBody(String body)
Set the inner body of this Method


setConstructor

Method<O> setConstructor(boolean constructor)
Toggle this method as a constructor. If true, and the name of the Method is not the same as the name of its parent JavaClass , update the name of the to match.


isConstructor

boolean isConstructor()
Return true if this Method is a constructor for the class in which it is defined.


setName

Method<O> setName(String name)
Set the name of this Method


getReturnType

String getReturnType()
Get the return type of this Method or return null if the return type is void.


setReturnType

Method<O> setReturnType(Class<?> type)
Set this Method to return the given type.


setReturnType

Method<O> setReturnType(String type)
Set this Method to return the given type.


setReturnType

Method<O> setReturnType(JavaSource<?> type)
Set this Method to return the given JavaSource type.


isReturnTypeVoid

boolean isReturnTypeVoid()
Return true if this Method has a return type of 'void'


setReturnTypeVoid

Method<O> setReturnTypeVoid()
Set this Method to return 'void'


setParameters

Method<O> setParameters(String string)
Set this Method's parameters.


getParameters

List<Parameter> getParameters()
Get a list of this Method's parameters.


toSignature

String toSignature()
Convert this Method into a string representing its unique signature.


addThrows

Method<O> addThrows(String type)
Add a thrown Exception to this method's signature.


addThrows

Method<O> addThrows(Class<? extends Exception> type)
Add a thrown Exception to this method's signature.


getThrownExceptions

List<String> getThrownExceptions()
Get a list of qualified (if possible) Exception class names thrown by this method.


removeThrows

Method<O> removeThrows(String type)
Remove a thrown Exception to this method's signature.


removeThrows

Method<O> removeThrows(Class<? extends Exception> type)
Remove a thrown Exception to this method's signature.



Copyright © 2011 Seam Framework. All Rights Reserved.