Java源码示例:org.eclipse.xtend.lib.macro.declaration.TypeDeclaration

示例1
@Override
public void doRegisterGlobals(final List<? extends TypeDeclaration> annotatedSourceElements, final RegisterGlobalsContext context) {
  for (final TypeDeclaration type : annotatedSourceElements) {
    {
      String _qualifiedName = type.getQualifiedName();
      String _plus = (_qualifiedName + ".NestedClass");
      context.registerClass(_plus);
      String _qualifiedName_1 = type.getQualifiedName();
      String _plus_1 = (_qualifiedName_1 + ".NestedInterface");
      context.registerInterface(_plus_1);
      String _qualifiedName_2 = type.getQualifiedName();
      String _plus_2 = (_qualifiedName_2 + ".NestedAnnotationType");
      context.registerAnnotationType(_plus_2);
      String _qualifiedName_3 = type.getQualifiedName();
      String _plus_3 = (_qualifiedName_3 + ".NestedEnumerationType");
      context.registerEnumerationType(_plus_3);
    }
  }
}
 
示例2
@Test
public void testAnnotation2() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("class MyClass {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("@com.google.inject.Inject() MyClass foo");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration sourceClazz = ((ClassDeclaration) _head);
    final MutableClassDeclaration javaClass = it.getTypeLookup().findClass("MyClass");
    Assert.assertEquals(javaClass.getQualifiedName(), sourceClazz.getQualifiedName());
    final FieldDeclaration field = IterableExtensions.head(sourceClazz.getDeclaredFields());
    Assert.assertEquals(Boolean.FALSE, IterableExtensions.head(field.getAnnotations()).getValue("optional"));
    final MutableFieldDeclaration javaField = IterableExtensions.head(javaClass.getDeclaredFields());
    Object _value = IterableExtensions.head(javaField.getAnnotations()).getValue("optional");
    Assert.assertFalse((((Boolean) _value)).booleanValue());
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例3
@Test
public void testNestedClass() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("package p");
  _builder.newLine();
  _builder.newLine();
  _builder.append("class Outer {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("static class Inner {}");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    Assert.assertEquals("p", it.getPackageName());
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration outer = ((ClassDeclaration) _head);
    Assert.assertEquals("p.Outer", outer.getQualifiedName());
    final ClassDeclaration inner = IterableExtensions.head(outer.getDeclaredClasses());
    Assert.assertEquals("Inner", inner.getSimpleName());
    Assert.assertEquals("p.Outer.Inner", inner.getQualifiedName());
    Assert.assertNotNull(it.getTypeLookup().findClass("p.Outer.Inner"));
    Assert.assertNotNull(it.getTypeLookup().findTypeGlobally("p.Outer.Inner"));
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例4
@Test
public void testRemove() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("class C {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("def void m() {}");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration c = ((ClassDeclaration) _head);
    final MutableClassDeclaration mutable = it.getTypeLookup().findClass(c.getQualifiedName());
    final Consumer<MutableMemberDeclaration> _function_1 = (MutableMemberDeclaration it_1) -> {
      it_1.remove();
    };
    mutable.getDeclaredMembers().forEach(_function_1);
    Assert.assertTrue(IterableExtensions.isEmpty(mutable.getDeclaredMembers()));
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例5
@Override
public AnnotationTypeDeclaration getAnnotationTypeDeclaration() {
  AnnotationTypeDeclaration _switchResult = null;
  JvmType _annotationType = this.getAnnotationType();
  final JvmType type = _annotationType;
  boolean _matched = false;
  if (type instanceof JvmAnnotationType) {
    _matched=true;
    TypeDeclaration _typeDeclaration = this.getCompilationUnit().toTypeDeclaration(((JvmDeclaredType)type));
    _switchResult = ((AnnotationTypeDeclaration) _typeDeclaration);
  }
  if (!_matched) {
    _switchResult = null;
  }
  return _switchResult;
}
 
示例6
public ResolvedConstructor getSuperConstructor(final TypeDeclaration it) {
  if ((it instanceof ClassDeclaration)) {
    if ((Objects.equal(((ClassDeclaration)it).getExtendedClass(), this.context.getObject()) || (((ClassDeclaration)it).getExtendedClass() == null))) {
      return null;
    }
    return IterableExtensions.head(((ClassDeclaration)it).getExtendedClass().getDeclaredResolvedConstructors());
  } else {
    return null;
  }
}
 
示例7
public Iterable<? extends MemberDeclaration> getDelegates(final TypeDeclaration it) {
  final Function1<MemberDeclaration, Boolean> _function = (MemberDeclaration it_1) -> {
    AnnotationReference _findAnnotation = it_1.findAnnotation(this.context.findTypeGlobally(Delegate.class));
    return Boolean.valueOf((_findAnnotation != null));
  };
  return IterableExtensions.filter(it.getDeclaredMembers(), _function);
}
 
示例8
@Test
public void testAnnotation() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("@SuppressWarnings(\"unused\")");
  _builder.newLine();
  _builder.append("class MyClass {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("@com.google.inject.Inject(optional=true) MyClass foo");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    Assert.assertNull(it.getPackageName());
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration clazz = ((ClassDeclaration) _head);
    Assert.assertEquals("MyClass", clazz.getQualifiedName());
    final AnnotationReference suppressWarning = IterableExtensions.head(clazz.getAnnotations());
    final AnnotationTypeDeclaration supressWarningsDeclaration = suppressWarning.getAnnotationTypeDeclaration();
    Assert.assertEquals("java.lang.SuppressWarnings", supressWarningsDeclaration.getQualifiedName());
    Assert.assertEquals("unused", suppressWarning.getStringArrayValue("value")[0]);
    Assert.assertEquals(2, IterableExtensions.size(supressWarningsDeclaration.getAnnotations()));
    final AnnotationTypeElementDeclaration valueProperty = IterableExtensions.<AnnotationTypeElementDeclaration>head(Iterables.<AnnotationTypeElementDeclaration>filter(supressWarningsDeclaration.getDeclaredMembers(), AnnotationTypeElementDeclaration.class));
    Assert.assertEquals("String[]", valueProperty.getType().toString());
    Assert.assertEquals("value", valueProperty.getSimpleName());
    MemberDeclaration _head_1 = IterableExtensions.head(clazz.getDeclaredMembers());
    final FieldDeclaration field = ((FieldDeclaration) _head_1);
    final AnnotationReference inject = IterableExtensions.head(field.getAnnotations());
    Object _value = inject.getValue("optional");
    Assert.assertTrue((((Boolean) _value)).booleanValue());
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例9
@Test
public void testSimpleClassWithField() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("package foo");
  _builder.newLine();
  _builder.newLine();
  _builder.append("class MyClass extends Object implements java.io.Serializable {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("MyClass foo");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    Assert.assertEquals("foo", it.getPackageName());
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration clazz = ((ClassDeclaration) _head);
    Assert.assertEquals("foo.MyClass", clazz.getQualifiedName());
    Assert.assertEquals("Object", clazz.getExtendedClass().toString());
    Assert.assertEquals("Serializable", IterableExtensions.head(clazz.getImplementedInterfaces()).toString());
    MemberDeclaration _head_1 = IterableExtensions.head(clazz.getDeclaredMembers());
    final FieldDeclaration field = ((FieldDeclaration) _head_1);
    Assert.assertEquals("foo", field.getSimpleName());
    Assert.assertSame(it.getTypeLookup().findClass("foo.MyClass"), field.getType().getType());
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例10
@Test
public void testOverriddenMethodFromSource() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("package p");
  _builder.newLine();
  _builder.newLine();
  _builder.append("abstract class C extends java.util.AbstractList<String> implements I {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("override add(String s);");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  _builder.append("interface I {");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("def boolean add(String s)");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    Assert.assertEquals("p", it.getPackageName());
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration clazz = ((ClassDeclaration) _head);
    Assert.assertEquals("p.C", clazz.getQualifiedName());
    final MethodDeclaration add = IterableExtensions.head(clazz.getDeclaredMethods());
    final Iterable<? extends MethodDeclaration> allOverridden = add.getOverriddenOrImplementedMethods();
    Assert.assertEquals(2, IterableExtensions.size(allOverridden));
    final MethodDeclaration listAdd = IterableExtensions.head(allOverridden);
    Assert.assertEquals("add", listAdd.getSimpleName());
    Assert.assertEquals("E", IterableExtensions.head(listAdd.getParameters()).getType().getSimpleName());
    final MethodDeclaration intfAdd = IterableExtensions.last(allOverridden);
    Assert.assertEquals("add", intfAdd.getSimpleName());
    Assert.assertEquals("String", IterableExtensions.head(intfAdd.getParameters()).getType().getSimpleName());
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例11
@Override
public Iterable<? extends TypeDeclaration> getSourceTypeDeclarations() {
  final Function1<XtendTypeDeclaration, XtendTypeDeclarationImpl<? extends XtendTypeDeclaration>> _function = (XtendTypeDeclaration it) -> {
    return this.toXtendTypeDeclaration(it);
  };
  return ListExtensions.<XtendTypeDeclaration, XtendTypeDeclarationImpl<? extends XtendTypeDeclaration>>map(this.xtendFile.getXtendTypes(), _function);
}
 
示例12
public TypeDeclaration findDeclaredType(final String name) {
  final Function1<TypeDeclaration, Boolean> _function = (TypeDeclaration type) -> {
    String _simpleName = type.getSimpleName();
    return Boolean.valueOf(Objects.equal(_simpleName, name));
  };
  return IterableExtensions.findFirst(this.getDeclaredTypes(), _function);
}
 
示例13
@Override
public TypeDeclaration findDeclaredType(final String name) {
  final Function1<TypeDeclaration, Boolean> _function = (TypeDeclaration type) -> {
    String _simpleName = type.getSimpleName();
    return Boolean.valueOf(Objects.equal(_simpleName, name));
  };
  return IterableExtensions.findFirst(this.getDeclaredTypes(), _function);
}
 
示例14
@Override
public TypeDeclaration getDeclaringType() {
  XtendTypeDeclarationImpl<? extends XtendTypeDeclaration> _switchResult = null;
  EObject _eContainer = this.getDelegate().eContainer();
  final EObject container = _eContainer;
  boolean _matched = false;
  if (container instanceof XtendTypeDeclaration) {
    _matched=true;
    _switchResult = this.getCompilationUnit().toXtendTypeDeclaration(((XtendTypeDeclaration)container));
  }
  if (!_matched) {
    _switchResult = null;
  }
  return _switchResult;
}
 
示例15
@Test
public void testXtendInterfaceWithDefaultMethod() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("package p");
  _builder.newLine();
  _builder.newLine();
  _builder.append("interface MyIntf {");
  _builder.newLine();
  _builder.append("\t");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("def String dflt() { \"\" }");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("def String abstrct()");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("def static String statc() { \"\" }");
  _builder.newLine();
  _builder.append("\t");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    Assert.assertEquals("p", it.getPackageName());
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final InterfaceDeclaration intf = ((InterfaceDeclaration) _head);
    Assert.assertEquals("p.MyIntf", intf.getQualifiedName());
    Assert.assertTrue(IterableExtensions.isEmpty(intf.getExtendedInterfaces()));
    Assert.assertEquals(3, IterableExtensions.size(intf.getDeclaredMembers()));
    final MethodDeclaration dflt = IterableExtensions.head(intf.getDeclaredMethods());
    Assert.assertTrue(dflt.isDefault());
    Assert.assertFalse(dflt.isAbstract());
    final MethodDeclaration abstract_ = ((MethodDeclaration[])Conversions.unwrapArray(intf.getDeclaredMethods(), MethodDeclaration.class))[1];
    Assert.assertFalse(abstract_.isDefault());
    Assert.assertTrue(abstract_.isAbstract());
    final MethodDeclaration static_ = ((MethodDeclaration[])Conversions.unwrapArray(intf.getDeclaredMethods(), MethodDeclaration.class))[2];
    Assert.assertFalse(static_.isDefault());
    Assert.assertFalse(static_.isAbstract());
    Assert.assertTrue(static_.isStatic());
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例16
public void doRegisterGlobals(final TypeDeclaration decl, @Extension final RegisterGlobalsContext context) {
  AnnotationWithNestedAnnotationsProcessor.readConfig(decl);
}
 
示例17
@Test
public void testXtendClassWithMethodFieldAndConstructor() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("package foo");
  _builder.newLine();
  _builder.newLine();
  _builder.append("class MyClass<T extends CharSequence> {");
  _builder.newLine();
  _builder.append("\t");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("String myField");
  _builder.newLine();
  _builder.append("\t");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("new(String initial) {");
  _builder.newLine();
  _builder.append("\t\t");
  _builder.append("this.myField = initial");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("}");
  _builder.newLine();
  _builder.append("\t");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("def <T2 extends CharSequence> MyClass myMethod(T2 a, T b) {");
  _builder.newLine();
  _builder.append("\t\t");
  _builder.append("myField = myField + a + b");
  _builder.newLine();
  _builder.append("\t\t");
  _builder.append("return this");
  _builder.newLine();
  _builder.append("\t");
  _builder.append("}");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    Assert.assertEquals("foo", it.getPackageName());
    TypeDeclaration _head = IterableExtensions.head(it.getSourceTypeDeclarations());
    final ClassDeclaration clazz = ((ClassDeclaration) _head);
    final MutableClassDeclaration genClazz = it.getTypeLookup().findClass("foo.MyClass");
    Assert.assertEquals("foo.MyClass", clazz.getQualifiedName());
    Assert.assertNull(clazz.getExtendedClass());
    Assert.assertTrue(IterableExtensions.isEmpty(clazz.getImplementedInterfaces()));
    Assert.assertEquals(3, IterableExtensions.size(clazz.getDeclaredMembers()));
    Assert.assertEquals("T", IterableExtensions.head(clazz.getTypeParameters()).getSimpleName());
    Assert.assertEquals("CharSequence", IterableExtensions.head(IterableExtensions.head(clazz.getTypeParameters()).getUpperBounds()).toString());
    Assert.assertSame(clazz, IterableExtensions.head(clazz.getTypeParameters()).getTypeParameterDeclarator());
    final FieldDeclaration field = IterableExtensions.head(clazz.getDeclaredFields());
    Assert.assertSame(clazz, field.getDeclaringType());
    Assert.assertEquals("myField", field.getSimpleName());
    Assert.assertEquals("String", field.getType().toString());
    Assert.assertFalse(field.isFinal());
    final ConstructorDeclaration constructor = IterableExtensions.head(clazz.getDeclaredConstructors());
    Assert.assertSame(clazz, constructor.getDeclaringType());
    Assert.assertEquals("MyClass", constructor.getSimpleName());
    Assert.assertEquals("initial", IterableExtensions.head(constructor.getParameters()).getSimpleName());
    Assert.assertEquals("String", IterableExtensions.head(constructor.getParameters()).getType().toString());
    final MethodDeclaration method = IterableExtensions.head(clazz.getDeclaredMethods());
    final MutableMethodDeclaration genMethod = IterableExtensions.head(genClazz.getDeclaredMethods());
    Assert.assertSame(clazz, method.getDeclaringType());
    Assert.assertEquals("a", IterableExtensions.head(method.getParameters()).getSimpleName());
    Assert.assertEquals("T2", IterableExtensions.head(method.getParameters()).getType().toString());
    Assert.assertSame(IterableExtensions.head(genMethod.getTypeParameters()), IterableExtensions.head(method.getParameters()).getType().getType());
    Assert.assertEquals("T", (((ParameterDeclaration[])Conversions.unwrapArray(method.getParameters(), ParameterDeclaration.class))[1]).getType().toString());
    Assert.assertSame(IterableExtensions.head(genClazz.getTypeParameters()), (((ParameterDeclaration[])Conversions.unwrapArray(method.getParameters(), ParameterDeclaration.class))[1]).getType().getType());
    Assert.assertSame(genClazz, method.getReturnType().getType());
    Assert.assertEquals("T2", IterableExtensions.head(method.getTypeParameters()).getSimpleName());
    Assert.assertEquals("CharSequence", IterableExtensions.head(IterableExtensions.head(method.getTypeParameters()).getUpperBounds()).toString());
    Assert.assertSame(IterableExtensions.head(method.getTypeParameters()), IterableExtensions.head(method.getTypeParameters()));
    Assert.assertSame(method, IterableExtensions.head(method.getTypeParameters()).getTypeParameterDeclarator());
    Assert.assertSame(field, ((Object[])Conversions.unwrapArray(clazz.getDeclaredMembers(), Object.class))[0]);
    Assert.assertSame(constructor, ((Object[])Conversions.unwrapArray(clazz.getDeclaredMembers(), Object.class))[1]);
    Assert.assertSame(method, ((Object[])Conversions.unwrapArray(clazz.getDeclaredMembers(), Object.class))[2]);
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例18
@Test
public void testIsAssignable() {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("package foo");
  _builder.newLine();
  _builder.newLine();
  _builder.append("class BaseClass implements InterfaceA {");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  _builder.append("class SubType extends BaseClass implements InterfaceA {");
  _builder.newLine();
  _builder.append("}");
  _builder.newLine();
  _builder.append("interface InterfaceA {}");
  _builder.newLine();
  _builder.append("interface InterfaceB {}");
  _builder.newLine();
  final Procedure1<CompilationUnitImpl> _function = (CompilationUnitImpl it) -> {
    TypeDeclaration _get = ((TypeDeclaration[])Conversions.unwrapArray(it.getSourceTypeDeclarations(), TypeDeclaration.class))[0];
    final ClassDeclaration baseClass = ((ClassDeclaration) _get);
    final MutableClassDeclaration subClass = it.getTypeLookup().findClass("foo.SubType");
    TypeDeclaration _get_1 = ((TypeDeclaration[])Conversions.unwrapArray(it.getSourceTypeDeclarations(), TypeDeclaration.class))[2];
    final InterfaceDeclaration interfaceA = ((InterfaceDeclaration) _get_1);
    TypeDeclaration _get_2 = ((TypeDeclaration[])Conversions.unwrapArray(it.getSourceTypeDeclarations(), TypeDeclaration.class))[3];
    final InterfaceDeclaration interfaceB = ((InterfaceDeclaration) _get_2);
    final Type object = it.getTypeReferenceProvider().getObject().getType();
    Assert.assertTrue(object.isAssignableFrom(baseClass));
    Assert.assertTrue(object.isAssignableFrom(subClass));
    Assert.assertTrue(object.isAssignableFrom(interfaceA));
    Assert.assertTrue(object.isAssignableFrom(interfaceB));
    Assert.assertTrue(baseClass.isAssignableFrom(baseClass));
    Assert.assertTrue(baseClass.isAssignableFrom(subClass));
    Assert.assertFalse(baseClass.isAssignableFrom(interfaceB));
    Assert.assertFalse(baseClass.isAssignableFrom(interfaceA));
    Assert.assertFalse(baseClass.isAssignableFrom(object));
    Assert.assertTrue(interfaceA.isAssignableFrom(baseClass));
    Assert.assertTrue(interfaceA.isAssignableFrom(subClass));
    Assert.assertTrue(interfaceA.isAssignableFrom(interfaceA));
    Assert.assertFalse(interfaceA.isAssignableFrom(interfaceB));
    Assert.assertFalse(interfaceA.isAssignableFrom(object));
  };
  this.asCompilationUnit(this.validFile(_builder), _function);
}
 
示例19
@Override
public MutableTypeDeclaration getDeclaringType() {
  TypeDeclaration _declaringType = super.getDeclaringType();
  return ((MutableTypeDeclaration) _declaringType);
}
 
示例20
@Override
public MutableTypeDeclaration findDeclaredType(final String name) {
  TypeDeclaration _findDeclaredType = super.findDeclaredType(name);
  return ((MutableTypeDeclaration) _findDeclaredType);
}
 
示例21
@Override
public Iterable<? extends MutableTypeDeclaration> getDeclaredTypes() {
  Iterable<? extends TypeDeclaration> _declaredTypes = super.getDeclaredTypes();
  return ((Iterable<? extends MutableTypeDeclaration>) _declaredTypes);
}
 
示例22
@Override
public MutableTypeDeclaration getDeclaringType() {
  TypeDeclaration _declaringType = super.getDeclaringType();
  return ((MutableTypeDeclaration) _declaringType);
}
 
示例23
@Override
public TypeDeclaration getDeclaringType() {
  return this.getCompilationUnit().toTypeDeclaration(this.getDelegate().getDeclaringType());
}
 
示例24
@Override
public AnnotationTypeDeclaration getAnnotationTypeDeclaration() {
  TypeDeclaration _typeDeclaration = this.getCompilationUnit().toTypeDeclaration(this.getDelegate().getAnnotation());
  return ((AnnotationTypeDeclaration) _typeDeclaration);
}
 
示例25
@Override
public MutableTypeDeclaration findDeclaredType(final String name) {
  TypeDeclaration _findDeclaredType = super.findDeclaredType(name);
  return ((MutableTypeDeclaration) _findDeclaredType);
}
 
示例26
@Override
public Iterable<? extends MutableTypeDeclaration> getDeclaredTypes() {
  Iterable<? extends TypeDeclaration> _declaredTypes = super.getDeclaredTypes();
  return ((Iterable<? extends MutableTypeDeclaration>) _declaredTypes);
}
 
示例27
@Override
public MutableTypeDeclaration getDeclaringType() {
  TypeDeclaration _declaringType = super.getDeclaringType();
  return ((MutableTypeDeclaration) _declaringType);
}
 
示例28
public Iterable<? extends TypeDeclaration> getDeclaredTypes() {
  return Iterables.<TypeDeclaration>filter(this.getDeclaredMembers(), TypeDeclaration.class);
}
 
示例29
@Override
public EnumerationTypeDeclaration getDeclaringType() {
  TypeDeclaration _declaringType = super.getDeclaringType();
  return ((EnumerationTypeDeclaration) _declaringType);
}
 
示例30
@Override
public ClassDeclaration getDeclaringType() {
  TypeDeclaration _declaringType = super.getDeclaringType();
  return ((ClassDeclaration) _declaringType);
}