public void setProperties(Properties props) { this.properties.clear(); if (props != null && !props.isEmpty()) { for (String key:props.stringPropertyNames()) { addProperty(key, props.getProperty(key)); } } }
public void setProperties(Properties props) { this.properties.clear(); if (props != null && !props.isEmpty()) { for (String key:props.stringPropertyNames()) { addProperty(key, props.getProperty(key)); } } }
private static void parseProperty(XMLStreamReader reader, AdminObjectImpl anObj) throws XMLStreamException { boolean text = false; if (reader.getAttributeCount() > 0) { String key = null; String value = null; for(int i=0; i<reader.getAttributeCount(); i++) { String attrName = reader.getAttributeLocalName(i); String attrValue = reader.getAttributeValue(i); if (attrName.equals(Element.NAME.getLocalName())) { key = attrValue; } else if (attrName.equals(Element.VALUE.getLocalName())) { value = attrValue; } } if (value == null) { value = reader.getElementText(); text = true; } anObj.addProperty(key, value); } if (!text) { ignoreTillEnd(reader); } }
private static void parseProperty(XMLStreamReader reader, AdminObjectImpl anObj) throws XMLStreamException { boolean text = false; if (reader.getAttributeCount() > 0) { String key = null; String value = null; for(int i=0; i<reader.getAttributeCount(); i++) { String attrName = reader.getAttributeLocalName(i); String attrValue = reader.getAttributeValue(i); if (attrName.equals(Element.NAME.getLocalName())) { key = attrValue; } else if (attrName.equals(Element.VALUE.getLocalName())) { value = attrValue; } } if (value == null) { value = reader.getElementText(); text = true; } anObj.addProperty(key, value); } if (!text) { ignoreTillEnd(reader); } }