Example #1
0
 public static TypeInfo formImport(Import typeName, boolean isArray) {
   TypeInfo typeInfo = new TypeInfo();
   typeInfo.type = TypeInfo.Type.form(typeName.getFullName());
   typeInfo.isArray = isArray;
   if (!typeInfo.type.isBaseType()) {
     typeInfo.packageName = typeName.getPackageName();
     typeInfo.name = typeName.getName();
     typeInfo.isInside = typeName.isInside();
   }
   return typeInfo;
 }
Example #2
0
  public static TypeInfo formBaseType(String name, boolean isArray) {
    TypeInfo typeInfo = new TypeInfo();
    typeInfo.type = TypeInfo.Type.form(name);
    typeInfo.isArray = isArray;
    typeInfo.isInside = false;

    if (!typeInfo.type.isBaseType()) {
      throw new AnalyseException("错误的类型,不是base类型:" + name);
    }
    return typeInfo;
  }