Source code: org/alicebot/server/core/processor/SetProcessor.java
1 // Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov.
2 // Jad home page: http://www.geocities.com/kpdus/jad.html
3 // Decompiler options: packimports(3)
4
5 package org.alicebot.server.core.processor;
6
7 import org.alicebot.server.core.PredicateMaster;
8 import org.alicebot.server.core.parser.TemplateParser;
9 import org.alicebot.server.core.parser.XMLNode;
10 import org.alicebot.server.core.util.Toolkit;
11
12 // Referenced classes of package org.alicebot.server.core.processor:
13 // AIMLProcessor, AIMLProcessorException
14
15 public class SetProcessor extends AIMLProcessor
16 {
17
18 public SetProcessor()
19 {
20 }
21
22 public String process(int i, XMLNode xmlnode, TemplateParser templateparser)
23 throws AIMLProcessorException
24 {
25 if(xmlnode.XMLType == 0)
26 {
27 String s = Toolkit.getAttributeValue("name", xmlnode.XMLAttr);
28 if(s.equals(""))
29 throw new AIMLProcessorException("<set></set> must have a name attribute!");
30 else
31 return PredicateMaster.set(s, templateparser.evaluate(i++, xmlnode.XMLChild), templateparser.getUserID(), templateparser.getBotID());
32 } else
33 {
34 throw new AIMLProcessorException("<set></set> must have content!");
35 }
36 }
37
38 public static final String label = "set";
39 }