1 package example; 2 3 import com.caucho.util.L10N; 4 import java.util.logging.Logger ; 5 import java.util.logging.Level ; 6 7 import java.io.IOException ; 8 9 12 public class SetProphetCommand extends AbstractCommand { 13 static protected final Logger log = 14 Logger.getLogger(SetProphetCommand.class.getName()); 15 static final L10N L = new L10N(SetProphetCommand.class); 16 17 String _prophet = null; 18 19 public void init() 20 { 21 super.init(); 22 _prophet = null; 23 } 24 25 void parse(Parser p) 26 throws IOException 27 { 28 _prophet = p.parseToken(); 29 if (_prophet == null) 30 setError("Expecting prophet name"); 31 } 32 33 String act(Magic8Ball magic8ball) 34 { 35 magic8ball.setProphet(_prophet); 36 return "prophet set to `" + magic8ball.getProphet() + "'"; 37 } 38 39 } 40 41 | Popular Tags |