Exemplo n.º 1
0
 private void processImportedTypes() {
   for (PropertyInfo property : propertyMap.values()) {
     property.type.collectImports(importedTypes);
   }
   importedTypes.addAll(superTypes.stream().collect(toList()));
   for (Iterator<ClassTypeInfo> i = importedTypes.iterator(); i.hasNext(); ) {
     ClassTypeInfo importedType = i.next();
     if (importedType.getPackageName().equals(type.getPackageName())) {
       i.remove();
     }
   }
 }
Exemplo n.º 2
0
  private int processConstructor(ExecutableElement constrElt) {
    if (constrElt.getModifiers().contains(Modifier.PUBLIC)) {
      Element ownerElt = constrElt.getEnclosingElement();
      if (ownerElt.equals(modelElt)) {
        List<? extends VariableElement> parameters = constrElt.getParameters();
        int size = parameters.size();
        if (size == 1) {
          TypeInfo ti = typeFactory.create(parameters.get(0).asType());
          if (ti instanceof ClassTypeInfo) {
            ClassTypeInfo cl = (ClassTypeInfo) ti;
            if (cl.getKind() == ClassKind.JSON_OBJECT) {
              return 2;
            }
          }
        }
      }
    }

    return 0;
  }
 @Override
 public void renderJavaType(ClassTypeInfo javaType) {
   append(javaType.getName());
 }
Exemplo n.º 4
0
 @Override
 public String getFqn() {
   return type.getName();
 }
Exemplo n.º 5
0
 public ModuleInfo getModule() {
   return type.getRaw().getModule();
 }