@Test public void testSingleParamMultipleTimes() { final String snippet = "something.param.getAnother($param).equals($param);"; final SnippetBuilder snip = new SnippetBuilder(snippet); final String cellValue = "42"; final String result = snip.build(cellValue); assertNotNull(result); assertEquals("something.param.getAnother(42).equals(42);", result); }
public String build( final String cellValue ) { switch ( type ) { case FORALL: return buildForAll( cellValue ); case INDEXED: return buildMulti( cellValue ); default: return buildSingle( cellValue ); } }
SnippetBuilder { public String build( final String cellValue ) { switch ( type ) { case FORALL: return buildForAll( cellValue ); case INDEXED: return buildMulti( cellValue ); default: return buildSingle( cellValue ); } } }
SnippetBuilder { public String build( final String cellValue ) { switch ( type ) { case FORALL: return buildForAll( cellValue ); case INDEXED: return buildMulti( cellValue ); default: return buildSingle( cellValue ); } } SnippetBuilder( String snippetTemplate );  SnippetBuilder( String snippetTemplate, boolean trim ); }
SnippetBuilder { public String build( final String cellValue ) { switch ( type ) { case FORALL: return buildForAll( cellValue ); case INDEXED: return buildMulti( cellValue ); default: return buildSingle( cellValue ); } } SnippetBuilder( String snippetTemplate );  SnippetBuilder( String snippetTemplate, boolean trim ); static SnippetType getType( String template ); String build( final String cellValue ); }
SnippetBuilder { public String build( final String cellValue ) { switch ( type ) { case FORALL: return buildForAll( cellValue ); case INDEXED: return buildMulti( cellValue ); default: return buildSingle( cellValue ); } } SnippetBuilder( String snippetTemplate );  SnippetBuilder( String snippetTemplate, boolean trim ); static SnippetType getType( String template ); String build( final String cellValue ); static final String PARAM_PREFIX; static final String PARAM_SUFFIX; static final String PARAM_STRING; static final String PARAM_FORALL_STRING; static final Pattern PARAM_FORALL_PATTERN; }