Class SnippetMacros.Number

java.lang.Object
javax0.jamal.extensions.SnippetMacros.Number
All Implemented Interfaces:
javax0.jamal.api.Identified, javax0.jamal.api.InnerScopeDependent, javax0.jamal.api.Macro, javax0.jamal.api.ServiceLoaded
Enclosing class:
SnippetMacros

public static class SnippetMacros.Number
extends Object
implements javax0.jamal.api.Macro, javax0.jamal.api.InnerScopeDependent
Number the lines of the input. For example:

   ((@number
   first line
   second line
   ))
 
will return

   1. first line
   2. second line
 
The formatting can be altered specifying a format string

   ((@define format=%02d. ))
 
The format string will be used in String.format(). The start and step values can also be specified:

   ((@define start=1))
   ((@define step=1))
 
are the default values.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface javax0.jamal.api.Identified

    javax0.jamal.api.Identified.Undefined

    Nested classes/interfaces inherited from interface javax0.jamal.api.Macro

    javax0.jamal.api.Macro.Stateful
  • Field Summary

    Fields inherited from interface javax0.jamal.api.Identified

    DEFAULT_MACRO, MACRO_NAME_ARG1, MACRO_NAME_ARG2

    Fields inherited from interface javax0.jamal.api.Macro

    FETCH
  • Constructor Summary

    Constructors 
    Constructor Description
    Number()  
  • Method Summary

    Modifier and Type Method Description
    String evaluate​(javax0.jamal.api.Input in, javax0.jamal.api.Processor processor)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax0.jamal.api.Macro

    fetch, getId, getIds, prefetch
  • Constructor Details

  • Method Details

    • evaluate

      public String evaluate​(javax0.jamal.api.Input in, javax0.jamal.api.Processor processor) throws javax0.jamal.api.BadSyntax
      Specified by:
      evaluate in interface javax0.jamal.api.Macro
      Throws:
      javax0.jamal.api.BadSyntax