in src/main/java/org/apache/commons/scxml2/io/SCXMLReader.java [723:791]
private static void readParallel(final XMLStreamReader reader, final Configuration configuration, final SCXML scxml,
final TransitionalState parent)
throws IOException, ModelException, XMLStreamException {
final Parallel parallel = new Parallel();
parallel.setId(readOrGeneratedTransitionTargetId(reader, scxml, SCXMLConstants.ELEM_PARALLEL));
final String src = readAV(reader, SCXMLConstants.ATTR_SRC);
if (src != null) {
String source = src;
final Configuration copy = new Configuration(configuration);
if (copy.parent == null) {
copy.parent = scxml;
}
if (configuration.pathResolver != null) {
source = configuration.pathResolver.resolvePath(src);
copy.pathResolver = configuration.pathResolver.getResolver(src);
}
readTransitionalStateSrc(copy, source, parallel);
}
if (parent == null) {
scxml.addChild(parallel);
} else if (parent instanceof State) {
((State)parent).addChild(parallel);
}
else {
((Parallel)parent).addChild(parallel);
}
scxml.addTarget(parallel);
if (configuration.parent != null) {
configuration.parent.addTarget(parallel);
}
loop : while (reader.hasNext()) {
String name, nsURI;
switch (reader.next()) {
case XMLStreamConstants.START_ELEMENT:
nsURI = reader.getNamespaceURI();
name = reader.getLocalName();
if (SCXMLConstants.XMLNS_SCXML.equals(nsURI)) {
if (SCXMLConstants.ELEM_TRANSITION.equals(name)) {
parallel.addTransition(readTransition(reader, configuration));
} else if (SCXMLConstants.ELEM_STATE.equals(name)) {
readState(reader, configuration, scxml, parallel);
} else if (SCXMLConstants.ELEM_PARALLEL.equals(name)) {
readParallel(reader, configuration, scxml, parallel);
} else if (SCXMLConstants.ELEM_ONENTRY.equals(name)) {
readOnEntry(reader, configuration, parallel);
} else if (SCXMLConstants.ELEM_ONEXIT.equals(name)) {
readOnExit(reader, configuration, parallel);
} else if (SCXMLConstants.ELEM_DATAMODEL.equals(name)) {
readDatamodel(reader, configuration, null, parallel);
} else if (SCXMLConstants.ELEM_INVOKE.equals(name)) {
readInvoke(reader, configuration, parallel);
} else if (SCXMLConstants.ELEM_HISTORY.equals(name)) {
readHistory(reader, configuration, scxml, parallel);
} else {
reportIgnoredElement(reader, configuration, SCXMLConstants.ELEM_PARALLEL, nsURI, name);
}
} else {
reportIgnoredElement(reader, configuration, SCXMLConstants.ELEM_PARALLEL, nsURI, name);
}
break;
case XMLStreamConstants.END_ELEMENT:
break loop;
default:
}
}
}