protected Object substituteLeafVars(Object currentNode) {
        if (currentNode instanceof JsonObject) {
            JsonObject jso = (JsonObject) currentNode;
            for (Entry<String, Object> entry : jso) {
                Object newVal = substituteLeafVars(entry.getValue());
                jso.put(entry.getKey(), newVal);
            }
            return jso;
        } else if (currentNode instanceof JsonArray) {
            JsonArray jsa = (JsonArray) currentNode;
            int i = 0;
            for (Object entry : jsa) {
                Object newVal = substituteLeafVars(entry);
                jsa.set(i, newVal);
                i++;
            }
            return jsa;
        } else if (currentNode instanceof String) {
            // Use substitutor to replace the value, looking in various locations such as sys props and env
            String newValue = SUBSTITUTOR.replace((String) currentNode);
            logger.trace("Variable substitution: ({0} -> {1})", currentNode, newValue);
            return newValue;
        }
        return currentNode;
    }
Gets all properties in the engine configuration that are prefixed
with the given prefix.
@param prefix the prefix
@return all prefixed properties
gateway/platforms/vertx3/vertx3/src/main/java/io/apiman/gateway/platforms/vertx3/common/config/VertxEngineConfig.java