@Override
  public void startElement(String uri, String localName, String qName, Attributes atts)
      throws SAXException {
    switch (localName) {
      case ELEMENT_CACHE: {
        assertEquals(ELEMENT_CACHE, localName);
        assertEquals(ELEMENT_CACHE_QNAME, qName);
        assertEquals(NAMESPACE, uri);
        assertNotNull(atts.getValue(ATTRIBUTE_VALUE));
        MockCacheExtension extension = new MockCacheExtension(atts.getValue(ATTRIBUTE_VALUE));
        stack.push(extension);
        break;
      }
      case ELEMENT_REGION: {
        assertEquals(ELEMENT_REGION, localName);
        assertEquals(ELEMENT_REGION_QNAME, qName);
        assertEquals(NAMESPACE, uri);
        assertNotNull(atts.getValue(ATTRIBUTE_VALUE));
        if ("exception".equals(atts.getValue(ATTRIBUTE_VALUE))) {
          throw new SAXParseException("Value is 'exception'.", documentLocator);
        }
        MockRegionExtension extension = new MockRegionExtension(atts.getValue(ATTRIBUTE_VALUE));
        stack.push(extension);
        break;
      }
      default:
        throw new SAXParseException("Unexpected element '" + localName + "'.", documentLocator);
    }
  }
Mock Extension {@link XmlParser}.


@since GemFire 8.1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/extension/mock/MockExtensionXmlParser.java