private void readDirectiveElement(XMLStreamReader reader, Map<String, String> directives) throws XMLStreamException { String name = reader.getAttributeValue(null, Attribute.NAME.toString()); String value = reader.getAttributeValue(null, Attribute.VALUE.toString()); directives.put(name, value); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { } } }
private void readAttributeElement(XMLStreamReader reader, Map<String, Object> attributes) throws XMLStreamException { String name = reader.getAttributeValue(null, Attribute.NAME.toString()); String valstr = reader.getAttributeValue(null, Attribute.VALUE.toString()); String typespec = reader.getAttributeValue(null, Attribute.TYPE.toString()); AttributeValue value = AttributeValueHandler.readAttributeValue(typespec, valstr); attributes.put(name, value.getValue()); while (reader.hasNext() && reader.nextTag() != END_ELEMENT); }
private void readCapabilityElement(XMLStreamReader reader, XResourceBuilder<XResource> builder) throws XMLStreamException { String namespace = reader.getAttributeValue(null, Attribute.NAMESPACE.toString()); Map<String, Object> atts = new HashMap<String, Object>(); Map<String, String> dirs = new HashMap<String, String>(); readAttributesAndDirectives(reader, atts, dirs); try { builder.addCapability(namespace, atts, dirs); } catch (RuntimeException ex) { throw MESSAGES.cannotReadResourceElement(ex, reader.getLocation()); } }
private void readRequirementElement(XMLStreamReader reader, XResourceBuilder<XResource> builder) throws XMLStreamException { String namespace = reader.getAttributeValue(null, Attribute.NAMESPACE.toString()); Map<String, Object> atts = new HashMap<String, Object>(); Map<String, String> dirs = new HashMap<String, String>(); readAttributesAndDirectives(reader, atts, dirs); try { builder.addRequirement(namespace, atts, dirs); } catch (RuntimeException ex) { throw MESSAGES.cannotReadResourceElement(ex, reader.getLocation()); } }