1 package org.apache.beehive.controls.runtime.generator; 2 3 20 21 import com.sun.mirror.declaration.FieldDeclaration; 22 import com.sun.mirror.type.InterfaceType; 23 import com.sun.mirror.type.TypeMirror; 24 import org.apache.beehive.controls.runtime.generator.apt.TwoPhaseAnnotationProcessor; 25 26 30 public class AptContextField extends AptEventField 31 { 32 36 public AptContextField(AptControlImplementation controlImpl, FieldDeclaration fieldDecl, 37 TwoPhaseAnnotationProcessor ap) 38 { 39 super(fieldDecl); 40 _controlImpl = controlImpl; 41 _ap = ap; 42 }; 43 44 48 protected AptControlInterface initControlInterface() 49 { 50 TypeMirror fieldType = _fieldDecl.getType(); 51 if (! (fieldType instanceof InterfaceType)) 52 { 53 _ap.printError( _fieldDecl, "context.field.badinterface" ); 54 return null; 55 } 56 57 return new AptControlInterface(((InterfaceType)_fieldDecl.getType()).getDeclaration(), 62 _ap); 63 } 64 65 private AptControlImplementation _controlImpl; 66 private TwoPhaseAnnotationProcessor _ap; 67 } 68 | Popular Tags |