Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d9750417891e0e81ee81aa9167c67262a5adb445 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*******************************************************************************
 * Copyright (c) 2005, 2013 BEA Systems, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    tyeung@bea.com - initial API and implementation
 *******************************************************************************/

package org.eclipse.jdt.apt.core.internal.declaration; 

import com.sun.mirror.declaration.AnnotationTypeDeclaration;
import com.sun.mirror.declaration.AnnotationTypeElementDeclaration;
import com.sun.mirror.type.AnnotationType;
import com.sun.mirror.util.DeclarationVisitor;
import com.sun.mirror.util.TypeVisitor;
import java.util.Collection;

import org.eclipse.jdt.apt.core.internal.env.BaseProcessorEnv;
import org.eclipse.jdt.core.dom.ITypeBinding;

public class AnnotationDeclarationImpl extends InterfaceDeclarationImpl implements AnnotationTypeDeclaration, AnnotationType
{    
    public AnnotationDeclarationImpl(final ITypeBinding binding, final BaseProcessorEnv env)
    {
        super(binding, env);
        assert binding.isAnnotation() : "binding does not represent a annotation "; //$NON-NLS-1$
    }

    @Override
	public void accept(DeclarationVisitor visitor)
    {
        visitor.visitAnnotationTypeDeclaration(this);
    }

    @Override
	@SuppressWarnings("unchecked") // _getMethods() return type is too broadly specified
	public Collection<AnnotationTypeElementDeclaration> getMethods()
    {
        return (Collection<AnnotationTypeElementDeclaration>)_getMethods();
    }

    // start of implementation of AnnotationType API
    @Override
	public void accept(TypeVisitor visitor)
    {
        visitor.visitAnnotationType(this);
    }

    @Override
	public AnnotationTypeDeclaration getDeclaration()
    {
        return (AnnotationTypeDeclaration)super.getDeclaration();
    }
    // end of implementation of AnnotationType API

    @Override
	public MirrorKind kind(){ return MirrorKind.TYPE_ANNOTATION; }
}

Back to the top