コード例 #1
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;
  }
コード例 #2
0
  public TypeClassInfo createBasicClassInfo(Class typeClass) {
    TypeClassInfo info = new TypeClassInfo();
    info.setDescription("class '" + typeClass.getName() + '\'');
    info.setTypeClass(typeClass);

    return info;
  }
コード例 #3
0
 /**
  * Create a AegisType for a Method parameter.
  *
  * @param m the method to create a type for
  * @param index The parameter index. If the index is less than zero, the return type is used.
  */
 public AegisType createType(Method m, int index) {
   TypeClassInfo info = createClassInfo(m, index);
   info.setDescription(
       (index == -1 ? "return type" : "parameter " + index)
           + " of method "
           + m.getName()
           + " in "
           + m.getDeclaringClass());
   return createTypeForClass(info);
 }
コード例 #4
0
 public TypeClassInfo createClassInfo(Field f) {
   TypeClassInfo info = createBasicClassInfo(f.getType());
   info.setDescription("field " + f.getName() + " in  " + f.getDeclaringClass());
   return info;
 }
コード例 #5
0
 public AegisType createType(Class<?> clazz) {
   TypeClassInfo info = createBasicClassInfo(clazz);
   info.setDescription(clazz.toString());
   return createTypeForClass(info);
 }
コード例 #6
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);
 }
コード例 #7
0
 /**
  * Create type information for a <code>Field</code>.
  *
  * @param f the field to create a type from
  */
 public AegisType createType(Field f) {
   TypeClassInfo info = createClassInfo(f);
   info.setDescription("field " + f.getName() + " in " + f.getDeclaringClass());
   return createTypeForClass(info);
 }
コード例 #8
0
 /**
  * Create type information for a PropertyDescriptor.
  *
  * @param pd the propertydescriptor
  */
 public AegisType createType(PropertyDescriptor pd) {
   TypeClassInfo info = createClassInfo(pd);
   info.setDescription("property " + pd.getName());
   return createTypeForClass(info);
 }