From: Tim P <ti...@us...> - 2008-03-20 12:37:42
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29610/src/org/webmacro/directive Modified Files: CountDirective.java Log Message: Checkstyle: whitespace Index: CountDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/CountDirective.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CountDirective.java 28 Mar 2006 23:44:26 -0000 1.8 --- CountDirective.java 20 Mar 2008 12:37:38 -0000 1.9 *************** *** 35,44 **** /** * #count $i from 1 to 100 [step 1] ! * * @author Eric B. Ridge (eb...@tc...) * @since 1.1b1 */ ! public class CountDirective extends org.webmacro.directive.Directive { --- 35,47 ---- /** + * Syntax: + * <pre> * #count $i from 1 to 100 [step 1] ! * </pre> ! * * @author Eric B. Ridge (eb...@tc...) * @since 1.1b1 */ ! public class CountDirective extends Directive { *************** *** 52,68 **** private static final int COUNT_BODY = 8; ! private static final Directive.ArgDescriptor[] _args = new Directive.ArgDescriptor[]{ ! new Directive.LValueArg(COUNT_ITERATOR), ! new Directive.KeywordArg(COUNT_FROM_K, "from"), ! new Directive.RValueArg(COUNT_START), ! new Directive.KeywordArg(COUNT_TO_K, "to"), ! new Directive.RValueArg(COUNT_END), ! new Directive.OptionalGroup(2), ! new Directive.KeywordArg(COUNT_STEP_K, "step"), ! new Directive.RValueArg(COUNT_STEP), ! new Directive.BlockArg(COUNT_BODY), ! }; ! private static final DirectiveDescriptor _desc = new DirectiveDescriptor("count", null, _args, null); public static DirectiveDescriptor getDescriptor () --- 55,73 ---- private static final int COUNT_BODY = 8; ! private static final Directive.ArgDescriptor[] _args = ! new Directive.ArgDescriptor[]{ ! new Directive.LValueArg(COUNT_ITERATOR), ! new Directive.KeywordArg(COUNT_FROM_K, "from"), ! new Directive.RValueArg(COUNT_START), ! new Directive.KeywordArg(COUNT_TO_K, "to"), ! new Directive.RValueArg(COUNT_END), ! new Directive.OptionalGroup(2), ! new Directive.KeywordArg(COUNT_STEP_K, "step"), ! new Directive.RValueArg(COUNT_STEP), ! new Directive.BlockArg(COUNT_BODY), ! }; ! private static final DirectiveDescriptor _desc = ! new DirectiveDescriptor("count", null, _args, null); public static DirectiveDescriptor getDescriptor () *************** *** 79,83 **** private int _start, _end, _step = Integer.MAX_VALUE; ! public Object build (DirectiveBuilder builder, BuildContext bc) throws BuildException { try --- 84,89 ---- private int _start, _end, _step = Integer.MAX_VALUE; ! public Object build (DirectiveBuilder builder, BuildContext bc) ! throws BuildException { try *************** *** 94,98 **** _body = (Block) builder.getArg(COUNT_BODY, bc); ! // attempt to go ahead and force the start, end, and step values into primitive ints if (_objStart != null) { --- 100,105 ---- _body = (Block) builder.getArg(COUNT_BODY, bc); ! // attempt to go ahead and force the start, end, and step values ! // into primitive ints if (_objStart != null) { *************** *** 138,142 **** } ! public void write (FastWriter out, Context context) throws PropertyException, IOException { int start = _start, end = _end, step = _step; --- 145,150 ---- } ! public void write (FastWriter out, Context context) ! throws PropertyException, IOException { int start = _start, end = _end, step = _step; *************** *** 156,160 **** catch (Exception e) { ! out.write(context.getEvaluationExceptionHandler().expand(_iterator, context, e)); error = true; } --- 164,169 ---- catch (Exception e) { ! out.write(context.getEvaluationExceptionHandler() ! .expand(_iterator, context, e)); error = true; } *************** *** 163,167 **** { // Check if no step explicitly assigned, if so auto-detect it ! if (step == Integer.MAX_VALUE ) { step = (start > end) ? -1 : +1; --- 172,176 ---- { // Check if no step explicitly assigned, if so auto-detect it ! if (step == Integer.MAX_VALUE) { step = (start > end) ? -1 : +1; *************** *** 188,192 **** PropertyException pe = new PropertyException.UndefinedVariableException(); pe.setMessage("#count: step cannot be 0."); ! out.write(context.getEvaluationExceptionHandler().expand(_iterator, context, pe)); } } --- 197,202 ---- PropertyException pe = new PropertyException.UndefinedVariableException(); pe.setMessage("#count: step cannot be 0."); ! out.write(context.getEvaluationExceptionHandler() ! .expand(_iterator, context, pe)); } } |