gnu.jel.LocalMethod Maven / Gradle / Ivy
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* $Id: LocalMethod.java 490 2006-10-01 16:08:04Z metlov $
*
* This file is part of the Java Expressions Library (JEL).
* For more information about JEL visit :
* http://kinetic.ac.donetsk.ua/JEL/
*
* (c) 1998 -- 2007 by Konstantin Metlov([email protected]);
*
* JEL is Distributed under the terms of GNU General Public License.
* This code comes with ABSOLUTELY NO WARRANTY.
* For license details see COPYING file in this directory.
*/
package gnu.jel;
import gnu.jel.debug.Debug;
/**
* Represents a method local to the class being compiled.
*/
public class LocalMethod extends LocalField {
private Class[] paramTypes;
private Class[] exceptions;
/**
* Constructs a new local method.
* @param modifiers sum of one or more of PUBLIC, PRIVATE,
* PROTECTED,STATIC, FINAL,
* SYNCHRONIZED, NATIVE, ABSTRACT
* constants of java.lang.reflect.Modifier .
* @param type type of the return value.
* @param name name of the method
* @param paramTypes array of types of formal parameters excluding "this"
* (null means no parameters).
* @param exceptions checked exceptions thrown
*/
public LocalMethod(int modifiers, Class type, java.lang.String name,
Class[] paramTypes,Class[] exceptions) {
super(modifiers,type,name,null);
if (paramTypes!=null)
this.paramTypes=paramTypes;
else
this.paramTypes=new Class[0];
if (exceptions!=null)
this.exceptions=exceptions;
else
this.exceptions=new Class[0];
};
/**
* Used to obtain types of formal parameters of this method.
* @return array of classes representing formal parameters of the
* method except "this"
*/
public Class[] getParameterTypes() {
return paramTypes;
};
/**
* Used to get checked exceptions thrown by this method
* @return array of checked exceptions
*/
public Class[] getExceptionTypes() {
return exceptions;
};
};
© 2015 - 2024 Weber Informatics LLC | Privacy Policy