private boolean processTemplateCommand ( String cmdLine , int cmdTPosBegin , int cmdTPosEnd ) throws MiniTemplator . TemplateSyntaxException { int p0 = skipBlanks ( cmdLine , 0 ) ; if ( p0 >= cmdLine . length ( ) ) { return false ; } int p = skipNonBlanks ( cmdLine , p0 ) ; String cmd = cmdLine . substring ( p0 , p ) ; String parms = cmdLine . substring ( p ) ; /* select */ if ( cmd . equalsIgnoreCase ( "$beginBlock" ) ) { processBeginBlockCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else if ( cmd . equalsIgnoreCase ( "$endBlock" ) ) { processEndBlockCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else if ( cmd . equalsIgnoreCase ( "$include" ) ) { processIncludeCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else if ( cmd . equalsIgnoreCase ( "$if" ) ) { processIfCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else if ( cmd . equalsIgnoreCase ( "$elseIf" ) ) { processElseIfCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else if ( cmd . equalsIgnoreCase ( "$else" ) ) { processElseCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else if ( cmd . equalsIgnoreCase ( "$endIf" ) ) { processEndIfCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else { if ( cmd . startsWith ( "$" ) && ! cmd . startsWith ( "${" ) ) { throw new MiniTemplator . TemplateSyntaxException ( "Unknown command \"" + cmd + "\" in template at offset " + cmdTPosBegin + "." ) ; } else { return false ; } } return true ; }
Returns false if the command should be treatet as normal template text .