1 4 package com.openedit.page; 5 6 import com.openedit.OpenEditRuntimeException; 7 import com.openedit.config.Configuration; 8 9 12 public class PageAction 13 { 14 protected String fieldActionName; 15 protected String fieldMethodName; 16 protected String fieldModuleName; 17 protected boolean fieldIncludesAll = false; 18 19 protected Configuration fieldConfig; 20 21 public PageAction() 22 { 23 } 24 25 public PageAction( String 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 getMethodName() 40 { 41 return fieldMethodName; 42 } 43 public void setMethodName( String 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 getModuleName() 57 { 58 return fieldModuleName; 59 } 60 public void setModuleName( String moduleName ) 61 { 62 fieldModuleName = moduleName; 63 } 64 public String getActionName() 65 { 66 return fieldActionName; 67 } 68 69 public String toString() 70 { 71 return getActionName(); 72 } 73 74 78 public String getChildValue(String 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 |