use of org.eclipse.ceylon.compiler.java.codegen.AnnotationConstructorParameter in project ceylon by eclipse.
the class AnnotationLoader method makeInterorAnnotationConstructorInvocation.
public void makeInterorAnnotationConstructorInvocation(AnnotationProxyMethod ctor, AnnotationProxyClass klass, java.util.List<Parameter> ctorParams) {
AnnotationInvocation ai = new AnnotationInvocation();
ai.setConstructorDeclaration(ctor);
ai.setPrimary(klass);
ai.setInterop(true);
ctor.setAnnotationConstructor(ai);
java.util.List<AnnotationArgument> annotationArgs = new ArrayList<AnnotationArgument>();
for (Parameter ctorParam : ctorParams) {
boolean isValue = ctorParam.getName().equals("value");
ParameterAnnotationTerm term = new ParameterAnnotationTerm();
AnnotationArgument argument = new AnnotationArgument();
argument.setTerm(term);
argument.setParameter(klass.getParameter(ctorParam.getName()));
term.setSourceParameter(ctorParam);
AnnotationConstructorParameter acp = new AnnotationConstructorParameter();
acp.setParameter(ctorParam);
if (isValue)
ai.addConstructorParameter(0, acp);
else
ai.addConstructorParameter(acp);
annotationArgs.add(argument);
}
ai.getAnnotationArguments().addAll(annotationArgs);
}
use of org.eclipse.ceylon.compiler.java.codegen.AnnotationConstructorParameter in project ceylon by eclipse.
the class AnnotationLoader method loadAnnotationConstructorDefaultedParameters.
private void loadAnnotationConstructorDefaultedParameters(LazyFunction method, MethodMirror meth, AnnotationInvocation ai) {
for (Parameter ctorParam : method.getFirstParameterList().getParameters()) {
AnnotationConstructorParameter acp = new AnnotationConstructorParameter();
acp.setParameter(ctorParam);
if (ctorParam.isDefaulted()) {
acp.setDefaultArgument(loadAnnotationConstructorDefaultedParameter(method, meth, ctorParam, acp));
}
ai.addConstructorParameter(acp);
}
}
Aggregations