![JAR search and dependency download from the Maven repository](/logo.png)
com.github.vsspt.xjc.serializable.PluginImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaxb-ri-xjc Show documentation
Show all versions of jaxb-ri-xjc Show documentation
Generates toString, setter, equals and hashCode methods on JAXB generated classes.
package com.github.vsspt.xjc.serializable;
import java.io.Serializable;
import java.util.List;
import com.github.vsspt.xjc.AbstractVssPluginImpl;
import com.github.vsspt.xjc.model.ClassRepresentation;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JFieldVar;
public class PluginImpl extends AbstractVssPluginImpl {
private static final String OPTION_NAME = "XvsSerializable";
private static final String USAGE = "XvsSerializable : inject Serializable";
private static final String VALUE = "value";
private static final String SERIAL = "serial";
@Override
public String getOptionName() {
return OPTION_NAME;
}
@Override
public String getUsage() {
return USAGE;
}
@Override
protected String getAnnotationName() {
return null;
}
@Override
protected boolean checkAnnotationsFields() {
return false;
}
@Override
protected void generateMethod(final ClassRepresentation clazz, final List excludeFields, final boolean hasSuperClassFields) {
final JDefinedClass implClass = clazz.getClassOutline().implClass;
implClass._implements(Serializable.class);
implClass.annotate(SuppressWarnings.class).param(VALUE, SERIAL);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy