List of usage examples for javax.xml.stream XMLStreamReader getAttributeValue
public String getAttributeValue(String namespaceURI, String localName);
From source file:org.slc.sli.modeling.wadl.reader.WadlReader.java
private static final ParamStyle getParamStyle(final XMLStreamReader reader, final WadlAttributeName name) { return WadlSyntax.decodeParamStyle(reader.getAttributeValue(GLOBAL_NAMESPACE, name.getLocalName())); }
From source file:org.slc.sli.modeling.wadl.reader.WadlReader.java
private static final QName getQNameAttribute(final WadlAttributeName name, final QName defaultValue, final XMLStreamReader reader) { final String value = reader.getAttributeValue(GLOBAL_NAMESPACE, name.getLocalName()); if (value != null) { return toQName(value, reader); } else {/*from w ww . ja v a 2 s . c o m*/ return defaultValue; } }
From source file:org.slc.sli.modeling.wadl.reader.WadlReader.java
private static final String getQueryType(final XMLStreamReader reader, final String defaultName) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, WadlAttributeName.QUERY_TYPE.getLocalName()); if (name != null) { return name; } else {//from w w w . java 2 s. co m return defaultName; } }
From source file:org.slc.sli.modeling.wadl.reader.WadlReader.java
private static final String getStringAttribute(final WadlAttributeName name, final String defaultValue, final XMLStreamReader reader) { final String value = reader.getAttributeValue(GLOBAL_NAMESPACE, name.getLocalName()); if (value != null) { return value; } else {/*from w w w. java 2s . c om*/ return defaultValue; } }
From source file:org.slc.sli.modeling.wadl.reader.WadlReader.java
private static final List<String> getStringListType(final WadlAttributeName name, final XMLStreamReader reader) { final String value = reader.getAttributeValue(GLOBAL_NAMESPACE, name.getLocalName()); if (value != null) { final String delims = "[ ]+"; final String[] tokens = value.split(delims); final List<String> strings = new ArrayList<String>(tokens.length); for (int i = 0; i < tokens.length; i++) { strings.add(tokens[i]);/*from ww w. j av a 2 s.c o m*/ } return strings; } else { return Collections.emptyList(); } }
From source file:org.slc.sli.modeling.wadl.reader.WadlReader.java
private static final String getTitle(final XMLStreamReader reader, final String defaultName) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, WadlAttributeName.TITLE.getLocalName()); if (name != null) { return name; } else {// w ww . j a v a2 s . c o m return defaultName; } }
From source file:org.slc.sli.modeling.xmi.reader.XmiReader.java
protected static final boolean getBoolean(final XmiAttributeName name, final boolean defaultValue, final XMLStreamReader reader) { final String value = reader.getAttributeValue(GLOBAL_NAMESPACE, name.getLocalName()); if (value != null) { return Boolean.valueOf(value); } else {/*from w ww.j a va2 s .c om*/ return defaultValue; } }
From source file:org.slc.sli.modeling.xmi.reader.XmiReader.java
protected static final Identifier getId(final XMLStreamReader reader) { return Identifier .fromString(reader.getAttributeValue(GLOBAL_NAMESPACE, XmiAttributeName.ID.getLocalName())); }
From source file:org.slc.sli.modeling.xmi.reader.XmiReader.java
protected static final Identifier getIdRef(final XMLStreamReader reader) throws XmiMissingAttributeException { final String value = reader.getAttributeValue(GLOBAL_NAMESPACE, XmiAttributeName.IDREF.getLocalName()); if (value != null) { return Identifier.fromString(value); } else {/*ww w . j a va2 s . c o m*/ throw new XmiMissingAttributeException(XmiAttributeName.IDREF.getLocalName()); } }
From source file:org.slc.sli.modeling.xmi.reader.XmiReader.java
protected static final String getName(final XMLStreamReader reader, final String defaultName, final XmiAttributeName attr) { final String name = reader.getAttributeValue(GLOBAL_NAMESPACE, attr.getLocalName()); if (name != null) { return name; } else {//from ww w.j ava2 s . c o m return defaultName; } }