public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap().get(args[1]); if (value == null) return ""; return value; }
public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap() .get(args[1]); if (value == null) return ""; return value; }
public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap() .get(args[1]); if (value == null) return ""; return value; }
public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap().get(args[1]); if (value == null) return ""; return value; }
public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap().get(args[1]); if (value == null) return ""; return value; }
public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap() .get(args[1]); if (value == null) return ""; return value; }
public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap().get(args[1]); if (value == null) return ""; return value; }
public String _def(String args[]) { if (args.length != 2) throw new RuntimeException("Need a value for the ${def;<value>} macro"); String value = domain.getMap() .get(args[1]); if (value == null) return ""; return value; }
/** * Take all the properties and translate them to actual values. This method * takes the set properties and traverse them over all entries, including * the default properties for that properties. The values no longer contain * macros. * * @return A new Properties with the flattened values */ public Map<String, String> getFlattenedProperties() { // Some macros only work in a lower Domain, so we // do not report unknown macros while flattening flattening = true; try { Map<String, String> flattened = new HashMap<>(); Map<String, String> source = domain.getMap(); for (String key : source.keySet()) { if (!key.startsWith("_")) if (key.startsWith("-")) flattened.put(key, source.get(key)); else flattened.put(key, process(source.get(key))); } return flattened; } finally { flattening = false; } }
private String doCommands(String key, Link source) { String[] args = commands.split(key); if (args == null || args.length == 0) return null; for (int i = 0; i < args.length; i++) if (args[i].indexOf('\\') >= 0) args[i] = args[i].replaceAll("\\\\;", ";"); if (args[0].startsWith("^")) { String varname = args[0].substring(1).trim(); Domain parent = source.start.getParent(); if (parent != null) return parent.getMap().get(varname); return null; } Domain rover = domain; while (rover != null) { String result = doCommand(rover, args[0], args); if (result != null) return result; rover = rover.getParent(); } for (Object target : targets) { String result = doCommand(target, args[0], args); if (result != null) return result; } return doCommand(this, args[0], args); }
/** * Take all the properties and translate them to actual values. This method * takes the set properties and traverse them over all entries, including * the default properties for that properties. The values no longer contain * macros. * * @return A new Properties with the flattened values */ public Map<String, String> getFlattenedProperties() { // Some macros only work in a lower Domain, so we // do not report unknown macros while flattening flattening = true; try { Map<String, String> flattened = new HashMap<>(); Map<String, String> source = domain.getMap(); for (String key : source.keySet()) { if (!key.startsWith("_")) if (key.startsWith("-")) flattened.put(key, source.get(key)); else flattened.put(key, process(source.get(key))); } return flattened; } finally { flattening = false; } }
private String doCommands(String key, Link source) { String[] args = commands.split(key); if (args == null || args.length == 0) return null; for (int i = 0; i < args.length; i++) if (args[i].indexOf('\\') >= 0) args[i] = args[i].replaceAll("\\\\;", ";"); if (args[0].startsWith("^")) { String varname = args[0].substring(1).trim(); Domain parent = source.start.getParent(); if (parent != null) return parent.getMap().get(varname); return null; } Domain rover = domain; while (rover != null) { String result = doCommand(rover, args[0], args); if (result != null) return result; rover = rover.getParent(); } for (Object target : targets) { String result = doCommand(target, args[0], args); if (result != null) return result; } return doCommand(this, args[0], args); }