パッケージ org.piax.util

クラス ClassUtil

java.lang.Object
org.piax.util.ClassUtil

public class ClassUtil
extends Object
クラスおよびインタフェースの継承関係の処理に関するユーティリティクラス。

stubの生成に関するProxyクラスの生成に必要なsuperインタフェースの 算出用メソッドが用意されている。

上記のsuperインタフェースの2回目以降の算出コストを抑えるため、計算結果は キャッシュしている。

関連項目:
MethodUtil
  • コンストラクタの概要

    コンストラクタ 
    コンストラクタ 説明
    ClassUtil()  
  • メソッドの概要

    修飾子とタイプ メソッド 説明
    static <T> Class<?>[] gatherLowerBoundSuperInterfaces​(Class<T> clazz, Class<?> superIf)
    指定されたclazzの持つinterface(super classから継承されたものも含めて)の中で、 指定された superIfと同じかsub interface の関係にある interfaceの集合の中で、 下界(lower bound)なものを求める。
    static boolean isSub​(Class<?> clazz1, Class<?> clazz2)  

    クラスから継承されたメソッド java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • コンストラクタの詳細

  • メソッドの詳細

    • isSub

      public static boolean isSub​(Class<?> clazz1, Class<?> clazz2)
    • gatherLowerBoundSuperInterfaces

      public static <T> Class<?>[] gatherLowerBoundSuperInterfaces​(Class<T> clazz, Class<?> superIf)
      指定されたclazzの持つinterface(super classから継承されたものも含めて)の中で、 指定された superIfと同じかsub interface の関係にある interfaceの集合の中で、 下界(lower bound)なものを求める。clazz自身がinterfaceの場合は、clazz自身も含める。

      効率化のため、計算した値はキャッシュに登録しておく。

      型パラメータ:
      T - the type of the class.
      パラメータ:
      clazz - 基準となるクラス
      superIf - super interface
      戻り値:
      clazz から見て super であり、superIf から見て subである interface の中で下界なもの