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(); } } }
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()); }
@Override public String getFqn() { return type.getName(); }
public ModuleInfo getModule() { return type.getRaw().getModule(); }