1 package org.apache.beehive.controls.runtime.generator; 2 19 20 import com.sun.mirror.declaration.MethodDeclaration; 21 import com.sun.mirror.type.VoidType; 22 23 import org.apache.beehive.controls.runtime.generator.apt.TwoPhaseAnnotationProcessor; 24 25 29 public class AptEvent extends AptMethod 30 { 31 36 public AptEvent(AptEventSet eventSet, MethodDeclaration eventDecl, TwoPhaseAnnotationProcessor ap) 37 { 38 super(eventDecl, ap); 39 _eventSet = eventSet; 40 _eventDecl = eventDecl; 41 42 if (!eventSet.isUnicast() && !(eventDecl.getReturnType() instanceof VoidType)) 48 { 49 ap.printError( eventDecl, "eventset.illegal.multicast" ); 50 } 51 } 52 53 56 public String getMethodField() 57 { 58 StringBuffer sb = new StringBuffer (); 63 sb.append("_"); 64 sb.append(_eventSet.getShortName()); 65 sb.append("_"); 66 sb.append(getName()); 67 int methodIndex = getIndex(); 68 if (methodIndex != -1) 69 sb.append(methodIndex); 70 sb.append("Event"); 71 return sb.toString(); 72 } 73 74 77 public AptEventSet getEventSet() { return _eventSet; } 78 79 MethodDeclaration _eventDecl; 80 private AptEventSet _eventSet; 81 } 82 | Popular Tags |