@Test public void testExpandRecursiveThrows() { String propName1 = "propName1"; String propName2 = "propName2"; String propValue1 = "propValue1-${" + propName2 + "}"; String propValue2 = "recursive-${" + propName1 + "}"; Map<String,String> propsMap = new HashMap<>(); propsMap.put(propName1, propValue1); propsMap.put(propName2, propValue2); try { VariableExpansion.expand("${" + propName1 + "}", new VariableExpansion.MapResolver(propsMap)); fail("Expected exception to be thrown"); } catch (IllegalArgumentException iae) { } }
public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } private  VariableExpansion(); }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } private  VariableExpansion(); static final String expand(String input, Resolver resolver); }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } private  VariableExpansion(); static final String expand(String input, Resolver resolver); static final Resolver ENV_VAR_RESOLVER; static final Resolver SYS_PROP_RESOLVER; }