List of usage examples for org.jdom2 Document getRootElement
public Element getRootElement()
Element
for this Document
From source file:com.cats.version.VersionCfgParseAndSave.java
License:Apache License
public List<VersionInfo> getVersionInfo(String fullPath) { SAXBuilder builder = new SAXBuilder(); List<VersionInfo> infos = new ArrayList<VersionInfo>(); try {/*from www.j ava 2s.c o m*/ Document doc = builder.build(new File(fullPath)); Element root = doc.getRootElement(); List<Element> softEles = root.getChildren("software"); for (Element softEle : softEles) { String appName = softEle.getAttribute("name").getValue(); String versionCode = softEle.getChildText("latest-version-code"); String versionName = softEle.getChildText("latest-version"); String versionPath = softEle.getChildText("latest-version-abspath"); String startupName = softEle.getChildText("latest-version-startup"); Element detailEles = softEle.getChild("latest-version-detail"); List<Element> detailItemEles = detailEles.getChildren("item"); List<VersionInfoDetail> details = new ArrayList<VersionInfoDetail>(); for (Element detailItem : detailItemEles) { String title = detailItem.getAttributeValue("name"); List<Element> detailEleList = detailItem.getChildren("detail"); List<String> detailList = new ArrayList<String>(); for (Element detailEle : detailEleList) { String strDetail = detailEle.getText(); detailList.add(strDetail); } details.add(new VersionInfoDetail(title, detailList)); } Element ignoreEles = softEle.getChild("ignore-files"); List<String> ignoreFiles = new ArrayList<String>(); if (ignoreEles != null) { List<Element> ignoreItems = ignoreEles.getChildren("item"); for (Element ignoreItem : ignoreItems) { ignoreFiles.add(ignoreItem.getText()); } } VersionInfo versionInfo = new VersionInfo(); versionInfo.setAppName(appName); versionInfo.setVersion(versionName); versionInfo.setStartupName(startupName); versionInfo.setVersionCode(Integer.parseInt(versionCode)); versionInfo.setPath(versionPath); versionInfo.setDetails(details); versionInfo.setIgnoreFiles(ignoreFiles); infos.add(versionInfo); } } catch (Exception e) { e.printStackTrace(); return null; } return infos; }
From source file:com.cedarsoft.serialization.test.performance.XmlParserPerformance.java
License:Open Source License
public void benchJdom() { runBenchmark(new Runnable() { @Override//from w ww.j av a 2s . co m public void run() { try { for (int i = 0; i < SMALL; i++) { Document doc = new SAXBuilder().build(new StringReader(CONTENT_SAMPLE)); Element fileTypeElement = doc.getRootElement(); Element extensionElement = fileTypeElement.getChild("extension"); Extension extension = new Extension(extensionElement.getAttributeValue("delimiter"), extensionElement.getText(), extensionElement.getAttribute("default").getBooleanValue()); FileType fileType = new FileType(fileTypeElement.getChildText("id"), extension, fileTypeElement.getAttribute("dependent").getBooleanValue()); assertNotNull(fileType); } } catch (Exception e) { throw new RuntimeException(e); } } }, 4); }
From source file:com.cisco.oss.foundation.logging.FoundationLogger.java
License:Apache License
/** * The sniffing Loggers are some special Loggers, whose level will be set to TRACE forcedly. * @param logger//ww w. j av a 2 s . c o m */ private static void updateSniffingLoggersLevel(Logger logger) { InputStream settingIS = FoundationLogger.class.getResourceAsStream("/sniffingLogger.xml"); if (settingIS == null) { logger.debug("file sniffingLogger.xml not found in classpath"); } else { try { SAXBuilder builder = new SAXBuilder(); Document document = builder.build(settingIS); settingIS.close(); Element rootElement = document.getRootElement(); List<Element> sniffingloggers = rootElement.getChildren("sniffingLogger"); for (Element sniffinglogger : sniffingloggers) { String loggerName = sniffinglogger.getAttributeValue("id"); Logger.getLogger(loggerName).setLevel(Level.TRACE); } } catch (Exception e) { logger.error("cannot load the sniffing logger configuration file. error is: " + e, e); throw new IllegalArgumentException("Problem parsing sniffingLogger.xml", e); } } }
From source file:com.cisco.oss.foundation.logging.structured.AbstractFoundationLoggingMarker.java
License:Apache License
private static void udpateMarkerStructuredLogOverrideMap() { InputStream messageFormatIS = AbstractFoundationLoggingMarker.class .getResourceAsStream("/messageFormat.xml"); if (messageFormatIS == null) { LOGGER.debug("file messageformat.xml not found in classpath"); } else {//from w w w . j ava2 s. c o m try { SAXBuilder builder = new SAXBuilder(); Document document = builder.build(messageFormatIS); messageFormatIS.close(); Element rootElement = document.getRootElement(); List<Element> markers = rootElement.getChildren("marker"); for (Element marker : markers) { AbstractFoundationLoggingMarker.markersXmlMap.put(marker.getAttributeValue("id"), marker); } } catch (Exception e) { LOGGER.error("cannot load the structured log override file. error is: " + e, e); throw new IllegalArgumentException("Problem parsing messageformat.xml", e); } } }
From source file:com.compomics.pladipus.core.control.updates.ProcessingBeanUpdater.java
/** * Adds a new class to the bean definition * @param fullyDefinedClassName the fully defined class name * @throws IllegalArgumentException//from ww w. j av a 2 s .c o m * @throws IOException * @throws JDOMException */ public void addNewProcessingStep(String fullyDefinedClassName) throws IllegalArgumentException, IOException, JDOMException { String className = fullyDefinedClassName.substring(fullyDefinedClassName.lastIndexOf(".") + 1); SAXBuilder builder = new SAXBuilder(); Document document = builder.build(beanXMLDefinitionFile); //check if the class is not already in there for (Element aBean : document.getRootElement().getChildren()) { if (aBean.getAttribute("class").getValue().equals(fullyDefinedClassName)) { throw new IllegalArgumentException( "Class is already defined in the bean configuration for " + aBean.getAttributeValue("id")); } else if (aBean.getAttribute("id").getValue().equals(className)) { throw new IllegalArgumentException("Classname is already in use"); } } Element newClassElement = new Element("bean").setAttribute("id", className) .setAttribute("class", fullyDefinedClassName).setAttribute("lazy-init", "true"); document.getRootElement().addContent(newClassElement); XMLOutputter outputter = new XMLOutputter(); try (StringWriter stringWriter = new StringWriter(); FileWriter writer = new FileWriter(beanXMLDefinitionFile);) { outputter.output(document, stringWriter); String output = stringWriter.getBuffer().toString(); //remove empty namespaces output = output.replace(" xmlns=\"\"", ""); writer.append(output); } }
From source file:com.constellio.app.services.appManagement.AppManagementService.java
License:Open Source License
public LicenseInfo getLicenseInfo() { LicenseInfo license = null;/*from ww w . ja v a 2 s.c o m*/ try { String licenseString = ioServices.readFileToString(foldersLocator.getLicenseFile()); SAXBuilder builder = new SAXBuilder(); Document document = builder.build(new StringReader(licenseString)); String name = document.getRootElement().getChild("name").getContent().get(0).getValue(); LocalDate date = new LocalDate( document.getRootElement().getChild("date").getContent().get(0).getValue()); String signature = document.getRootElement().getChild("signature").getContent().get(0).getValue(); license = new LicenseInfo(name, date, signature); } catch (IOException ioe) { } catch (JDOMException joe) { } return license; }
From source file:com.demo.impl.CoordenadasImpl.java
@Override public List<UbicacionCredito> obtenerCoincidencias(String colonia, String CP) { try {//ww w . j a va 2s. co m Session session = HibernateUtil.getSessionFactory().openSession(); Transaction t = session.beginTransaction(); //direccion completa dir.`DomDeu`,",",dir.`ColDeu`,",",dir.`Entdeu`,",",dir.`EdoDeu` String sql = "select ct.`CreditosII` as noCredito, dp.`Deudor` as nombreDeudor, cg.`Usu_login` as gestor, \n" + "ca.`Camp_Desc` as campagne, concat(dir.`DomDeu`,\",\",dir.`Entdeu`,\",\",dir.`EdoDeu`) as direccion from datos_primarios dp, direcciones dir, \n" + "credito_sf_lt_nt_ct ct, campagne ca, cat_gestores cg where\n" + "dp.`Folio`=dir.`Datos_primarios_Folio` \n" + "and ( (dir.`ColDeu`='" + colonia + "' and dir.`CodPos`='" + CP + "') or (dir.`CodPos`='" + CP + "') )\n" + "and dp.`Folio`=ct.`Datos_primarios_Folio`\n" + "and ct.`Campagne_Camp_Clv`=ca.`Camp_Clv` \n" + "and ct.`Cat_Gestores_Cat_Gestor_clv`=cg.`Cat_Gestor_clv` GROUP by dir.`idDirecciones` order by ct.`CreditosII`;"; List<UbicacionCredito> lista = session.createSQLQuery(sql).addEntity(UbicacionCredito.class).list(); t.commit(); if (lista.isEmpty()) { System.out.println(this.getClass().getName() + " Method: obtenerCoincidencias, la consulta no trajo resultados"); } else { Iterator iter = lista.listIterator(); LogSistema.guardarlog("tam lista " + lista.size()); while (iter.hasNext()) { UbicacionCredito ubicacion = new UbicacionCredito(); ubicacion = (UbicacionCredito) iter.next(); try { String direccion = ubicacion.getDireccion(); direccion = direccion.replace(" ", "%20"); direccion = direccion.replace(" norte ", ""); direccion = direccion.replace(" av ", ""); direccion = direccion.replace(" poniente ", ""); direccion = direccion.replace(" sur ", ""); direccion = direccion.replace(" oriente ", ""); direccion = direccion.replace(" calle ", ""); direccion = direccion.replace(" cll ", ""); direccion = direccion.replace(" col ", ""); direccion = direccion.replace(" norte ", ""); direccion = direccion.replace(" colonia ", ""); direccion = direccion.replace(" sn ", ""); direccion = direccion.replace(" SN ", ""); direccion = direccion.replace(" int ", ""); direccion = direccion.replace(" INT ", ""); URL url = new URL("https://maps.googleapis.com/maps/api/place/autocomplete/xml?input=" + direccion + "&types=geocode&sensor=false&key=AIzaSyDHdJ0GD3efGWzFnyQ0Dcw08eh1fb_9Pq4"); // URL url = new URL("https://maps.googleapis.com/maps/api/place/details/xml?reference=CkQ-AAAAFivu82hu1JJ7FMRBgoqZPG8yeIxL0GDB1_4g46eSghm3mV7DHXeoZkSWgii4MegpQAP2RyYRsqINAYQGZu2fURIQCjcNgINyC1BwT4zDel2FvRoU6-wFkI9DOnkb0WFyTeKdxXYh-4M&sensor=true&key=AIzaSyDHdJ0GD3efGWzFnyQ0Dcw08eh1fb_9Pq4"); LogSistema.guardarlog("URL 1: " + url.toString()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.setRequestProperty("Accept", "application/xml"); if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream()))); String output; StringBuffer buffer = new StringBuffer(); while ((output = br.readLine()) != null) { buffer.append(output); } conn.disconnect(); SAXBuilder builder = new SAXBuilder(); Document doc = builder.build(new StringReader(buffer.toString())); String ref = doc.getRootElement().getChildren("prediction").get(0).getChildren("reference") .get(0).getValue(); url = new URL("https://maps.googleapis.com/maps/api/place/details/xml?reference=" + ref + "&sensor=false&key=AIzaSyDHdJ0GD3efGWzFnyQ0Dcw08eh1fb_9Pq4"); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.setRequestProperty("Accept", "application/xml"); if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } br = new BufferedReader(new InputStreamReader((conn.getInputStream()))); buffer = new StringBuffer(); while ((output = br.readLine()) != null) { buffer.append(output); } conn.disconnect(); builder = new SAXBuilder(); doc = builder.build(new StringReader(buffer.toString())); ubicacion.setLatitud( doc.getRootElement().getChildren("result").get(0).getChildren("geometry").get(0) .getChildren("location").get(0).getChildren("lat").get(0).getValue()); ubicacion.setLongitud( doc.getRootElement().getChildren("result").get(0).getChildren("geometry").get(0) .getChildren("location").get(0).getChildren("lng").get(0).getValue()); //lista.add(ubicacion); ubicacion.setUbicacionEncontrada("ubicacionPositiva"); System.out.println("nombre " + ubicacion.getNombreDeudor()); LogSistema.guardarlog(this.getClass().getName() + ", latitud" + doc.getRootElement().getChildren("result").get(0).getChildren("geometry").get(0) .getChildren("location").get(0).getChildren("lat").get(0).getValue()); LogSistema.guardarlog(this.getClass().getName() + ",logitud " + doc.getRootElement().getChildren("result").get(0).getChildren("geometry").get(0) .getChildren("location").get(0).getChildren("lng").get(0).getValue()); } catch (MalformedURLException e) { e.printStackTrace(); LogSistema.guardarlog(this.getClass().getName() + " Method: obtenerCoincidencias, Exception: " + e.getMessage()); ubicacion.setUbicacionEncontrada("ubicacionNegativa"); } catch (IOException e) { LogSistema.guardarlog(this.getClass().getName() + " Method: obtenerCoincidencias, Exception: " + e.getMessage()); e.printStackTrace(); ubicacion.setUbicacionEncontrada("ubicacionNegativa"); } catch (JDOMException ex) { LogSistema.guardarlog(this.getClass().getName() + " Method: obtenerCoincidencias, Exception: " + ex.getMessage()); ubicacion.setUbicacionEncontrada("ubicacionNegativa"); } catch (IndexOutOfBoundsException ex) { LogSistema.guardarlog(this.getClass().getName() + " Method: obtenerCoincidencias, Exception: " + ex.getMessage()); ubicacion.setUbicacionEncontrada("ubicacionNegativa"); } } //fin del while } return lista; } catch (HibernateException he) { LogSistema.guardarlog( this.getClass().getName() + " Method: obtenerCoincidencias, Exception: " + he.getMessage()); List<UbicacionCredito> lista = new ArrayList<>(); return lista; } }
From source file:com.dexterapps.android.translator.TranslateAndSaveAndroid.java
License:Apache License
private void generateXMLForCountry(String countryCode, List<String> translatedText, ArrayList<AndroidStringMapping> stringXmlDOM, HashMap<String, Integer> baseStringResourcesMapping, String outPutFolder) {/* w w w . j ava2 s .c o m*/ Element resources = new Element("resources"); Document doc = new Document(resources); //System.out.println("Generating XML"); //int totalNumberOfStrings = 0; for (int i = 0; i < stringXmlDOM.size(); i++) { AndroidStringMapping stringMapping = stringXmlDOM.get(i); if (stringMapping.getType().equalsIgnoreCase("string")) { Element string = new Element("string"); string.setAttribute(new Attribute("name", stringMapping.getAttributeName())); //To get the attribute value, use the hasmap and then string array int translatedTextIndex = baseStringResourcesMapping.get(stringMapping.getAttributeValue()); string.setText(translatedText.get(translatedTextIndex)); //Add element to root doc.getRootElement().addContent(string); } else if (stringMapping.getType().equalsIgnoreCase("string-array")) { Element stringArray = new Element("string-array"); stringArray.setAttribute(new Attribute("name", stringMapping.getAttributeName())); //Since this is String array it will have a list of string items, get the list of string items ArrayList<String> stringArrayItems = (ArrayList<String>) stringMapping.getAttributeValue(); for (int j = 0; j < stringArrayItems.size(); j++) { int translatedTextIndex = baseStringResourcesMapping.get(stringArrayItems.get(j)); stringArray.addContent(new Element("item").setText(translatedText.get(translatedTextIndex))); } //Add element to root doc.getRootElement().addContent(stringArray); } else { Element stringArray = new Element("plurals"); stringArray.setAttribute(new Attribute("name", stringMapping.getAttributeName())); //Since this is plurals it will have a list of string items with values, get the list of string items ArrayList<AndroidStringPlurals> stringPluralItems = (ArrayList<AndroidStringPlurals>) stringMapping .getAttributeValue(); for (int j = 0; j < stringPluralItems.size(); j++) { int translatedTextIndex = baseStringResourcesMapping .get(stringPluralItems.get(j).getAttributeValue()); Element pluralItem = new Element("item"); pluralItem.setAttribute("quantity", stringPluralItems.get(j).getAttributeName()); pluralItem.setText(translatedText.get(translatedTextIndex)); stringArray.addContent(pluralItem); } //Add element to root doc.getRootElement().addContent(stringArray); } } // new XMLOutputter().output(doc, System.out); XMLOutputter xmlOutput = new XMLOutputter(); try { // System.out.println("Saving File"); Format format = Format.getPrettyFormat(); format.setEncoding("UTF-8"); xmlOutput.setFormat(format); File file = new File(outPutFolder + "/values-" + countryCode); if (!file.exists()) { file.mkdir(); } file = new File(outPutFolder + "/values-" + countryCode + "/strings.xml"); FileOutputStream fop = new FileOutputStream(file); xmlOutput.output(doc, fop); System.out.println("Translation Successful !!"); // System.out.println("File Saved!"); } catch (Exception e) { System.out.println(e.getMessage()); } }
From source file:com.dexterapps.android.translator.TranslateTextForAndroid.java
License:Apache License
private void parseXMLAndGenerateDom(String sourceFile) { SAXBuilder builder = new SAXBuilder(); File xmlFile = new File(sourceFile); //System.out.println(xmlFile.getAbsolutePath()); try {// www. j a va2 s . c o m /*Navigate the XML DOM and populate the string array for translation We also map the XML in java object so we can use to navigate it again for generating the xml back */ Document document = (Document) builder.build(xmlFile); Element rootNode = document.getRootElement(); List list = rootNode.getChildren(); for (int i = 0; i < list.size(); i++) { AndroidStringMapping stringElement = new AndroidStringMapping(); Element stringNode = (Element) list.get(i); if (stringNode.getName().equalsIgnoreCase("string")) { stringElement.setType("string"); stringElement.setAttributeName(stringNode.getAttributeValue("name")); stringElement.setAttributeValue(stringNode.getText()); baseLanguageStringForTranslation.add(stringNode.getText()); baseStringResourcesMapping.put(stringNode.getText(), i); } else if (stringNode.getName().equalsIgnoreCase("string-array")) { List stringArrayNodeList = stringNode.getChildren(); ArrayList<String> stringArrayItems = new ArrayList<String>(); for (int j = 0; j < stringArrayNodeList.size(); j++) { Element stringArrayNode = (Element) stringArrayNodeList.get(j); baseLanguageStringForTranslation.add(stringArrayNode.getText()); baseStringResourcesMapping.put(stringArrayNode.getText(), i + j); stringArrayItems.add(stringArrayNode.getText()); } stringElement.setType("string-array"); stringElement.setAttributeName(stringNode.getAttributeValue("name")); stringElement.setAttributeValue(stringArrayItems); } else { List stringPluralNodeList = stringNode.getChildren(); ArrayList<AndroidStringPlurals> stringPluralsItems = new ArrayList<AndroidStringPlurals>(); for (int j = 0; j < stringPluralNodeList.size(); j++) { Element stringPluralNode = (Element) stringPluralNodeList.get(j); baseLanguageStringForTranslation.add(stringPluralNode.getText()); baseStringResourcesMapping.put(stringPluralNode.getText(), i + j); AndroidStringPlurals pluralItem = new AndroidStringPlurals(); pluralItem.setAttributeName(stringPluralNode.getAttributeValue("quantity")); pluralItem.setAttributeValue(stringPluralNode.getText()); stringPluralsItems.add(pluralItem); } stringElement.setType("plurals"); stringElement.setAttributeName(stringNode.getAttributeValue("name")); stringElement.setAttributeValue(stringPluralsItems); } stringXmlDOM.add(stringElement); } } catch (IOException io) { System.out.println(io.getMessage()); } catch (JDOMException jdomex) { System.out.println(jdomex.getMessage()); } }
From source file:com.doubotis.sc2dd.util.FontStyleXMLAnalyzer.java
private void computeAnalyze(Document doc) { mRacine = doc.getRootElement(); List<Element> els = mRacine.getChildren(); for (Element el : els) { if (el.getName().equals("Constant")) { String constantName = el.getAttributeValue("name"); String constantValue = el.getAttributeValue("val"); SFontStyle.SFontStyleConstant constant = new SFontStyle.SFontStyleConstant(constantName, constantValue);//from www . j ava2 s.co m System.out.println(" -XML- Created Constant " + constant.toString()); mConstants.put(constant.name, constant); continue; } if (el.getName().equals("Style")) { String styleName = el.getAttributeValue("name"); SFontStyle fontStyle = new SFontStyle(styleName); // Reading Styles on XML. String template = el.getAttributeValue("template"); String font = el.getAttributeValue("font"); String height = el.getAttributeValue("height"); String vjustify = el.getAttributeValue("vjustify"); String hjustify = el.getAttributeValue("hjustify"); String fontflags = el.getAttributeValue("fontflags"); String styleflags = el.getAttributeValue("styleflags"); String textcolor = el.getAttributeValue("textcolor"); String disabledcolor = el.getAttributeValue("disabledcolor"); String highlightcolor = el.getAttributeValue("highlightcolor"); String hotkeycolor = el.getAttributeValue("hotkeycolor"); String hyperlinkcolor = el.getAttributeValue("hyperlinkcolor"); String glowcolor = el.getAttributeValue("glowcolor"); String shadowoffset = el.getAttributeValue("shadowoffset"); fontStyle.template = template; fontStyle.font = font; fontStyle.height = height; fontStyle.vJustify = vjustify; fontStyle.hJustify = hjustify; fontStyle.fontFlags = fontflags; fontStyle.styleFlags = styleflags; fontStyle.textColor = textcolor; fontStyle.disabledColor = disabledcolor; fontStyle.highlightColor = highlightcolor; fontStyle.hotkeyColor = hotkeycolor; fontStyle.hyperlinkColor = hyperlinkcolor; fontStyle.glowColor = glowcolor; fontStyle.shadowOffset = shadowoffset; if (template != null && !template.equals("")) { SFontStyle templateStyle = loadTemplate(template); if (templateStyle != null) { SFontStyle foreignStyle = copy(templateStyle); foreignStyle.name = styleName; foreignStyle.template = template; foreignStyle.font = (fontStyle.font != null) ? fontStyle.font : foreignStyle.font; foreignStyle.height = (fontStyle.height != null) ? fontStyle.height : foreignStyle.height; foreignStyle.vJustify = (fontStyle.vJustify != null) ? fontStyle.vJustify : foreignStyle.vJustify; foreignStyle.hJustify = (fontStyle.hJustify != null) ? fontStyle.hJustify : foreignStyle.hJustify; foreignStyle.fontFlags = (fontStyle.fontFlags != null) ? fontStyle.fontFlags : foreignStyle.fontFlags; foreignStyle.styleFlags = (fontStyle.styleFlags != null) ? fontStyle.styleFlags : foreignStyle.styleFlags; foreignStyle.textColor = (fontStyle.textColor != null) ? fontStyle.textColor : foreignStyle.textColor; foreignStyle.disabledColor = (fontStyle.disabledColor != null) ? fontStyle.disabledColor : foreignStyle.disabledColor; foreignStyle.highlightColor = (fontStyle.highlightColor != null) ? fontStyle.highlightColor : foreignStyle.highlightColor; foreignStyle.hotkeyColor = (fontStyle.hotkeyColor != null) ? fontStyle.hotkeyColor : foreignStyle.hotkeyColor; foreignStyle.hyperlinkColor = (fontStyle.hyperlinkColor != null) ? fontStyle.hyperlinkColor : foreignStyle.hyperlinkColor; foreignStyle.glowColor = (fontStyle.glowColor != null) ? fontStyle.glowColor : foreignStyle.glowColor; foreignStyle.shadowOffset = (fontStyle.shadowOffset != null) ? fontStyle.shadowOffset : foreignStyle.shadowOffset; // Transfer the values into fontStyle. fontStyle = foreignStyle; } } // Now convert constants to true values. fontStyle.font = getConstantValueIfExists(fontStyle.font); fontStyle.height = getConstantValueIfExists(fontStyle.height); fontStyle.vJustify = getConstantValueIfExists(fontStyle.vJustify); fontStyle.hJustify = getConstantValueIfExists(fontStyle.hJustify); fontStyle.fontFlags = getConstantValueIfExists(fontStyle.fontFlags); fontStyle.styleFlags = getConstantValueIfExists(fontStyle.styleFlags); fontStyle.textColor = getConstantValueIfExists(fontStyle.textColor); fontStyle.disabledColor = getConstantValueIfExists(fontStyle.disabledColor); fontStyle.highlightColor = getConstantValueIfExists(fontStyle.highlightColor); fontStyle.hotkeyColor = getConstantValueIfExists(fontStyle.hotkeyColor); fontStyle.hyperlinkColor = getConstantValueIfExists(fontStyle.hyperlinkColor); fontStyle.glowColor = getConstantValueIfExists(fontStyle.glowColor); fontStyle.shadowOffset = getConstantValueIfExists(fontStyle.shadowOffset); // The Font Style is computed! Add it to the list of done styles! System.out.println(" -XML- Created Style " + fontStyle.toString()); mStyles.put(fontStyle.name, fontStyle); continue; } } }