com.dchan.jaxb.CodeCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jxbv Show documentation
Show all versions of jxbv Show documentation
JAXB Visitor Plugin for JDK 10
package com.dchan.jaxb;
import com.sun.codemodel.JAnnotationUse;
import com.sun.codemodel.JClass;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JPackage;
import com.sun.tools.xjc.outline.ClassOutline;
import com.sun.tools.xjc.outline.Outline;
import javax.annotation.Generated;
import java.util.Set;
abstract class CodeCreator {
protected final JPackage jpackage;
protected final Outline outline;
private JDefinedClass output;
CodeCreator(Outline outline, JPackage jPackage) {
this.outline = outline;
this.jpackage = jPackage;
}
protected abstract void run(Set classes, Set directClasses);
JDefinedClass getOutput() {
return output;
}
void setOutput(JDefinedClass output) {
JAnnotationUse annotationUse = output.annotate(Generated.class);
annotationUse.param("value", "Generated by jaxb-visitor");
this.output = output;
}
protected JPackage getPackage() {
return jpackage;
}
protected Outline getOutline() {
return outline;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy