use of org.eclipse.ceylon.compiler.java.codegen.AnnotationTerm in project ceylon by eclipse.
the class AnnotationLoader method loadAnnotationArgumentTerm.
private AnnotationTerm loadAnnotationArgumentTerm(List<AnnotationFieldName> path, LazyFunction method, AnnotationInvocation ai, Parameter parameter, List<AnnotationMirror> annotationTree, AnnotatedMirror dpm, short code) {
if (code < 0 && code != Short.MIN_VALUE) {
AnnotationMirror i = annotationTree.get(-code);
AnnotationInvocation nested = new AnnotationInvocation();
setPrimaryFromAnnotationInvocationAnnotation(i, nested);
loadAnnotationInvocationArguments(path, method, nested, i, annotationTree, dpm);
InvocationAnnotationTerm term = new InvocationAnnotationTerm();
term.setInstantiation(nested);
return term;
} else {
AnnotationTerm term = decode(ModelUtil.getModuleContainer(method), method.getFirstParameterList().getParameters(), ai, parameter, dpm, path, code);
return term;
}
}
use of org.eclipse.ceylon.compiler.java.codegen.AnnotationTerm in project ceylon by eclipse.
the class AnnotationLoader method decode.
private AnnotationTerm decode(Module moduleScope, List<Parameter> sourceParameters, AnnotationInvocation info, Parameter parameter, AnnotatedMirror dpm, List<AnnotationFieldName> path, int code) {
AnnotationTerm result;
if (code == Short.MIN_VALUE) {
return findLiteralAnnotationTerm(moduleScope, path, parameter, dpm);
} else if (code < 0) {
InvocationAnnotationTerm invocation = new InvocationAnnotationTerm();
result = invocation;
} else if (code >= 0 && code < 512) {
ParameterAnnotationTerm parameterArgument = new ParameterAnnotationTerm();
boolean spread = false;
if (code >= 256) {
spread = true;
code -= 256;
}
parameterArgument.setSpread(spread);
Parameter sourceParameter = sourceParameters.get(code);
parameterArgument.setSourceParameter(sourceParameter);
// result.setTargetParameter(sourceParameter);
result = parameterArgument;
} else {
throw new RuntimeException();
}
return result;
}
Aggregations