fr.umlv.corosol.component.impl
Class DefaultJConstructor

java.lang.Object
  extended by fr.umlv.corosol.component.impl.DefaultJConstructor
All Implemented Interfaces:
JClassMethod, JConstructor, JObject

public class DefaultJConstructor
extends java.lang.Object
implements JConstructor

This is the default implementation of the JConstructor interface.

Author:
Christophe Deleray

Field Summary
 
Fields inherited from interface fr.umlv.corosol.component.JConstructor
CLINIT, INIT
 
Constructor Summary
DefaultJConstructor(JClass declaringClass, JClassMember consInfo)
          Creates a new DefaultJConstructor object initialized with the specified class file item that containing the constructor datas and with the specified declaring class.
 
Method Summary
 byte[] getBytecode()
          Returns an array of bytes containg the byte code of the constructor represented by this JConstructor object.
 JClass getDeclaringClass()
          Returns the JClass object representing the class that declares the constructor represented by this JConstructor object.
 java.lang.String getDescriptor()
          Returns the descriptor of the constructor represented by this JConstructor object, as a String.
 JClass[] getExceptionTypes()
          Returns an array of JClass objects that represent the types of the exceptions declared to be thrown by the underlying constructor represented by this JConstructor object.
 int getMaxLocals()
          Returns the number of local variables in the local variable array allocated upon invocation of this constructor, including the local variables used to pass parameters to this constructor on its invocation.
 int getMaxStack()
          Returns the maximum depth of the operand stack of a frame at any point during execution of this constructor.
 int getModifiers()
          Returns the Java language modifiers for the constructor represented by this JConstructor object, as an integer.
 java.lang.String getName()
          Returns the name of this constructor, as a string.
 java.lang.reflect.Constructor getNativeConstructor()
          Returns the java.lang.reflect.Constructor object equivalent to this JConstructor object.
 JClass[] getParameterTypes()
          Returns an array of JClass objects that represent the formal parameter types, in declaration order, of the constructor represented by this JConstructor object.
 void invoke(JMethodInvoker invoker, JThread thread)
          Invokes the methods represented by this JClassMethod via the specified method invoker and into the specified thread.
 java.lang.String toString()
          Returns a string describing this JMethod.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultJConstructor

public DefaultJConstructor(JClass declaringClass,
                           JClassMember consInfo)
Creates a new DefaultJConstructor object initialized with the specified class file item that containing the constructor datas and with the specified declaring class.

Parameters:
declaringClass - the class declaring the method
consInfo - the class file item containing the method datas
Method Detail

getNativeConstructor

public java.lang.reflect.Constructor getNativeConstructor()
Returns the java.lang.reflect.Constructor object equivalent to this JConstructor object.

Specified by:
getNativeConstructor in interface JConstructor
Returns:
the java.lang.reflect.Constructor object equivalent to this JConstructor object
See Also:
Constructor

getDeclaringClass

public JClass getDeclaringClass()
Returns the JClass object representing the class that declares the constructor represented by this JConstructor object.

Specified by:
getDeclaringClass in interface JClassMethod

getName

public java.lang.String getName()
Returns the name of this constructor, as a string. This is always the same as the simple name of the constructor's declaring class.

Specified by:
getName in interface JClassMethod
See Also:
JConstructor.INIT

getModifiers

public int getModifiers()
Returns the Java language modifiers for the constructor represented by this JConstructor object, as an integer. The Modifier class should be used to decode the modifiers.

Specified by:
getModifiers in interface JClassMethod
See Also:
Modifier

getDescriptor

public java.lang.String getDescriptor()
Returns the descriptor of the constructor represented by this JConstructor object, as a String.

Specified by:
getDescriptor in interface JClassMethod

getParameterTypes

public JClass[] getParameterTypes()
Returns an array of JClass objects that represent the formal parameter types, in declaration order, of the constructor represented by this JConstructor object. Returns an array of length 0 if the underlying constructor takes no parameters.

Specified by:
getParameterTypes in interface JClassMethod
Returns:
the parameter types for the constructor this object represents

getExceptionTypes

public JClass[] getExceptionTypes()
Returns an array of JClass objects that represent the types of the exceptions declared to be thrown by the underlying constructor represented by this JConstructor object. Returns an array of length 0 if the constructor declares no exceptions in its throws clause.

Specified by:
getExceptionTypes in interface JClassMethod
Returns:
the exception types declared as being thrown by the constructor this object represents

getBytecode

public byte[] getBytecode()
Returns an array of bytes containg the byte code of the constructor represented by this JConstructor object.

Specified by:
getBytecode in interface JClassMethod
Returns:
the byte code of the constructor

getMaxStack

public int getMaxStack()
Returns the maximum depth of the operand stack of a frame at any point during execution of this constructor.

Specified by:
getMaxStack in interface JClassMethod

getMaxLocals

public int getMaxLocals()
Returns the number of local variables in the local variable array allocated upon invocation of this constructor, including the local variables used to pass parameters to this constructor on its invocation.

Specified by:
getMaxLocals in interface JClassMethod

invoke

public void invoke(JMethodInvoker invoker,
                   JThread thread)
            throws java.lang.Exception
Invokes the methods represented by this JClassMethod via the specified method invoker and into the specified thread.

Specified by:
invoke in interface JClassMethod
Parameters:
invoker - a method invoker
thread - the thread into which the method will be executed
Throws:
java.lang.Exception - if the executed method throws an exception

toString

public java.lang.String toString()
Returns a string describing this JMethod.

Overrides:
toString in class java.lang.Object