code: public int getDirectiveName(char[] array, int currentIndex, StringBuffer directiveName, StringBuffer velocityBlock,
          VelocityParserContext context) throws InvalidVelocityException
      {
          int i = currentIndex;
  
          if (i == array.length) {
              throw new InvalidVelocityException();
          }
  
          if (array[i] == '{') {
              ++i;
          }
  
          i = getVelocityIdentifier(array, i, directiveName, context);
  
          if (i < array.length && array[i] == '}') {
              ++i;
          }
  
          if (velocityBlock != null) {
              velocityBlock.append(array, currentIndex, i - currentIndex);
          }
  
          return i;
      }
docs: Get a Velocity directive name block. It's different from
  {@link #getVelocityIdentifier(char[], int, StringBuffer, VelocityParserContext)} because is include the optional
  <code>{</code> and <code>}</code>.
  
  @param array the source to parse
  @param currentIndex the current index in the <code>array</code>
  @param directiveName the buffer where to append the name of the directive
  @param velocityBlock the buffer where to append matched velocity block
  @param context the parser context to put some informations
  @return the index in the <code>array</code> after the matched block
  @throws InvalidVelocityException not a valid velocity block