private void addNodeModel(Element element, ExecutionContext executionContext) { DOMModel nodeModel = DOMModel.getModel(executionContext); nodeModel.getModels().put(DomUtils.getName(element), element); }
private void addNodeModel(Element element, ExecutionContext executionContext) { DOMModel nodeModel = DOMModel.getModel(executionContext); nodeModel.getModels().put(DomUtils.getName(element), element); }
private void addNodeModel(Element element, ExecutionContext executionContext) { DOMModel nodeModel = DOMModel.getModel(executionContext); nodeModel.getModels().put(DomUtils.getName(element), element); }
private void addNodeModel(Element element, ExecutionContext executionContext) { DOMModel nodeModel = DOMModel.getModel(executionContext); nodeModel.getModels().put(DomUtils.getName(element), element); }
/** * Get a "merged" model for FreeMarker templating. * <p/> * This utility merges the current set of beans being managed by the * {@link BeanContext} associated with the * current {@link ExecutionContext}, with the contents of the {@link DOMModel} * associated with the current {@link ExecutionContext}. This is very useful * for templating with FreeMarker. * * @param executionContext The current execution context. * @return A merged templating model. */ public static Map<String, Object> getMergedModel(ExecutionContext executionContext) { Map<String, Object> beans = executionContext.getBeanContext().getBeanMap(); Map<String, Object> model = beans; DOMModel domModel = DOMModel.getModel(executionContext); if(!domModel.getModels().isEmpty()) { Map<String, ElementToNodeModel> elementToNodeModelMap = getElementToNodeModelMap(executionContext); model = new HashMap<String, Object>(); model.putAll(beans); Set<Map.Entry<String, Element>> models = domModel.getModels().entrySet(); for (Map.Entry<String, Element> entry : models) { NodeModel nodeModel = getNodeModel(entry.getKey(), entry.getValue(), elementToNodeModelMap); model.put(entry.getKey(), nodeModel); } } return model; }
/** * Get a "merged" model for FreeMarker templating. * <p/> * This utility merges the current set of beans being managed by the * {@link BeanContext} associated with the * current {@link ExecutionContext}, with the contents of the {@link DOMModel} * associated with the current {@link ExecutionContext}. This is very useful * for templating with FreeMarker. * * @param executionContext The current execution context. * @return A merged templating model. */ public static Map<String, Object> getMergedModel(ExecutionContext executionContext) { Map<String, Object> beans = executionContext.getBeanContext().getBeanMap(); Map<String, Object> model = beans; DOMModel domModel = DOMModel.getModel(executionContext); if(!domModel.getModels().isEmpty()) { Map<String, ElementToNodeModel> elementToNodeModelMap = getElementToNodeModelMap(executionContext); model = new HashMap<String, Object>(); model.putAll(beans); Set<Map.Entry<String, Element>> models = domModel.getModels().entrySet(); for (Map.Entry<String, Element> entry : models) { NodeModel nodeModel = getNodeModel(entry.getKey(), entry.getValue(), elementToNodeModelMap); model.put(entry.getKey(), nodeModel); } } return model; }
/** * Get a "merged" model for FreeMarker templating. * <p/> * This utility merges the current set of beans being managed by the * {@link BeanContext} associated with the * current {@link ExecutionContext}, with the contents of the {@link DOMModel} * associated with the current {@link ExecutionContext}. This is very useful * for templating with FreeMarker. * * @param executionContext The current execution context. * @return A merged templating model. */ public static Map<String, Object> getMergedModel(ExecutionContext executionContext) { Map<String, Object> beans = executionContext.getBeanContext().getBeanMap(); Map<String, Object> model = beans; DOMModel domModel = DOMModel.getModel(executionContext); if(!domModel.getModels().isEmpty()) { Map<String, ElementToNodeModel> elementToNodeModelMap = getElementToNodeModelMap(executionContext); model = new HashMap<String, Object>(); model.putAll(beans); Set<Map.Entry<String, Element>> models = domModel.getModels().entrySet(); for (Map.Entry<String, Element> entry : models) { NodeModel nodeModel = getNodeModel(entry.getKey(), entry.getValue(), elementToNodeModelMap); model.put(entry.getKey(), nodeModel); } } return model; }
/** * Get a "merged" model for FreeMarker templating. * * This utility merges the current set of beans being managed by the * {@link BeanContext} associated with the * current {@link ExecutionContext}, with the contents of the {@link DOMModel} * associated with the current {@link ExecutionContext}. This is very useful * for templating with FreeMarker. * * @param executionContext The current execution context. * @return A merged templating model. */ public static Map<String, Object> getMergedModel(ExecutionContext executionContext) { Map<String, Object> beans = executionContext.getBeanContext().getBeanMap(); Map<String, Object> model = beans; DOMModel domModel = DOMModel.getModel(executionContext); if(!domModel.getModels().isEmpty()) { Map<String, ElementToNodeModel> elementToNodeModelMap = getElementToNodeModelMap(executionContext); model = new HashMap<String, Object>(); model.putAll(beans); Set<Map.Entry<String, Element>> models = domModel.getModels().entrySet(); for (Map.Entry<String, Element> entry : models) { NodeModel nodeModel = getNodeModel(entry.getKey(), entry.getValue(), elementToNodeModelMap); model.put(entry.getKey(), nodeModel); } } return model; }