private ProvisionedFeaturePack readFeaturePack(XMLExtendedStreamReader reader) throws XMLStreamException { final ProvisionedFeaturePack.Builder fpBuilder = ProvisionedFeaturePack.builder(parseSource(reader).getFPID()); while (reader.hasNext()) { switch (reader.nextTag()) { case XMLStreamConstants.END_ELEMENT: { return fpBuilder.build(); } case XMLStreamConstants.START_ELEMENT: { final Element element = Element.of(reader.getName()); switch (element) { case PACKAGES: readPackageList(reader, fpBuilder); break; default: throw ParsingUtils.unexpectedContent(reader); } break; } default: { throw ParsingUtils.unexpectedContent(reader); } } } throw ParsingUtils.endOfDocument(reader.getLocation()); }
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 readPackageList(XMLExtendedStreamReader reader, ProvisionedFeaturePack.Builder builder) throws XMLStreamException { ParsingUtils.parseNoAttributes(reader); while (reader.hasNext()) { switch (reader.nextTag()) { case XMLStreamConstants.END_ELEMENT: { return; } case XMLStreamConstants.START_ELEMENT: { final Element element = Element.of(reader.getName()); switch (element) { case PACKAGE: builder.addPackage(readPackage(reader)); break; default: throw ParsingUtils.unexpectedContent(reader); } break; } default: { throw ParsingUtils.unexpectedContent(reader); } } } throw ParsingUtils.endOfDocument(reader.getLocation()); }
switch (element) { case FEATURE_PACK: builder.addFeaturePack(readFeaturePack(reader)); break; case CONFIG: