예제 #1
0
파일: Java5.java 프로젝트: bodiam/discobot
 private ClassNode configureTypeVariableReference(TypeVariable tv) {
   ClassNode cn = ClassHelper.makeWithoutCaching(tv.getName());
   cn.setGenericsPlaceHolder(true);
   ClassNode cn2 = ClassHelper.makeWithoutCaching(tv.getName());
   cn2.setGenericsPlaceHolder(true);
   GenericsType[] gts = new GenericsType[] {new GenericsType(cn2)};
   cn.setGenericsTypes(gts);
   cn.setRedirect(ClassHelper.OBJECT_TYPE);
   return cn;
 }
예제 #2
0
파일: Java5.java 프로젝트: bodiam/discobot
  private ClassNode configureWildcardType(WildcardType wildcardType) {
    ClassNode base = ClassHelper.makeWithoutCaching("?");
    base.setRedirect(ClassHelper.OBJECT_TYPE);
    // TODO: more than one lower bound for wildcards?
    ClassNode[] lowers = configureTypes(wildcardType.getLowerBounds());
    ClassNode lower = null;
    // TODO: is it safe to remove this? What was the original intention?
    if (lower != null) lower = lowers[0];

    ClassNode[] upper = configureTypes(wildcardType.getUpperBounds());
    GenericsType t = new GenericsType(base, upper, lower);
    t.setWildcard(true);

    ClassNode ref = ClassHelper.makeWithoutCaching(Object.class, false);
    ref.setGenericsTypes(new GenericsType[] {t});

    return ref;
  }
예제 #3
0
파일: Java5.java 프로젝트: bodiam/discobot
 private void setGenericsTypes(ClassNode cn) {
   TypeVariable[] tvs = cn.getTypeClass().getTypeParameters();
   GenericsType[] gts = configureTypeVariable(tvs);
   cn.setGenericsTypes(gts);
 }
예제 #4
0
파일: Java5.java 프로젝트: bodiam/discobot
 private ClassNode configureParameterizedType(ParameterizedType parameterizedType) {
   ClassNode base = configureType(parameterizedType.getRawType());
   GenericsType[] gts = configureTypeArguments(parameterizedType.getActualTypeArguments());
   base.setGenericsTypes(gts);
   return base;
 }