fr.pinguet62.jxb.javadoc.JavadocRemplacementStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaxb-xjc-javadoc Show documentation
Show all versions of jaxb-xjc-javadoc Show documentation
Automatically adding XSD javadoc to generated JAXB classes
package fr.pinguet62.jxb.javadoc;
import com.sun.codemodel.JDocComment;
public enum JavadocRemplacementStrategy {
/** @see String#trim() */
APPEND_BEGIN {
@Override
public void apply(JDocComment javadoc, String documentation) {
javadoc.append(documentation);
}
@Override
public String getMavenOption() {
return "appendBegin";
}
},
REPLACE {
@Override
public void apply(JDocComment javadoc, String documentation) {
javadoc.clear();
javadoc.append(documentation);
}
@Override
public String getMavenOption() {
return "replace";
}
};
public static JavadocRemplacementStrategy determineStrategy(String mavenOption) {
for (JavadocRemplacementStrategy strategy : values())
if (strategy.getMavenOption().equals(mavenOption))
return strategy;
throw new UnsupportedOperationException("Invalid strategy: " + mavenOption);
}
/**
* Apply the javadoc on element.
*
* @param javadoc The {@link JDocComment} to modify.
* @param documentation The javadoc of component (class, field, method, ...).
*/
public abstract void apply(JDocComment javadoc, String documentation);
public abstract String getMavenOption();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy