@Override public AnnotationVisitor visitParameterAnnotation(final int parameter, final String desc, final boolean visible) { JvmFormalParameter formalParameter = result.getParameters().get(parameter); return new JvmAnnotationReferenceBuilder( (InternalEList<JvmAnnotationReference>) formalParameter.getAnnotations(), desc, proxies); }
protected JvmFormalParameter createFormalParameter(Type parameterType, String paramName, JvmMember container, GenericDeclaration member, Annotation[] annotations) { JvmFormalParameter result = TypesFactory.eINSTANCE.createJvmFormalParameter(); result.setName(paramName); if (isLocal(parameterType, member)) { result.setParameterType(createLocalTypeReference(parameterType, (JvmTypeParameterDeclarator) container, member)); } else { result.setParameterType(createTypeReference(parameterType)); } if (annotations.length != 0) { InternalEList<JvmAnnotationReference> annotationsReferences = (InternalEList<JvmAnnotationReference>)result.getAnnotations(); for (Annotation annotation : annotations) { annotationsReferences.addUnique(createAnnotationReference(annotation)); } } return result; }
protected JvmFormalParameter createFormalParameter(Type parameterType, String paramName, JvmMember container, GenericDeclaration member, Annotation[] annotations) { JvmFormalParameter result = TypesFactory.eINSTANCE.createJvmFormalParameter(); result.setName(paramName); if (isLocal(parameterType, member)) { result.setParameterType(createLocalTypeReference(parameterType, (JvmTypeParameterDeclarator) container, member)); } else { result.setParameterType(createTypeReference(parameterType)); } if (annotations.length != 0) { InternalEList<JvmAnnotationReference> annotationsReferences = (InternalEList<JvmAnnotationReference>)result.getAnnotations(); for (Annotation annotation : annotations) { annotationsReferences.addUnique(createAnnotationReference(annotation)); } } return result; }
protected void translateParameter(JvmExecutable executable, XtendParameter parameter) { JvmFormalParameter jvmParam = typesFactory.createJvmFormalParameter(); jvmParam.setName(parameter.getName()); if (parameter.isVarArg()) { executable.setVarArgs(true); JvmGenericArrayTypeReference arrayType = typeReferences.createArrayType(jvmTypesBuilder .cloneWithProxies(parameter.getParameterType())); jvmParam.setParameterType(arrayType); } else { jvmParam.setParameterType(jvmTypesBuilder.cloneWithProxies(parameter.getParameterType())); } associator.associate(parameter, jvmParam); translateAnnotationsTo(parameter.getAnnotations(), jvmParam); if (parameter.isExtension() && typeReferences.findDeclaredType(Extension.class, parameter) != null) { jvmParam.getAnnotations().add(_annotationTypesBuilder.annotationRef(Extension.class)); } executable.getParameters().add(jvmParam); }
newParam.setParameterType(paramType); for (final JvmAnnotationReference annotationReference : parameter.getAnnotations()) { if (this.annotationUtils.findAnnotation(newParam, annotationReference.getAnnotation().getQualifiedName()) == null) { final JvmAnnotationReference annotation = EcoreUtil.copy(annotationReference); if (annotation != null) { newParam.getAnnotations().add(annotation); this.associator.removeAllAssociation(annotation);
public void generateParameter(final JvmFormalParameter it, final ITreeAppendable appendable, final boolean vararg, final GeneratorConfig config) { final ITreeAppendable tracedAppendable = appendable.trace(it); this.generateAnnotations(it.getAnnotations(), tracedAppendable, false, config); tracedAppendable.append("final "); if (vararg) { JvmTypeReference _parameterType = it.getParameterType(); boolean _not = (!(_parameterType instanceof JvmGenericArrayTypeReference)); if (_not) { tracedAppendable.append("/* Internal Error: Parameter was vararg but not an array type. */"); } else { JvmTypeReference _parameterType_1 = it.getParameterType(); this._errorSafeExtensions.serializeSafely(((JvmGenericArrayTypeReference) _parameterType_1).getComponentType(), "Object", tracedAppendable); } tracedAppendable.append("..."); } else { this._errorSafeExtensions.serializeSafely(it.getParameterType(), "Object", tracedAppendable); } tracedAppendable.append(" "); final String name = tracedAppendable.declareVariable(it, this.makeJavaIdentifier(it.getSimpleName())); this._treeAppendableUtil.traceSignificant(tracedAppendable, it).append(name); }