throw new InvalidElementException(String.format("Pojo %s must not be a non-static inner class!",
annotatedElement), annotatedElement);
}
return getInputForAnnotatedPojo(typeEl);
} else if (annotatedElement.getKind() == ElementKind.CONSTRUCTOR) {
ExecutableElement constrEl = (ExecutableElement) annotatedElement;
if (constrEl.getModifiers().contains(Modifier.PRIVATE)) {
throw new InvalidElementException(String.format("Constructor %s must not be private!", annotatedElement),
annotatedElement);
}
TypeElement typeEl = (TypeElement) constrEl.getEnclosingElement();
if (typeEl.getModifiers().contains(Modifier.PRIVATE)) {
throw new InvalidElementException(String.format("Pojo %s must not be private!", typeEl), annotatedElement);
}
if (typeEl.getEnclosingElement().getKind() == ElementKind.CLASS
&& !typeEl.getModifiers().contains(Modifier.STATIC)) {
throw new InvalidElementException(String.format("Pojo %s must not be a non-static inner class!", typeEl),
annotatedElement);
}
return getInputForAnnotatedConstructor(constrEl);
} else if (annotatedElement.getKind() == ElementKind.METHOD) {
ExecutableElement methodEl = (ExecutableElement) annotatedElement;
// TODO add support for non-static and non-public factory methods
if (!methodEl.getModifiers().contains(Modifier.STATIC)) {
throw new InvalidElementException(String.format("Factory method %s must be static!", annotatedElement),
annotatedElement);
}
if (!methodEl.getModifiers().contains(Modifier.PUBLIC)) {
throw new InvalidElementException(String.format("Factory method %s must be public!", annotatedElement),
annotatedElement);
}
return getInputForAnnotatedFactoryMethod(methodEl);
} else {