use of com.redhat.ceylon.model.loader.mirror.TypeMirror in project ceylon-compiler by ceylon.
the class JavacClass method getInterfaces.
@Override
public List<TypeMirror> getInterfaces() {
if (interfaces == null) {
List<TypeMirror> ret = new ArrayList<TypeMirror>(classSymbol.getInterfaces().size());
for (Type interfce : classSymbol.getInterfaces()) ret.add(new JavacType(interfce));
interfaces = Collections.unmodifiableList(ret);
}
return interfaces;
}
use of com.redhat.ceylon.model.loader.mirror.TypeMirror in project ceylon-compiler by ceylon.
the class JavacTypeParameter method getBounds.
@Override
public List<TypeMirror> getBounds() {
if (bounds == null) {
com.sun.tools.javac.util.List<Type> bnds = typeSymbol.getBounds();
List<TypeMirror> ret = new ArrayList<TypeMirror>(bnds.size());
for (Type type : bnds) ret.add(new JavacType(type));
bounds = Collections.unmodifiableList(ret);
}
return bounds;
}
use of com.redhat.ceylon.model.loader.mirror.TypeMirror in project ceylon-compiler by ceylon.
the class AnnotationLoader method setPrimaryFromAnnotationInvocationAnnotation.
private void setPrimaryFromAnnotationInvocationAnnotation(AnnotationMirror annotationInvocationAnnotation, AnnotationInvocation ai) {
TypeMirror annotationType = (TypeMirror) annotationInvocationAnnotation.getValue(AbstractModelLoader.CEYLON_ANNOTATION_INSTANTIATION_ANNOTATION_MEMBER);
ClassMirror annotationClassMirror = annotationType.getDeclaredClass();
Module module = modelLoader.findModuleForClassMirror(annotationClassMirror);
if (annotationClassMirror.getAnnotation(AbstractModelLoader.CEYLON_METHOD_ANNOTATION) != null) {
ai.setPrimary((Function) modelLoader.convertToDeclaration(module, annotationClassMirror, DeclarationType.VALUE));
} else {
ai.setPrimary((Class) modelLoader.convertToDeclaration(module, annotationClassMirror, DeclarationType.TYPE));
}
}
use of com.redhat.ceylon.model.loader.mirror.TypeMirror in project ceylon-compiler by ceylon.
the class AnnotationLoader method readObjectValuesAnnotation.
private LiteralAnnotationTerm readObjectValuesAnnotation(Module moduleScope, AnnotationMirror valueAnnotation, boolean singleValue) {
if (singleValue) {
TypeMirror klass = getAnnotationClassValues(valueAnnotation, "value").get(0);
Type type = modelLoader.obtainType(moduleScope, klass, null, null, null);
ObjectLiteralAnnotationTerm term = new ObjectLiteralAnnotationTerm(type);
return term;
} else {
CollectionLiteralAnnotationTerm result = new CollectionLiteralAnnotationTerm(ObjectLiteralAnnotationTerm.FACTORY);
for (TypeMirror klass : getAnnotationClassValues(valueAnnotation, "value")) {
Type type = modelLoader.obtainType(moduleScope, klass, null, null, null);
result.addElement(new ObjectLiteralAnnotationTerm(type));
}
return result;
}
}
use of com.redhat.ceylon.model.loader.mirror.TypeMirror in project ceylon-compiler by ceylon.
the class JavacType method getTypeArguments.
@Override
public List<TypeMirror> getTypeArguments() {
if (typeArguments == null) {
List<TypeMirror> args = new ArrayList<TypeMirror>(type.getTypeArguments().size());
for (Type typeArg : type.getTypeArguments()) {
args.add(new JavacType(typeArg));
}
typeArguments = Collections.unmodifiableList(args);
}
return typeArguments;
}
Aggregations