String interpolated = ssi.interpolate( interpolatedModel.getParent().getVersion() ); interpolatedModel.getParent().setVersion( interpolated );
@Override public String interpolate(String input) { try { return interpolator.interpolate(input); } catch (org.codehaus.plexus.interpolation.InterpolationException e) { throw new RuntimeException("Error while interpolating value \"" + input + "\"", e); } }
public String interpolate( String input ) throws InterpolationException { return interpolate( input, new SimpleRecursionInterceptor() ); }
/** * Entry point for recursive resolution of an expression and all of its * nested expressions. * * @todo Ensure unresolvable expressions don't trigger infinite recursion. */ public String interpolate( String input, RecursionInterceptor recursionInterceptor ) throws InterpolationException { try { return interpolate( input, recursionInterceptor, new HashSet() ); } finally { if ( !cacheAnswers ) { existingAnswers.clear(); } } }
public String interp( String value ) throws ManipulationException { try { return interp.interpolate( value, ri ); } catch ( final InterpolationException e ) { throw new ManipulationException( "Failed to interpolate: %s. Reason: %s", e, value, e.getMessage() ); } } }
/** * Helper to interpolate given input. */ public static String interpolate(final String input) throws InterpolationException { StringSearchInterpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource(new MapBasedValueSource(tokens.get())); return interpolator.interpolate(input); }
public String resolve( final String value ) throws InterpolationException { if ( value == null || value.trim() .length() < 1 ) { return null; } if ( bootProps == null ) { if ( indyHome == null ) { return value; } else { bootProps = new Properties(); } } bootProps.setProperty( "indy.home", indyHome ); if ( interp == null ) { interp = new StringSearchInterpolator(); interp.addValueSource( new PropertiesBasedValueSource( bootProps ) ); } return interp.interpolate( value ); }
public String resolve( final String value ) throws InterpolationException { if ( value == null || value.trim() .length() < 1 ) { return null; } if ( bootProps == null ) { if ( aproxHome == null ) { return value; } else { bootProps = new Properties(); } } bootProps.setProperty( "aprox.home", aproxHome ); if ( interp == null ) { interp = new StringSearchInterpolator(); interp.addValueSource( new PropertiesBasedValueSource( bootProps ) ); } return interp.interpolate( value ); }
protected final String resolve( final String value ) throws InterpolationException { if ( value == null || value.trim().length() < 1 ) { return null; } if ( bootProps == null ) { if ( homeDir == null ) { return value; } else { bootProps = new Properties(); } } bootProps.setProperty( getHomeSystemProperty(), homeDir ); if ( interp == null ) { interp = new StringSearchInterpolator(); interp.addValueSource( new PropertiesBasedValueSource( bootProps ) ); } return interp.interpolate( value ); }
private String getConfigString( String key, String currentValue, String defaultValue ) { String valueFromSysProps = System.getProperty( "redback." + key ); if ( StringUtils.isNotEmpty( valueFromSysProps ) ) { return valueFromSysProps; } String value = null; if ( StringUtils.isNotEmpty( currentValue ) ) { value = userConfiguration.getString( key, currentValue ); } else { value = userConfiguration.getString( key, defaultValue ); } // do some interpolation as we can have some ${plexus.home} etc... StringSearchInterpolator interpolator = new StringSearchInterpolator(); interpolator.addValueSource( new PropertiesBasedValueSource( System.getProperties() ) ); try { return interpolator.interpolate( value ); } catch ( InterpolationException e ) { // ignore interpolation issue log.warn( "skip issue during interpolation {}", e.getMessage() ); return value; } }
result.add( ssi.interpolate( line ) );
try value = interp.interpolate( value );
String interpolatedProps = interpolator.interpolate( properties );
public synchronized String getKeycloakUiJson() throws AproxWorkflowException { if ( keycloakUiJson == null ) { final String raw = loadFileContent( config.getKeycloakUiJson() ); try { keycloakUiJson = getInterpolator().interpolate( raw ); } catch ( final InterpolationException e ) { throw new AproxWorkflowException( "Failed to resolve expressions in keycloak-ui.json: %s", e, e.getMessage() ); } } return keycloakUiJson; }
String interpolatedProps = interpolator.interpolate( properties );
public synchronized String getKeycloakUiJson() throws IndyWorkflowException { if ( !config.isEnabled() ) { return null; } if ( keycloakUiJson == null ) { final String raw = loadFileContent( config.getKeycloakUiJson() ); try { keycloakUiJson = getInterpolator().interpolate( raw ); } catch ( final InterpolationException e ) { throw new IndyWorkflowException( "Failed to resolve expressions in keycloak-ui.json: %s", e, e.getMessage() ); } } return keycloakUiJson; }
public synchronized String getKeycloakInit() throws IndyWorkflowException { if ( keycloakInitJs == null ) { if ( !config.isEnabled() ) { keycloakInitJs = loadClasspathContent( DISABLED_KEYCLOAK_INIT_JS ); } else { final String raw = loadClasspathContent( KEYCLOAK_INIT_JS ); try { keycloakInitJs = getInterpolator().interpolate( raw ); } catch ( final InterpolationException e ) { throw new IndyWorkflowException( "Failed to resolve expressions in keycloak-ui.json: %s", e, e.getMessage() ); } } } return keycloakInitJs; }
public synchronized String getKeycloakInit() throws AproxWorkflowException { if ( keycloakInitJs == null ) { if ( !config.isEnabled() ) { keycloakInitJs = loadClasspathContent( DISABLED_KEYCLOAK_INIT_JS ); } else { final String raw = loadClasspathContent( KEYCLOAK_INIT_JS ); try { keycloakInitJs = getInterpolator().interpolate( raw ); } catch ( final InterpolationException e ) { throw new AproxWorkflowException( "Failed to resolve expressions in keycloak-ui.json: %s", e, e.getMessage() ); } } } return keycloakInitJs; }
public static String interpolate( String value, Model model ) throws ReleaseExecutionException { if ( value != null && value.contains( "${" ) ) { StringSearchInterpolator interpolator = new StringSearchInterpolator(); List<String> pomPrefixes = Arrays.asList( "pom.", "project." ); interpolator.addValueSource( new PrefixedObjectValueSource( pomPrefixes, model, false ) ); interpolator.addValueSource( new MapBasedValueSource( model.getProperties() ) ); interpolator.addValueSource( new ObjectBasedValueSource( model ) ); try { value = interpolator.interpolate( value, new PrefixAwareRecursionInterceptor( pomPrefixes ) ); } catch ( InterpolationException e ) { throw new ReleaseExecutionException( "Failed to interpolate " + value + " for project " + model.getId(), e ); } } return value; } }
String interpolated = ssi.interpolate( interpolatedModel.getParent().getVersion() ); interpolatedModel.getParent().setVersion( interpolated );