1 18 package org.apache.beehive.netui.compiler.xdoclet.typesystem.impl.declaration; 19 20 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationInstance; 21 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeElementDeclaration; 22 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationValue; 23 import org.apache.beehive.netui.compiler.typesystem.declaration.Modifier; 24 import org.apache.beehive.netui.compiler.typesystem.declaration.ParameterDeclaration; 25 import org.apache.beehive.netui.compiler.typesystem.declaration.TypeDeclaration; 26 import org.apache.beehive.netui.compiler.typesystem.type.TypeInstance; 27 import org.apache.beehive.netui.compiler.typesystem.util.SourcePosition; 28 import org.apache.beehive.netui.xdoclet.XDocletCompilerUtils; 29 30 import java.util.Set ; 31 import java.util.HashSet ; 32 33 public class AnnotationTypeElementDeclarationImpl 34 implements AnnotationTypeElementDeclaration 35 { 36 private String _name; 37 private TypeInstance _type; 38 private String _typeName; 39 private AnnotationValue _defaultVal; 40 private HashSet _validValues; 41 42 public AnnotationTypeElementDeclarationImpl( String name, String typeName, Object defaultVal, HashSet validValues ) 43 { 44 _name = name; 45 _typeName = typeName; 46 if ( defaultVal != null ) _defaultVal = new AnnotationValueImpl( defaultVal, null, this ); 47 _validValues = validValues; 48 } 49 50 public boolean isValidValue( Object value ) 51 { 52 return _validValues == null || _validValues.contains( value ); 53 } 54 55 public Set getValidValues() 56 { 57 return _validValues; 58 } 59 60 public AnnotationValue getDefaultValue() 61 { 62 return _defaultVal; 63 } 64 65 public TypeInstance getReturnType() 66 { 67 if ( _typeName != null ) 68 { 69 _type = XDocletCompilerUtils.resolveType( _typeName, false, null ); 70 assert _type != null : "unresolvable type " + _typeName; 71 _typeName = null; 72 } 73 74 return _type; 75 } 76 77 public ParameterDeclaration[] getParameters() 78 { 79 assert false : "NYI"; 80 throw new UnsupportedOperationException ( "NYI" ); 81 } 82 83 public TypeDeclaration getDeclaringType() 84 { 85 assert false : "NYI"; 86 throw new UnsupportedOperationException ( "NYI" ); 87 } 88 89 public AnnotationInstance[] getAnnotationInstances() 90 { 91 assert false : "NYI"; 92 throw new UnsupportedOperationException ( "NYI" ); 93 } 94 95 public Set getModifiers() 96 { 97 assert false : "NYI"; 98 throw new UnsupportedOperationException ( "NYI" ); 99 } 100 101 public String getSimpleName() 102 { 103 return _name; 104 } 105 106 public SourcePosition getPosition() 107 { 108 assert false : "NYI"; 109 throw new UnsupportedOperationException ( "NYI" ); 110 } 111 112 public boolean hasModifier( Modifier modifier ) 113 { 114 assert false : "NYI"; 115 throw new UnsupportedOperationException ( "NYI" ); 116 } 117 } 118 | Popular Tags |