use of org.eclipse.xtext.common.types.util.TypeReferences in project xtext-xtend by eclipse.
the class GetSuperTypeBenchmark method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
typeReference = getTypeReference(type);
TypeReferences typeReferences = typeReference.getOwner().getServices().getTypeReferences();
abstractCollection = typeReferences.findDeclaredType(AbstractCollection.class, typeReference.getType());
abstractList = typeReferences.findDeclaredType(AbstractList.class, typeReference.getType());
collection = typeReferences.findDeclaredType(Collection.class, typeReference.getType());
iterable = typeReferences.findDeclaredType(Iterable.class, typeReference.getType());
list = typeReferences.findDeclaredType(List.class, typeReference.getType());
object = typeReferences.findDeclaredType(Object.class, typeReference.getType());
set = typeReferences.findDeclaredType(Set.class, typeReference.getType());
stringBuilder = typeReferences.findDeclaredType(StringBuilder.class, typeReference.getType());
EcoreUtil.resolveAll(typeReference.getOwner().getContextResourceSet());
}
use of org.eclipse.xtext.common.types.util.TypeReferences in project xtext-xtend by eclipse.
the class XtendValidator method checkClassPath.
@Check
public void checkClassPath(XtendFile xtendFile) {
TypeReferences typeReferences = getServices().getTypeReferences();
final JvmGenericType listType = (JvmGenericType) typeReferences.findDeclaredType(List.class, xtendFile);
if (listType == null || listType.getTypeParameters().isEmpty()) {
error("Couldn't find a JDK 1.5 or higher on the project's classpath.", xtendFile, XTEND_FILE__PACKAGE, IssueCodes.JDK_NOT_ON_CLASSPATH);
} else if (typeReferences.findDeclaredType(ToStringBuilder.class, xtendFile) == null) {
error("Couldn't find the mandatory library 'org.eclipse.xtext.xbase.lib' 2.8.0 or higher on the project's classpath.", xtendFile, XTEND_FILE__PACKAGE, IssueCodes.XBASE_LIB_NOT_ON_CLASSPATH);
}
}
Aggregations