@Override public void readElement(XMLExtendedStreamReader reader, Builder fpBuilder) throws XMLStreamException { fpBuilder.setFPID(readSource(reader).getFPID()); while (reader.hasNext()) { switch (reader.nextTag()) { break; case DEPENDENCIES: readFeaturePackDeps(reader, fpBuilder); break; case DEFAULT_CONFIGS: readDefaultPackages(reader, fpBuilder); break; case TRANSITIVE: readTransitive(reader, fpBuilder); break; case PATCH: parsePatchFor(reader, fpBuilder); break; default:
private XmlParsers() { mapper = XMLMapper.Factory.create(); new ConfigLayerXmlParser10().plugin(this); new ConfigXmlParser10().plugin(this); new FeatureConfigXmlParser10().plugin(this); new FeatureGroupXmlParser10().plugin(this); new FeaturePackXmlParser10().plugin(this); new FeaturePackXmlParser20().plugin(this); new FeatureSpecXmlParser10().plugin(this); new PackageXmlParser10().plugin(this); new PackageXmlParser20().plugin(this); new ProvisionedStateXmlParser20().plugin(this); new ProvisionedStateXmlParser30().plugin(this); new ProvisionedConfigXmlParser30().plugin(this); new ProvisioningXmlParser20().plugin(this); new ProvisioningXmlParser30().plugin(this); }
private void readDefaultPackages(XMLExtendedStreamReader reader, Builder fpBuilder) throws XMLStreamException { ParsingUtils.parseNoAttributes(reader); boolean hasChildren = false; while (reader.hasNext()) { switch (reader.nextTag()) { case XMLStreamConstants.END_ELEMENT: { if (!hasChildren) { throw ParsingUtils.expectedAtLeastOneChild(reader, Element.DEFAULT_PACKAGES, Element.PACKAGE); } return; } case XMLStreamConstants.START_ELEMENT: { final Element element = Element.of(reader.getName().getLocalPart()); switch (element) { case PACKAGE: fpBuilder.addDefaultPackage(parseName(reader)); hasChildren = true; break; default: throw ParsingUtils.unexpectedContent(reader); } break; } default: { throw ParsingUtils.unexpectedContent(reader); } } } throw ParsingUtils.endOfDocument(reader.getLocation()); }