protected void annotateParamsWithNotNull( @Nonnull JMethod method ) { for ( JVar param : method.listParams() ) { param.annotate( notNullAnnotationType ); } } }
@Override protected JVar paramObjects(ApiActionMetadata endpointMetadata, CodeModelHelper.JExtMethod generatableType) { JVar param = super.paramObjects(endpointMetadata, generatableType); param.annotate(RequestBody.class); return param; }
@Override protected JVar paramHttpHeaders(CodeModelHelper.JExtMethod generatableType) { JVar paramHttpHeaders = super.paramHttpHeaders(generatableType); paramHttpHeaders.annotate(RequestHeader.class); return paramHttpHeaders; }
private void addMinMaxConstraint(final AbstractParam parameter, final String name, final Class<? extends Annotation> clazz, final BigDecimal value, final JVar argumentVariable) { try { final long boundary = value.longValueExact(); argumentVariable.annotate(clazz).param( DEFAULT_ANNOTATION_PARAMETER, boundary); } catch (final ArithmeticException ae) { LOGGER.info("Non integer " + name + " constraint ignored for parameter: " + ToStringBuilder.reflectionToString(parameter, SHORT_PREFIX_STYLE)); } }
/** * Adds an annotation to this variable. * * @param clazz * The annotation class to annotate the field with */ public JAnnotationUse annotate(Class <? extends Annotation> clazz){ return annotate(type.owner().ref(clazz)); }
/** * Adds an annotation to this variable. * * @param clazz * The annotation class to annotate the field with */ public JAnnotationUse annotate(Class <? extends Annotation> clazz){ return annotate(type.owner().ref(clazz)); }
/** * Adds an annotation to this variable. * * @param clazz * The annotation class to annotate the field with */ public JAnnotationUse annotate(Class <? extends Annotation> clazz){ return annotate(type.owner().ref(clazz)); }
/** * Adds an annotation to this variable. * * @param clazz * The annotation class to annotate the field with */ public JAnnotationUse annotate(Class <? extends Annotation> clazz){ return annotate(type.owner().ref(clazz)); }
private void addMinMaxConstraint(final AbstractParam parameter, final String name, final Class<? extends Annotation> clazz, final BigDecimal value, final JVar argumentVariable) { try { final long boundary = value.longValueExact(); argumentVariable.annotate(clazz).param(DEFAULT_ANNOTATION_PARAMETER, boundary); } catch (final ArithmeticException ae) { LOGGER.info("Non integer " + name + " constraint ignored for parameter: " + ToStringBuilder.reflectionToString(parameter, SHORT_PREFIX_STYLE)); } }
/** * Adds an annotation to this variable. * * @param clazz * The annotation class to annotate the field with */ public JAnnotationUse annotate(Class <? extends Annotation> clazz){ return annotate(type.owner().ref(clazz)); }
protected void annotate(MessagePartInfo part, JVar jvar) { wpann = jvar.annotate(WebParam.class); wpann.param("name", part.getName().getLocalPart()); wpann.param("targetNamespace", part.getName().getNamespaceURI()); }
protected void annotateOutParam(MessagePartInfo part, JVar jvar) { JAnnotationUse wpann = jvar.annotate(WebParam.class); wpann.param("name", part.getName().getLocalPart()); wpann.param("targetNamespace", part.getName().getNamespaceURI()); wpann.param("mode", WebParam.Mode.OUT); }
protected void annotate(MessagePartInfo part, JVar jvar, Binding binding) { wpann = jvar.annotate(WebParam.class); wpann.param("name", part.getName().getLocalPart()); wpann.param("targetNamespace", part.getName().getNamespaceURI()); wpann.param("header", true); }
protected void annotateOutParam(MessagePartInfo part, JVar jvar, Binding binding) { JAnnotationUse wpann = jvar.annotate(WebParam.class); wpann.param("name", part.getName().getLocalPart()); wpann.param("targetNamespace", part.getName().getNamespaceURI()); wpann.param("mode", WebParam.Mode.OUT); wpann.param("header", true); }
protected void annotateParam(ParamInfo param ,JVar jvar){ wpann = jvar.annotate(WebParam.class); wpann.param("name", param.getName().getLocalPart()); wpann.param("targetNamespace", param.getName().getNamespaceURI()); if(param.isHeader()){ wpann.param("header", true); } if(param.isIn() && param.isOut()){ wpann.param("mode", WebParam.Mode.INOUT); }else if( param.isOut()){ wpann.param("mode", WebParam.Mode.OUT); } }
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; } }
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; } }
private void addAsyncResponseParameter(String asyncResourceTrait,final JMethod method,final JDocComment javadoc) throws Exception { final String argumentName = Names.buildVariableName(asyncResourceTrait); final JVar argumentVariable = method.param(types.getGeneratorClass("javax.ws.rs.container.AsyncResponse"), argumentName); argumentVariable.annotate(types.getGeneratorClass("javax.ws.rs.container.Suspended")); javadoc.addParam( argumentVariable.name()).add(asyncResourceTrait); }
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; } }
public boolean run( Outline outline, Options opt, ErrorHandler errorHandler ) { for( ClassOutline ci : outline.getClasses() ) { JDefinedClass impl = ci.implClass; if (ci.getSuperClass() == null) { JVar $loc = impl.field(JMod.PROTECTED, Locator.class, fieldName); $loc.annotate(XmlLocation.class); $loc.annotate(XmlTransient.class); impl._implements(Locatable.class); impl.method(JMod.PUBLIC, Locator.class, "sourceLocation").body()._return($loc); JMethod setter = impl.method(JMod.PUBLIC, Void.TYPE, "setSourceLocation"); JVar $newLoc = setter.param(Locator.class, "newLocator"); setter.body().assign($loc, $newLoc); } } return true; } }