public TypeDef apply(TypeElement classElement) { List<ClassRef> extendsList = new ArrayList<ClassRef>(); //Check SuperClass Kind kind = Kind.CLASS; if (classElement.getKind() == ElementKind.INTERFACE) { kind = Kind.INTERFACE; } else if (classElement.getKind() == ElementKind.CLASS) { kind = Kind.CLASS; extendsList.add(TypeDef.OBJECT_REF); } else if (classElement.getKind() == ElementKind.ANNOTATION_TYPE) { kind = Kind.ANNOTATION; } Set<Method> allMethods = new LinkedHashSet<Method>(); for (ExecutableElement method : ElementFilter.methodsIn(classElement.getEnclosedElements())) { } return new TypeDefBuilder() .withKind(kind) .withModifiers(TypeUtils.modifiersToInt(classElement.getModifiers())) .withPackageName(getPackageName(classElement)) .withName(getClassName(classElement)) .withExtendsList(extendsList) .addAllToMethods(allMethods) .withOuterType(classElement.getEnclosingElement() instanceof TypeElement ? SHALLOW_TYPEDEF.apply((TypeElement) classElement.getEnclosingElement()) : null) .build(); } };
.withModifiers(TypeUtils.modifiersToInt(classElement.getModifiers())) .withPackageName(getPackageName(classElement)) .withName(getClassName(classElement)) .withParameters(genericTypes) .withExtendsList(superClassType instanceof ClassRef ? (ClassRef) superClassType : null)
@Override default void add(Element element) { CustomResource customResource = element.getAnnotation(CustomResource.class); if (element instanceof TypeElement) { TypeDef definition = ElementTo.TYPEDEF.apply((TypeElement) element); String className = ModelUtils.getClassName(element); on(customResource != null ? new ConfigurationSupplier<CustomResourceConfig>(CustomResourceConfigAdapter.newBuilder(customResource).addToAttributes(Keys.TYPE_DEFINITION, definition).accept(new AddClassNameConfigurator(className))) : new ConfigurationSupplier<CustomResourceConfig>(new CustomResourceConfigBuilder().addToAttributes(Keys.TYPE_DEFINITION, definition).accept(new AddClassNameConfigurator(className)))); } }