Search in sources :

Example 81 with JvmConstructor

use of org.eclipse.xtext.common.types.JvmConstructor in project xtext-eclipse by eclipse.

the class AbstractTypeProviderTest method test_nestedInterface_Outer_Inner_02.

@Test
public void test_nestedInterface_Outer_Inner_02() {
    String typeName = NestedInterfaces.class.getName() + "$Outer$Inner";
    JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
    List<JvmConstructor> constructors = Lists.newArrayList(type.getDeclaredConstructors());
    assertEquals(0, constructors.size());
    assertEquals(JvmVisibility.PUBLIC, type.getVisibility());
    assertTrue(type.isStatic());
    assertTrue(type.isAbstract());
}
Also used : NestedInterfaces(org.eclipse.xtext.common.types.testSetups.NestedInterfaces) JvmGenericType(org.eclipse.xtext.common.types.JvmGenericType) JvmConstructor(org.eclipse.xtext.common.types.JvmConstructor) Test(org.junit.Test)

Example 82 with JvmConstructor

use of org.eclipse.xtext.common.types.JvmConstructor in project xtext-eclipse by eclipse.

the class JdtBasedTypeFactory method createConstructor.

/**
 * @since 2.4
 */
protected JvmConstructor createConstructor(StringBuilder qualifiedName, String handleIdentifier, String[] path, IMethodBinding method) {
    JvmConstructor result = TypesFactory.eINSTANCE.createJvmConstructor();
    enhanceGenericDeclaration(result, method.getTypeParameters());
    enhanceExecutable(qualifiedName, handleIdentifier, path, result, method);
    createAnnotationValues(method, result);
    return result;
}
Also used : JvmConstructor(org.eclipse.xtext.common.types.JvmConstructor)

Aggregations

JvmConstructor (org.eclipse.xtext.common.types.JvmConstructor)82 Test (org.junit.Test)42 JvmGenericType (org.eclipse.xtext.common.types.JvmGenericType)33 JvmDeclaredType (org.eclipse.xtext.common.types.JvmDeclaredType)18 JvmMember (org.eclipse.xtext.common.types.JvmMember)17 XtendClass (org.eclipse.xtend.core.xtend.XtendClass)16 EObject (org.eclipse.emf.ecore.EObject)15 JvmOperation (org.eclipse.xtext.common.types.JvmOperation)15 JvmFormalParameter (org.eclipse.xtext.common.types.JvmFormalParameter)9 JvmTypeReference (org.eclipse.xtext.common.types.JvmTypeReference)9 TestAnnotation (org.eclipse.xtext.common.types.testSetups.TestAnnotation)9 XtendFile (org.eclipse.xtend.core.xtend.XtendFile)8 XtendFunction (org.eclipse.xtend.core.xtend.XtendFunction)7 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)6 JvmField (org.eclipse.xtext.common.types.JvmField)6 XConstructorCall (org.eclipse.xtext.xbase.XConstructorCall)6 Predicate (com.google.common.base.Predicate)5 JvmAnnotationTarget (org.eclipse.xtext.common.types.JvmAnnotationTarget)5 JvmAnnotationType (org.eclipse.xtext.common.types.JvmAnnotationType)5 JvmEnumerationType (org.eclipse.xtext.common.types.JvmEnumerationType)5