/** This replaces the user input variables in the XML template * */ public String replaceVariablesInString(String xmlStringArg) { String modXmlString = xmlStringArg; Properties prop = new Properties(); for (int i = 0; i < uiList.size(); i++) { UserInput ui = (UserInput) uiList.get(i); XmlUIElement el = (XmlUIElement) uiElementsList.get(i); ui.setValue(el.getValue()); prop.put("$UserInput$" + ui.getID(), el.getValue()); // modXmlString = StringUtil.replaceStringBySpecifiedString(modXmlString,"$UserInput$" + // ui.getID(),el.getValue()); } Template template = null; try { template = new Template(xmlStringArg); // template = PopulateTemplateParams.substituteParams(template, prop, 3); template = PopulateTemplateParams.substituteParams(template, prop); } catch (Exception exc) { exc.printStackTrace(); } // return modXmlString; return template.toString(); }
/** * Prepends the value of the specified Template to the begining of this Template. * * @param hout the Template */ public Template prepend(Template hout) { if (hout != null) m_template = new StringBuffer(hout.toString() + m_template.toString()); return this; }
/** * Appends the value of the specified Template to the end of this Template. * * @param hout the Template */ public Template append(Template hout) { if (hout != null) m_template = m_template.append(hout.toString()); return this; }
public void setLastTag(String tag, Template tagvalue) { setLastTag(tag, tagvalue.toString()); }
/** * Constructs a new Template with the specified template. * * @param templ the Template */ public Template(Template templ) { m_template = new StringBuffer(templ.toString()); m_template2 = new StringBuffer(templ.toString()); }