/** * 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 */ 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; }
/** * 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 */ 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; }
throw new InvalidVelocityException(); throw new InvalidVelocityException(); throw new InvalidVelocityException(); throw new InvalidVelocityException();
throw new InvalidVelocityException(); throw new InvalidVelocityException(); throw new InvalidVelocityException(); throw new InvalidVelocityException();
throw new InvalidVelocityException(); throw new InvalidVelocityException();
throw new InvalidVelocityException(); throw new InvalidVelocityException();
throw new InvalidVelocityException(); throw new InvalidVelocityException();