KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > page > PageAction


1 /*
2  * Created on Dec 6, 2004
3  */

4 package com.openedit.page;
5
6 import com.openedit.OpenEditRuntimeException;
7 import com.openedit.config.Configuration;
8
9 /**
10  * Basic store for an action
11  */

12 public class PageAction
13 {
14     protected String JavaDoc fieldActionName;
15     protected String JavaDoc fieldMethodName;
16     protected String JavaDoc fieldModuleName;
17     protected boolean fieldIncludesAll = false;
18     
19     protected Configuration fieldConfig;
20     
21     public PageAction()
22     {
23     }
24     
25     public PageAction( String JavaDoc inActionName )
26     {
27         fieldActionName = inActionName;
28         int dotIndex = getActionName().indexOf('.');
29         
30         if (dotIndex == -1)
31         {
32             throw new OpenEditRuntimeException("Page action " + getActionName() + " not found, check format, e.g. \"ModuleName.method\" ");
33         }
34     
35         fieldModuleName = getActionName().substring( 0, dotIndex );
36         fieldMethodName = getActionName().substring( dotIndex + 1 );
37     }
38
39     public String JavaDoc getMethodName()
40     {
41         return fieldMethodName;
42     }
43     public void setMethodName( String JavaDoc actionName )
44     {
45         fieldMethodName = actionName;
46     }
47     public Configuration getConfig()
48     {
49         return fieldConfig;
50     }
51     public void setConfig( Configuration element )
52     {
53         fieldConfig = element;
54     }
55     
56     public String JavaDoc getModuleName()
57     {
58         return fieldModuleName;
59     }
60     public void setModuleName( String JavaDoc moduleName )
61     {
62         fieldModuleName = moduleName;
63     }
64     public String JavaDoc getActionName()
65     {
66         return fieldActionName;
67     }
68
69     public String JavaDoc toString()
70     {
71         return getActionName();
72     }
73
74     /**
75      * @param inString
76      * @return
77      */

78     public String JavaDoc getChildValue(String JavaDoc inString)
79     {
80         if ( getConfig() == null)
81         {
82             return null;
83         }
84         return getConfig().getChildValue(inString);
85     }
86
87     public boolean isIncludesAll()
88     {
89         return fieldIncludesAll;
90     }
91
92     public void setIncludesAll(boolean inIncludesAll)
93     {
94         fieldIncludesAll = inIncludesAll;
95     }
96
97
98 }
99
Popular Tags