/** * returns the InPUT value element for a given param id, and its parent id, given the element * cache as a context. * * @param valueParamId * @param paramElementId * @param paramId * @param ps * @param cache * @return */ private static Value<?> getValueForId( String valueParamId, String paramElementId, String paramId, ParamStore ps, ElementCache cache) { // first lookup for local param. Param parentParam = ps.getParam(paramId); Param param = getParamForLocalId(valueParamId, parentParam, ps); // no success -> lookup in cache directly by global name. String eventualParamId; if (param != null) { eventualParamId = param.getId(); } else { eventualParamId = valueParamId; } return cache.get(eventualParamId); }
/** * returns the parameter from the parameter store, given its id. * * @param paramId * @param parentParam * @param ps * @return */ public static Param getParamForId(String paramId, Param parentParam, ParamStore ps) { Param param = ps.getParam(paramId); if (param == null) param = getParamForLocalId(paramId, parentParam, ps); return param; }
/** * returns the local id of a parameter, given its global id. * * @param paramId * @param parentParam * @param ps * @return */ public static Param getParamForLocalId(String paramId, Param parentParam, ParamStore ps) { Param localParam = ps.getParam(parentParam.getParamId() + "." + paramId); if (localParam == null) localParam = ps.getParam(parentParam.getId() + "." + paramId); return localParam; }