001package io.avaje.http.generator.core; 002 003import java.util.List; 004 005/** 006 * Adapter to specific platforms like Javalin and Helidon. 007 */ 008public interface PlatformAdapter { 009 010 /** 011 * Return true if this type is the platform specific request, response or context type. 012 * For example Javalin Context, Helidon ServerRequest or ServerResponse type). 013 */ 014 boolean isContextType(String rawType); 015 016 /** 017 * Return the platform specific parameter (request, response or context). 018 */ 019 String platformVariable(String rawType); 020 021 /** 022 * Return platform specific code to return the body content. 023 */ 024 String bodyAsClass(String shortType); 025 026 /** 027 * Return true if body is passed as a method parameter. 028 */ 029 boolean isBodyMethodParam(); 030 031 /** 032 * Return whitespace indent for setting parameter values. 033 */ 034 String indent(); 035 036 /** 037 * Handle controller level roles. 038 */ 039 void controllerRoles(List<String> roles, ControllerReader controller); 040 041 /** 042 * Handle method level roles. 043 */ 044 void methodRoles(List<String> roles, ControllerReader controller); 045 046 void writeReadParameter(Append writer, ParamType paramType, String paramName); 047 048 void writeReadParameter(Append writer, ParamType paramType, String paramName, String paramDefault); 049}