de.knightsoftnet.gwtp.spring.annotation.processor.BackofficeServiceCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gwtp-spring-integration-client Show documentation
Show all versions of gwtp-spring-integration-client Show documentation
Basics to bring GWTP and Spring together.
package de.knightsoftnet.gwtp.spring.annotation.processor;
import de.knightsoftnet.gwtp.spring.client.annotation.BackofficeClientGenerator;
import java.io.PrintWriter;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.Element;
/**
* Create JPA repository interface.
*/
public class BackofficeServiceCreator extends AbstractBackofficeCreator {
protected static final String CLASS_SUFFIX = "RestService";
public BackofficeServiceCreator() {
super(CLASS_SUFFIX);
}
@Override
protected void addAdditionalImports(final String serverPackage, final Element element,
final BackofficeClientGenerator annotationInterface,
final ProcessingEnvironment processingEnv) {
addImport(element.asType());
addImports(//
"de.knightsoftnet.mtwidgets.client.services.AdminService", //
"javax.ws.rs.Path");
}
@Override
protected void writeBody(final PrintWriter out, final String serverPackage, final Element element,
final BackofficeClientGenerator annotationInterface,
final ProcessingEnvironment processingEnv) {
final String entityName = getEntityNameOfElement(element);
out.print("@Path(\"");
out.print(annotationInterface.value());
out.println("\")");
out.print("public interface ");
out.print(entityName);
out.print(suffix);
out.print(" extends AdminService<");
out.print(entityName);
out.println("> {");
out.println("}");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy