1 18 package org.apache.beehive.netui.pageflow; 19 20 import org.apache.struts.action.ActionMessage; 21 import org.apache.beehive.netui.pageflow.internal.InternalConstants; 22 import org.apache.beehive.netui.pageflow.internal.InternalExpressionUtils; 23 import org.apache.beehive.netui.pageflow.internal.InternalUtils; 24 import org.apache.beehive.netui.util.logging.Logger; 25 26 import javax.servlet.ServletContext ; 27 import javax.servlet.http.HttpServletRequest ; 28 29 34 public class ExpressionMessage 35 extends ActionMessage 36 { 37 45 public ExpressionMessage( String expression, Object [] messageArgExpressions ) 46 { 47 super( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + expression, prefixArgs( messageArgExpressions ) ); 48 } 49 50 56 public ExpressionMessage( String expression ) 57 { 58 this( expression, null ); 59 } 60 61 69 public ExpressionMessage( String expression, Object messageArgExpression ) 70 { 71 this( expression, new Object []{ messageArgExpression } ); 72 } 73 74 84 public ExpressionMessage( String expression, Object messageArgExpression1, Object messageArgExpression2 ) 85 { 86 this( expression, new Object []{ messageArgExpression1, messageArgExpression2 } ); 87 } 88 89 101 public ExpressionMessage( String expression, Object messageArgExpression1, Object messageArgExpression2, 102 Object messageArgExpression3 ) 103 { 104 this( expression, new Object []{ messageArgExpression1, messageArgExpression2, messageArgExpression3 } ); 105 } 106 107 private static Object [] prefixArgs( Object [] messageArgExpressions ) 108 { 109 if ( messageArgExpressions == null ) return null; 110 111 Object [] ret = new Object [ messageArgExpressions.length ]; 112 113 for ( int i = 0; i < messageArgExpressions.length; i++ ) 114 { 115 ret[i] = InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + messageArgExpressions[i]; 116 } 117 118 return ret; 119 } 120 } 121 | Popular Tags |