protected StringConcatenationClient generateKeyword ( final Keyword keyword , final String comment , Map < String , String > getters ) { try { final String methodName = getIdentifier ( keyword ) ; final String accessor = GrammarKeywordAccessFragment2 . this . grammarAccessExtensions . gaAccessor ( keyword ) ; if ( ! Strings . isEmpty ( methodName ) && ! Strings . isEmpty ( accessor ) ) { if ( getters != null ) { getters . put ( methodName , keyword . getValue ( ) ) ; } return new StringConcatenationClient ( ) { @ Override protected void appendTo ( TargetStringConcatenation it ) { it . append ( "\t/** Keyword: {@code " ) ; //$NON-NLS-1$ it . append ( protectCommentKeyword ( keyword . getValue ( ) ) ) ; it . append ( "}." ) ; //$NON-NLS-1$ it . newLine ( ) ; if ( ! Strings . isEmpty ( comment ) ) { it . append ( "\t * Source: " ) ; //$NON-NLS-1$ it . append ( comment ) ; it . newLine ( ) ; } it . append ( "\t */" ) ; //$NON-NLS-1$ it . newLine ( ) ; it . append ( "\tpublic String get" ) ; //$NON-NLS-1$ it . append ( methodName ) ; it . append ( "() {" ) ; //$NON-NLS-1$ it . newLine ( ) ; it . append ( "\t\treturn this.grammarAccess." ) ; //$NON-NLS-1$ it . append ( accessor ) ; it . append ( ".getValue();" ) ; //$NON-NLS-1$ it . newLine ( ) ; it . append ( "\t}" ) ; //$NON-NLS-1$ it . newLineIfNotEmpty ( ) ; it . newLine ( ) ; } } ; } } catch ( Exception e ) { // } return null ; }
Generate a grammar keyword .