@Test public void testEnvironmentSubstitute() { Variables vars = new Variables(); vars.setVariable( "VarOne", "DataOne" ); vars.setVariable( "VarTwo", "DataTwo" ); assertNull( vars.environmentSubstitute( (String) null ) ); assertEquals( "", vars.environmentSubstitute( "" ) ); assertEquals( "DataTwo", vars.environmentSubstitute( "${VarTwo}" ) ); assertEquals( "DataTwoEnd", vars.environmentSubstitute( "${VarTwo}End" ) ); assertEquals( 0, vars.environmentSubstitute( new String[0] ).length ); assertArrayEquals( new String[]{ "DataOne", "TheDataOne" }, vars.environmentSubstitute( new String[]{ "${VarOne}", "The${VarOne}" } ) ); }
@Override public String environmentSubstitute( String aString ) { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.environmentSubstitute( aString, properties ); }
Variables implements VariableSpace { @Override public String environmentSubstitute( String aString ) { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.environmentSubstitute( aString, properties ); } }
Variables implements VariableSpace { @Override public String environmentSubstitute( String aString ) { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.environmentSubstitute( aString, properties ); } Variables(); }
Variables implements VariableSpace { @Override public String environmentSubstitute( String aString ) { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.environmentSubstitute( aString, properties ); } Variables(); @Override void copyVariablesFrom( VariableSpace space ); @Override VariableSpace getParentVariableSpace(); @Override void setParentVariableSpace( VariableSpace parent ); @Override String getVariable( String variableName, String defaultValue ); @Override String getVariable( String variableName ); @Override boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); @Override void initializeVariablesFrom( VariableSpace parent ); @Override String[] listVariables(); @Override void setVariable( String variableName, String variableValue ); @Override String environmentSubstitute( String aString ); @Override String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); @Override String[] environmentSubstitute( String[] string ); @Override void shareVariablesWith( VariableSpace space ); @Override void injectVariables( Map<String, String> prop ); static synchronized VariableSpace getADefaultVariableSpace(); }
Variables implements VariableSpace { @Override public String environmentSubstitute( String aString ) { if ( aString == null || aString.length() == 0 ) { return aString; } return StringUtil.environmentSubstitute( aString, properties ); } Variables(); @Override void copyVariablesFrom( VariableSpace space ); @Override VariableSpace getParentVariableSpace(); @Override void setParentVariableSpace( VariableSpace parent ); @Override String getVariable( String variableName, String defaultValue ); @Override String getVariable( String variableName ); @Override boolean getBooleanValueOfVariable( String variableName, boolean defaultValue ); @Override void initializeVariablesFrom( VariableSpace parent ); @Override String[] listVariables(); @Override void setVariable( String variableName, String variableValue ); @Override String environmentSubstitute( String aString ); @Override String fieldSubstitute( String aString, RowMetaInterface rowMeta, Object[] rowData ); @Override String[] environmentSubstitute( String[] string ); @Override void shareVariablesWith( VariableSpace space ); @Override void injectVariables( Map<String, String> prop ); static synchronized VariableSpace getADefaultVariableSpace();  }