greflect
0.11-DRAFT

jp.sourceforge.greflect
Class Reflection.Instantiator<T>

java.lang.Object
  extended by jp.sourceforge.greflect.Reflection.Instantiator<T>
Enclosing class:
Reflection

public abstract class Reflection.Instantiator<T>
extends java.lang.Object

[ungeneric]
Instantiator creates a ungeneric object of the specified type
Instantiatorは指定された型のアンジェネリックオブジェクトを生成します。 .

Type Variable T:
The type of instantiate() return.
Responsibilities & Collaborations:
  1. Generate the bytecode and create its instance with BytecodeGeneratorCloassLoader

    @lang ja バイトコード生成することでアンジェネリックなクラスを作成し、そのインスタンスを生成する。

  2. Check the generic types of parameters with Param

    @lang ja コンストラクタにパラメータを指定する。

Notes & Descriptions:
See How To Create Instance to know the basic use of this class.

@lang ja このクラスの基本的な使用方法を知るには How To Create Instance を見てください。

SourceInfo:
$Id: Reflection.java 132 2008-07-02 13:51:18Z yo-zi $

Author:
yo-zi

Constructor Summary
Reflection.Instantiator(Param<?> instype, java.lang.reflect.Constructor<?> cst, Param<?>... args)
          Prepares to generate the instance by checking the number of parameters and the validity of the generic types
パラメタ数とジェネリックタイプの妥当性をチェックすることによって、 インスタンスを生成する準備をします。 .
Reflection.Instantiator(Param<?> instype, Param<?>... args)
          Prepares to generate the instance by checking the number of parameters and the validity of the generic types
パラメタ数とジェネリックタイプの妥当性をチェックする ことによって、インスタンスを生成する準備をします。 .
 
Method Summary
 T instantiate()
          Create a instance
インスタンスを生成します。 .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reflection.Instantiator

public Reflection.Instantiator(Param<?> instype,
                               Param<?>... args)
                        throws java.lang.SecurityException,
                               java.lang.ClassNotFoundException,
                               TypeViolationException,
                               java.lang.IllegalArgumentException,
                               java.lang.NoSuchMethodException,
                               java.lang.IllegalAccessException
Prepares to generate the instance by checking the number of parameters and the validity of the generic types
パラメタ数とジェネリックタイプの妥当性をチェックする ことによって、インスタンスを生成する準備をします。 .
Pre-conditions :
Each instype and args must be satisfy one of following conditions.
  1. An ungeneric instance of Param.
  2. The instance of UngenericParam of ungeneric object.
When both of above conditions are not satisfied. UnresolvedTypeVariableException will be thrown.

@lang ja instypeおよびargsは以下のいずれかである必要があります。

  1. のアンジェネリックインスタンスである
  2. アンジェネリックをオブジェクトを指定したUngenericParam インスタンスである
もしいずれでもないなら、UnresolvedTypeVariableExceptionが スローされます。
Post-conditions :
The target constructor is executable.

@lang ja 対象のコンストラクタは実行可能である。

Parameters:
instype - the type of instance to create.
@lang ja 生成するオブジェクトの型。
args - the parameters of constructor.
@lang ja コンストラクタに渡す引数。
Throws:
java.lang.SecurityException
java.lang.ClassNotFoundException
TypeViolationException
java.lang.IllegalArgumentException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException

Reflection.Instantiator

public Reflection.Instantiator(Param<?> instype,
                               java.lang.reflect.Constructor<?> cst,
                               Param<?>... args)
                        throws java.lang.SecurityException,
                               java.lang.ClassNotFoundException,
                               TypeViolationException,
                               java.lang.IllegalArgumentException,
                               java.lang.IllegalAccessException
Prepares to generate the instance by checking the number of parameters and the validity of the generic types
パラメタ数とジェネリックタイプの妥当性をチェックすることによって、 インスタンスを生成する準備をします。 . Type variable T is used to fix generic type. このコンストラクタでは型変数Tを使ってジェネリック型を決定します。
Pre-conditions :
Each instype and args must be satisfy one of following conditions.
  1. An ungeneric instance of Param.
  2. The instance of UngenericParam of ungeneric object.
When both of above conditions are not satisfied. UnresolvedTypeVariableException will be thrown.

@lang ja instypeおよびargsは以下のいずれかである必要があります。

  1. Paramのアンジェネリックインスタンスである
  2. アンジェネリックをオブジェクトを指定したUngenericParam インスタンスである
もしいずれでもないなら、UnresolvedTypeVariableExceptionが スローされます。
Post-conditions :
The target constructor is executable.

@lang ja 対象のコンストラクタは実行可能である。

Parameters:
instype - the type of instance to create.
@lang ja 生成するオブジェクトの型。
cst - the constructor to invoke.
@lang ja オブジェクトの生成に使用するコンストラクタ。
args - the parameters of constructor.
@lang ja コンストラクタに渡す引数。
Throws:
java.lang.SecurityException
java.lang.ClassNotFoundException
TypeViolationException
java.lang.IllegalArgumentException
java.lang.InstantiationException
java.lang.IllegalAccessException
Method Detail

instantiate

public T instantiate()
              throws java.lang.reflect.InvocationTargetException
Create a instance
インスタンスを生成します。 . The created instance is sure to be ungeneric object.

@lang ja 作られたインスタンスは必ずアンジェネリックオブジェクトになります。

Pre-conditions :
Post-conditions :

Returns:
Throws:
java.lang.reflect.InvocationTargetException

greflect
0.11-DRAFT

Copyright © 2008 yo-zi. All Rights Reserved.