use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class TslMetaDataHandler method createTotalXML.
public XMLElement createTotalXML() {
XMLElement x = new CaseSensitiveXMLElement();
x.setName("metadata");
for (Iterator<String> iter = scriptList.iterator(); iter.hasNext(); ) {
String element = iter.next();
addScriptElement(x, element);
}
return x;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class TslMetaDataHandler method toXml.
private XMLElement toXml(Map<String, TreeSet<String>> m, String topTagName, String tagname, String elementName, String attribute) {
XMLElement x = new CaseSensitiveXMLElement();
x.setName(topTagName);
Set<Entry<String, TreeSet<String>>> s = m.entrySet();
for (Iterator<Entry<String, TreeSet<String>>> iter = s.iterator(); iter.hasNext(); ) {
Entry<String, TreeSet<String>> e = iter.next();
String element = e.getKey();
TreeSet<String> value = e.getValue();
XMLElement xc = new CaseSensitiveXMLElement();
xc.setName(tagname);
xc.setAttribute("name", element);
x.addChild(xc);
for (Iterator<String> iterator = value.iterator(); iterator.hasNext(); ) {
String ee = iterator.next();
XMLElement xce = new CaseSensitiveXMLElement();
xce.setName(elementName);
xce.setAttribute(attribute, ee);
xc.addChild(xce);
}
}
return x;
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class TslMetaDataHandler method parseScriptData.
/**
* @param element
*/
private void parseScriptData(String scriptName, XMLElement e) {
Vector<XMLElement> v = e.getChildren();
for (Iterator<XMLElement> iter = v.iterator(); iter.hasNext(); ) {
XMLElement element = iter.next();
if ("adapters".equals(element.getName())) {
String adapterValue = element.getStringAttribute("name");
addToMap(usesAdapter, scriptName, adapterValue);
continue;
}
if ("calledby".equals(element.getName())) {
String adapterValue = element.getStringAttribute("name");
addToMap(calledByScriptMap, scriptName, adapterValue);
continue;
}
if ("calls".equals(element.getName())) {
String adapterValue = element.getStringAttribute("name");
addToMap(callsScriptMap, scriptName, adapterValue);
continue;
}
if ("includes".equals(element.getName())) {
String adapterValue = element.getStringAttribute("name");
addToMap(includesScriptMap, scriptName, adapterValue);
continue;
}
if ("includedby".equals(element.getName())) {
String adapterValue = element.getStringAttribute("name");
addToMap(includedByScriptMap, scriptName, adapterValue);
continue;
}
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class TslMetaDataHandler method loadScriptData.
public void loadScriptData(InputStream in) {
Reader fr = null;
try {
fr = new InputStreamReader(in, "UTF-8");
XMLElement e = new CaseSensitiveXMLElement();
e.parseFromReader(fr);
parseMetaData(e);
} catch (IOException e) {
logger.error("Error: ", e);
} finally {
if (fr != null) {
try {
fr.close();
} catch (IOException e1) {
logger.error("Error: ", e1);
}
}
}
}
use of com.dexels.navajo.document.nanoimpl.XMLElement in project navajo by Dexels.
the class TslMetaDataHandler method addAdapters.
/**
* @param xn
* @param element
*/
private void addAdapters(XMLElement xn, String element) {
Set<String> s = usesAdapter.get(element);
if (s == null) {
return;
}
for (Iterator<String> iter = s.iterator(); iter.hasNext(); ) {
String adapter = iter.next();
XMLElement xnincl = new CaseSensitiveXMLElement();
xnincl.setName("adapters");
xnincl.setAttribute("name", adapter);
xn.addChild(xnincl);
}
}
Aggregations