private boolean processShortFormTemplateCommand ( String cmdLine , int cmdTPosBegin , int cmdTPosEnd ) throws MiniTemplator . TemplateSyntaxException { int p0 = skipBlanks ( cmdLine , 0 ) ; if ( p0 >= cmdLine . length ( ) ) { return false ; } int p = p0 ; char cmd1 = cmdLine . charAt ( p ++ ) ; if ( cmd1 == ' ' && p < cmdLine . length ( ) && ! Character . isWhitespace ( cmdLine . charAt ( p ) ) ) { p ++ ; } String cmd = cmdLine . substring ( p0 , p ) ; String parms = cmdLine . substring ( p ) . trim ( ) ; /* select */ if ( cmd . equals ( "?" ) ) { processIfCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else if ( cmd . equals ( ":" ) ) { if ( parms . length ( ) > 0 ) { processElseIfCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else { processElseCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } } else if ( cmd . equals ( "/?" ) ) { processEndIfCmd ( parms , cmdTPosBegin , cmdTPosEnd ) ; } else { return false ; } return true ; }
Returns false if the command is not recognized and should be treatet as normal temlate text .