示例#1
0
  protected AegisType createHolderType(TypeClassInfo info) {

    Type heldType = TypeUtil.getSingleTypeParameter(info.getType(), 0);
    if (heldType == null) {
      throw new UnsupportedOperationException("Invalid holder type " + info.getType());
    }

    info.setType(heldType);
    return createType(heldType);
  }
示例#2
0
  public TypeClassInfo createBasicClassInfo(Type type) {
    TypeClassInfo info = new TypeClassInfo();
    Class<?> typeClass = TypeUtil.getTypeClass(type, false);
    if (typeClass != null) {
      info.setDescription("class '" + typeClass.getName() + "'");
    } else {
      info.setDescription("type '" + type + "'");
    }
    info.setType(type);

    return info;
  }
示例#3
0
 /**
  * Create an Aegis type from a reflected type description. This will only work for the restricted
  * set of collection types supported by Aegis.
  *
  * @param t the reflected type.
  * @return the type
  */
 public AegisType createType(Type t) {
   TypeClassInfo info = new TypeClassInfo();
   info.setType(t);
   info.setDescription("reflected type " + t.toString());
   return createTypeForClass(info);
 }