use of io.strimzi.crdgenerator.annotations.DescriptionFile in project strimzi by strimzi.
the class DocGenerator method appendDescription.
private void appendDescription(Class<?> cls) throws IOException {
DescriptionFile descriptionFile = cls.getAnnotation(DescriptionFile.class);
Description description = cls.getAnnotation(Description.class);
if (descriptionFile != null) {
String filename = "api/" + cls.getCanonicalName() + ".adoc";
File includeFile = new File(filename);
if (!includeFile.isFile()) {
throw new RuntimeException("Class " + cls.getCanonicalName() + " has @DescribeFile annotation, but file " + filename + " does not exist!");
}
out.append("xref:type-").append(cls.getSimpleName()).append("-schema-{context}[Full list of `").append(cls.getSimpleName()).append("` schema properties]").append(NL);
out.append(NL);
out.append("include::../" + filename + "[leveloffset=+1]").append(NL);
out.append(NL);
out.append("[id='type-").append(cls.getSimpleName()).append("-schema-{context}']").append(NL);
out.append("==== `").append(cls.getSimpleName()).append("` schema properties").append(NL);
out.append(NL);
} else if (description != null) {
out.append(getDescription(description)).append(NL);
}
out.append(NL);
}
use of io.strimzi.crdgenerator.annotations.DescriptionFile in project strimzi-kafka-operator by strimzi.
the class DocGenerator method appendDescription.
private void appendDescription(Class<?> cls) throws IOException {
DescriptionFile descriptionFile = cls.getAnnotation(DescriptionFile.class);
Description description = cls.getAnnotation(Description.class);
if (descriptionFile != null) {
String filename = "api/" + cls.getCanonicalName() + ".adoc";
File includeFile = new File(filename);
if (!includeFile.isFile()) {
throw new RuntimeException("Class " + cls.getCanonicalName() + " has @DescribeFile annotation, but file " + filename + " does not exist!");
}
out.append("xref:type-").append(cls.getSimpleName()).append("-schema-{context}[Full list of `").append(cls.getSimpleName()).append("` schema properties]").append(NL);
out.append(NL);
out.append("include::../" + filename + "[leveloffset=+1]").append(NL);
out.append(NL);
out.append("[id='type-").append(cls.getSimpleName()).append("-schema-{context}']").append(NL);
out.append("==== `").append(cls.getSimpleName()).append("` schema properties").append(NL);
out.append(NL);
} else if (description != null) {
out.append(getDescription(description)).append(NL);
}
out.append(NL);
}
Aggregations