@ Override protected void parse ( ) { if ( image . length ( ) < 4 ) { throw new TemplateSyntaxException ( image , "Malformed tag token" , getLineNumber ( ) , getStartPosition ( ) ) ; } content = image . substring ( 2 , image . length ( ) - 2 ) ; if ( WhitespaceUtils . startsWith ( content , "-" ) ) { setLeftTrim ( true ) ; content = WhitespaceUtils . unwrap ( content , "-" , "" ) ; } if ( WhitespaceUtils . endsWith ( content , "-" ) ) { setRightTrim ( true ) ; content = WhitespaceUtils . unwrap ( content , "" , "-" ) ; } int nameStart = - 1 , pos = 0 , len = content . length ( ) ; for ( ; pos < len ; pos ++ ) { char c = content . charAt ( pos ) ; if ( nameStart == - 1 && Character . isJavaIdentifierStart ( c ) ) { nameStart = pos ; } else if ( nameStart != - 1 && ! Character . isJavaIdentifierPart ( c ) ) { break ; } } if ( pos < content . length ( ) ) { rawTagName = content . substring ( nameStart , pos ) ; helpers = content . substring ( pos ) ; } else { rawTagName = content . trim ( ) ; helpers = "" ; } tagName = rawTagName . toLowerCase ( ) ; }
Get tag name