code: public int getVelocityIdentifier(char[] array, int currentIndex, StringBuffer velocityBlock,
          VelocityParserContext context) throws InvalidVelocityException
      {
          // The first character of an identifier must be a [a-zA-Z]
          if (!Character.isLetter(array[currentIndex])) {
              throw new InvalidVelocityException();
          }
  
          int i = currentIndex + 1;
  
          while (i < array.length && array[i] != '}' && isValidVelocityIdentifierChar(array[i])) {
              ++i;
          }
  
          if (velocityBlock != null) {
              velocityBlock.append(array, currentIndex, i - currentIndex);
          }
  
          return i;
      }
docs: Get a valid Velocity identifier used for variable of macro.
  
  @param array the source to parse
  @param currentIndex the current index in the <code>array</code>
  @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