use of com.thoughtworks.qdox.JavaDocBuilder in project jsonschema2pojo by joelittlejohn.
the class RequiredArrayIT method generateClasses.
@BeforeClass
public static void generateClasses() throws ClassNotFoundException, IOException {
classSchemaRule.generateAndCompile("/schema/required/requiredArray.json", "com.example");
File generatedJavaFile = classSchemaRule.generated("com/example/RequiredArray.java");
JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
javaDocBuilder.addSource(generatedJavaFile);
classWithRequired = javaDocBuilder.getClassByName("com.example.RequiredArray");
}
use of com.thoughtworks.qdox.JavaDocBuilder in project jsonschema2pojo by joelittlejohn.
the class RequiredIT method generateClasses.
@BeforeClass
public static void generateClasses() throws ClassNotFoundException, IOException {
classSchemaRule.generateAndCompile("/schema/required/required.json", "com.example");
File generatedJavaFile = classSchemaRule.generated("com/example/Required.java");
JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
javaDocBuilder.addSource(generatedJavaFile);
classWithRequired = javaDocBuilder.getClassByName("com.example.Required");
}
use of com.thoughtworks.qdox.JavaDocBuilder in project jsonschema2pojo by joelittlejohn.
the class DescriptionIT method generateClasses.
@BeforeClass
public static void generateClasses() throws ClassNotFoundException, IOException {
schemaRule.generateAndCompile("/schema/description/description.json", "com.example");
File generatedJavaFile = schemaRule.generated("com/example/Description.java");
JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
javaDocBuilder.addSource(generatedJavaFile);
classWithDescription = javaDocBuilder.getClassByName("com.example.Description");
}
use of com.thoughtworks.qdox.JavaDocBuilder in project jsonschema2pojo by joelittlejohn.
the class JavaNameIT method inlineRequiredAppearsInFieldJavadoc.
@Test
public void inlineRequiredAppearsInFieldJavadoc() throws IOException {
schemaRule.generateAndCompile("/schema/javaName/javaNameWithRequiredProperties.json", "com.example.required");
File generatedJavaFileWithRequiredProperties = schemaRule.generated("com/example/required/JavaNameWithRequiredProperties.java");
JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
javaDocBuilder.addSource(generatedJavaFileWithRequiredProperties);
JavaClass classWithRequiredProperties = javaDocBuilder.getClassByName("com.example.required.JavaNameWithRequiredProperties");
JavaField javaFieldWithoutJavaName = classWithRequiredProperties.getFieldByName("inlineRequiredPropertyWithoutJavaName");
JavaField javaFieldWithJavaName = classWithRequiredProperties.getFieldByName("inlineRequiredPropertyWithoutJavaName");
assertThat(javaFieldWithoutJavaName.getComment(), containsString("(Required)"));
assertThat(javaFieldWithJavaName.getComment(), containsString("(Required)"));
}
use of com.thoughtworks.qdox.JavaDocBuilder in project jsonschema2pojo by joelittlejohn.
the class JavaNameIT method arrayRequiredAppearsInFieldJavadoc.
@Test
public void arrayRequiredAppearsInFieldJavadoc() throws IOException {
schemaRule.generateAndCompile("/schema/javaName/javaNameWithRequiredProperties.json", "com.example.required");
File generatedJavaFileWithRequiredProperties = schemaRule.generated("com/example/required/JavaNameWithRequiredProperties.java");
JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
javaDocBuilder.addSource(generatedJavaFileWithRequiredProperties);
JavaClass classWithRequiredProperties = javaDocBuilder.getClassByName("com.example.required.JavaNameWithRequiredProperties");
JavaField javaFieldWithoutJavaName = classWithRequiredProperties.getFieldByName("requiredPropertyWithoutJavaName");
JavaField javaFieldWithJavaName = classWithRequiredProperties.getFieldByName("requiredPropertyWithoutJavaName");
assertThat(javaFieldWithoutJavaName.getComment(), containsString("(Required)"));
assertThat(javaFieldWithJavaName.getComment(), containsString("(Required)"));
}
Aggregations