use of com.sun.codemodel.JDocComment in project jsonschema2pojo by joelittlejohn.
the class JavaNameRule method apply.
@Override
public JDocComment apply(String nodeName, JsonNode node, JDocCommentable generatableType, Schema currentSchema) {
JDocComment javaDoc = generatableType.javadoc();
javaDoc.append(String.format("%nCorresponds to the \"%s\" property.", nodeName));
return javaDoc;
}
use of com.sun.codemodel.JDocComment in project jsonschema2pojo by joelittlejohn.
the class DescriptionRule method apply.
/**
* Applies this schema rule to take the required code generation steps.
* <p>
* When a description node is found and applied with this rule, the value of
* the description is added as a class level JavaDoc comment.
*
* @param nodeName
* the name of the object to which this description applies
* @param node
* the "description" schema node
* @param generatableType
* comment-able code generation construct, usually a java class,
* which should have this description applied
* @return the JavaDoc comment created to contain the description
*/
@Override
public JDocComment apply(String nodeName, JsonNode node, JDocCommentable generatableType, Schema schema) {
JDocComment javadoc = generatableType.javadoc();
javadoc.append(node.asText());
return javadoc;
}
Aggregations