use of com.thoughtworks.qdox.model.JavaMethod in project jsonschema2pojo by joelittlejohn.
the class RequiredIT method requiredAppearsInSetterJavadoc.
@Test
public void requiredAppearsInSetterJavadoc() {
JavaMethod javaMethod = classWithRequired.getMethodBySignature("setRequiredProperty", new Type[] { new Type("java.lang.String") });
String javaDocComment = javaMethod.getComment();
assertThat(javaDocComment, containsString("(Required)"));
}
use of com.thoughtworks.qdox.model.JavaMethod in project jsonschema2pojo by joelittlejohn.
the class RequiredIT method requiredAppearsInGetterJavadoc.
@Test
public void requiredAppearsInGetterJavadoc() {
JavaMethod javaMethod = classWithRequired.getMethodBySignature("getRequiredProperty", new Type[] {});
String javaDocComment = javaMethod.getComment();
assertThat(javaDocComment, containsString("(Required)"));
}
use of com.thoughtworks.qdox.model.JavaMethod in project jsonschema2pojo by joelittlejohn.
the class DescriptionIT method descriptionAppearsInSetterJavadoc.
@Test
public void descriptionAppearsInSetterJavadoc() {
JavaMethod javaMethod = classWithDescription.getMethodBySignature("setDescription", new Type[] { new Type("java.lang.String") });
String javaDocComment = javaMethod.getComment();
assertThat(javaDocComment, containsString("A description for this property"));
}
use of com.thoughtworks.qdox.model.JavaMethod in project jsonschema2pojo by joelittlejohn.
the class DescriptionIT method descriptionAppearsInGetterJavadoc.
@Test
public void descriptionAppearsInGetterJavadoc() {
JavaMethod javaMethod = classWithDescription.getMethodBySignature("getDescription", new Type[] {});
String javaDocComment = javaMethod.getComment();
assertThat(javaDocComment, containsString("A description for this property"));
}
use of com.thoughtworks.qdox.model.JavaMethod in project maven-plugins by apache.
the class AbstractFixJavadocMojo method updateJavadocTags.
/**
* Write tags according javaEntityTags.
*
* @param sb not null
* @param entity not null
* @param isJavaExecutable
* @param javaEntityTags not null
*/
private void updateJavadocTags(final StringBuilder sb, final JavaAnnotatedElement entity, final boolean isJavaExecutable, final JavaEntityTags javaEntityTags) {
for (DocletTag docletTag : entity.getTags()) {
if (isJavaExecutable) {
JavaExecutable javaExecutable = (JavaExecutable) entity;
List<String> params = docletTag.getParameters();
if (params.size() < 1) {
continue;
}
if (docletTag.getName().equals(PARAM_TAG)) {
writeParamTag(sb, javaExecutable, javaEntityTags, params);
} else if (docletTag.getName().equals(RETURN_TAG) && javaExecutable instanceof JavaMethod) {
writeReturnTag(sb, (JavaMethod) javaExecutable, javaEntityTags);
} else if (docletTag.getName().equals(THROWS_TAG)) {
writeThrowsTag(sb, javaExecutable, javaEntityTags, params);
} else {
// write unknown tags
for (Iterator<String> it = javaEntityTags.getUnknownTags().iterator(); it.hasNext(); ) {
String originalJavadocTag = it.next();
String simplified = StringUtils.removeDuplicateWhitespace(originalJavadocTag).trim();
if (simplified.contains("@" + docletTag.getName())) {
it.remove();
sb.append(originalJavadocTag);
sb.append(EOL);
}
}
}
} else {
for (Iterator<String> it = javaEntityTags.getUnknownTags().iterator(); it.hasNext(); ) {
String originalJavadocTag = it.next();
String simplified = StringUtils.removeDuplicateWhitespace(originalJavadocTag).trim();
if (simplified.contains("@" + docletTag.getName())) {
it.remove();
sb.append(originalJavadocTag);
sb.append(EOL);
}
}
}
if (sb.toString().endsWith(EOL)) {
sb.delete(sb.toString().lastIndexOf(EOL), sb.toString().length());
}
sb.append(EOL);
}
}
Aggregations