1 18 package org.apache.beehive.netui.compiler.typesystem.impl.declaration; 19 20 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeDeclaration; 21 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeElementDeclaration; 22 import org.apache.beehive.netui.compiler.typesystem.impl.WrapperFactory; 23 24 import java.util.Collection ; 25 import java.util.HashMap ; 26 27 public class AnnotationTypeDeclarationImpl 28 extends InterfaceDeclarationImpl 29 implements AnnotationTypeDeclaration 30 { 31 private AnnotationTypeElementDeclaration[] _members; 32 private HashMap < String , AnnotationTypeElementDeclaration > _membersByName = 33 new HashMap < String , AnnotationTypeElementDeclaration >(); 34 35 public AnnotationTypeDeclarationImpl( com.sun.mirror.declaration.AnnotationTypeDeclaration delegate ) 36 { 37 super( delegate ); 38 } 39 40 public AnnotationTypeElementDeclaration[] getAnnotationMembers() 41 { 42 if ( _members == null ) 43 { 44 Collection < com.sun.mirror.declaration.AnnotationTypeElementDeclaration > delegateCollection = 45 getDelegate().getMethods(); 46 AnnotationTypeElementDeclaration[] array = new AnnotationTypeElementDeclaration[ delegateCollection.size() ]; 47 int j = 0; 48 for ( com.sun.mirror.declaration.AnnotationTypeElementDeclaration i : delegateCollection ) 49 { 50 AnnotationTypeElementDeclaration decl = WrapperFactory.get().getAnnotationTypeElementDeclaration( i ); 51 array[ j++ ] = decl; 52 _membersByName.put( decl.getSimpleName(), decl ); 53 } 54 _members = array; 55 } 56 57 return _members; 58 } 59 60 public com.sun.mirror.declaration.AnnotationTypeDeclaration getDelegate() 61 { 62 return ( com.sun.mirror.declaration.AnnotationTypeDeclaration ) super.getDelegate(); 63 } 64 65 public AnnotationTypeElementDeclaration getMember( String name ) 66 { 67 return _membersByName.get( name ); 68 } 69 } 70 | Popular Tags |