Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

java::lang::reflect::Constructor Class Reference

Constructor provides information about, and access to, a single constructor for a class. More...

#include <java_lang_reflect_Constructor.h>

Inheritance diagram for java::lang::reflect::Constructor:

Inheritance graph
[legend]
Collaboration diagram for java::lang::reflect::Constructor:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9,
  xmogBuildNumber = 2047
}
typedef ::xmog_java_array_template<
::java::lang::reflect::Constructor
array1D
typedef ::xmog_java_array_template<
::xmog_java_array_template<
::java::lang::reflect::Constructor > > 
array2D

Public Member Functions

 Constructor (const ::java::lang::Class &declaringClass, const ::xmog_java_array_template< ::java::lang::Class > &parameterTypes, const ::xmog_java_array_template< ::java::lang::Class > &checkedExceptions, jint modifiers, jint slot,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Package-private constructor used by ReflectAccess to enable instantiation of these objects in Java code from the java.lang package via sun.reflect.LangReflectAccess.
bool equals (const ::java::lang::Object &obj,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Compares this Constructor against the specified object.
::java::lang::Class getDeclaringClass (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the Class object representing the class that declares the constructor represented by this Constructor object.
::xmog_java_array_template<
::java::lang::Class
getExceptionTypes (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns an array of Class objects that represent the types of of exceptions declared to be thrown by the underlying constructor represented by this Constructor object.
jint getModifiers (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the Java language modifiers for the constructor represented by this Constructor object, as an integer.
::java::lang::String getName (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the name of this constructor, as a string.
::xmog_java_array_template<
::java::lang::Class
getParameterTypes (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor represented by this Constructor object.
jint hashCode (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns a hashcode for this Constructor.
::java::lang::Object newInstance (const ::xmog_java_array_template< ::java::lang::Object > &initargs,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Uses the constructor represented by this Constructor object to create and initialize a new instance of the constructor's declaring class, with the specified initialization parameters.
::java::lang::String toString (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns a string describing this Constructor.

Detailed Description

Constructor provides information about, and access to, a single constructor for a class.

Constructor permits widening conversions to occur when matching the actual parameters to newInstance() with the underlying constructor's formal parameters, but throws an IllegalArgumentException if a narrowing conversion would occur.

Author:
Kenneth Russell

Nakul Saraiya


Constructor & Destructor Documentation

java::lang::reflect::Constructor::Constructor const ::java::lang::Class declaringClass,
const ::xmog_java_array_template< ::java::lang::Class > &  parameterTypes,
const ::xmog_java_array_template< ::java::lang::Class > &  checkedExceptions,
jint  modifiers,
jint  slot,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Package-private constructor used by ReflectAccess to enable instantiation of these objects in Java code from the java.lang package via sun.reflect.LangReflectAccess.

Parameters:
declaringClass a reference to an outer class instance.
parameterTypes a reference to an outer class instance.
checkedExceptions a reference to an outer class instance.
modifiers a reference to an outer class instance.
slot a reference to an outer class instance.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.


Member Function Documentation

bool java::lang::reflect::Constructor::equals const ::java::lang::Object obj,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Compares this Constructor against the specified object.

Returns true if the objects are the same. Two Constructor objects are the same if they were declared by the same class and have the same formal parameter types.

Parameters:
obj a reference to an outer class instance.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::lang::Object.

::java::lang::Class java::lang::reflect::Constructor::getDeclaringClass ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the Class object representing the class that declares the constructor represented by this Constructor object.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::lang::reflect::Member.

::xmog_java_array_template< ::java::lang::Class > java::lang::reflect::Constructor::getExceptionTypes ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns an array of Class objects that represent the types of of exceptions declared to be thrown by the underlying constructor represented by this Constructor object.

Returns an array of length 0 if the constructor declares no exceptions in its throws clause.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the exception types declared as being thrown by the constructor this object represents

jint java::lang::reflect::Constructor::getModifiers ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns the Java language modifiers for the constructor represented by this Constructor object, as an integer.

The Modifier class should be used to decode the modifiers.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::lang::reflect::Member.

::java::lang::String java::lang::reflect::Constructor::getName ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the name of this constructor, as a string.

This is always the same as the simple name of the constructor's declaring class.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::lang::reflect::Member.

::xmog_java_array_template< ::java::lang::Class > java::lang::reflect::Constructor::getParameterTypes ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns an array of Class objects that represent the formal parameter types, in declaration order, of the constructor represented by this Constructor object.

Returns an array of length 0 if the underlying constructor takes no parameters.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the parameter types for the constructor this object represents

jint java::lang::reflect::Constructor::hashCode ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Returns a hashcode for this Constructor.

The hashcode is the same as the hashcode for the underlying constructor's declaring class name.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::lang::Object.

::java::lang::Object java::lang::reflect::Constructor::newInstance const ::xmog_java_array_template< ::java::lang::Object > &  initargs,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Uses the constructor represented by this Constructor object to create and initialize a new instance of the constructor's declaring class, with the specified initialization parameters.

Individual parameters are automatically unwrapped to match primitive formal parameters, and both primitive and reference parameters are subject to method invocation conversions as necessary.

If the number of formal parameters required by the underlying constructor is 0, the supplied initargs array may be of length 0 or null.

If the required access and argument checks succeed and the instantiation will proceed, the constructor's declaring class is initialized if it has not already been initialized.

If the constructor completes normally, returns the newly created and initialized instance.

Parameters:
initargs array of objects to be passed as arguments to the constructor call; values of primitive types are wrapped in a wrapper object of the appropriate type (e.g. a float in a Float)
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
a new object created by calling the constructor this object represents

::java::lang::String java::lang::reflect::Constructor::toString ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns a string describing this Constructor.

The string is formatted as the constructor access modifiers, if any, followed by the fully-qualified name of the declaring class, followed by a parenthesized, comma-separated list of the constructor's formal parameter types. For example:

                    public java.util.Hashtable(int,float)

The only possible modifiers for constructors are the access modifiers public, protected or private. Only one of these may appear, or none if the constructor has default (package) access.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::lang::Object.


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 10:19:36 2006 for JMS Courier for C++ by  doxygen 1.4.1