Package org.apache.sling.feature.cpconverter.shared

## Class AbstractJcrNodeParser<O>

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - org.apache.sling.feature.cpconverter.shared.AbstractJcrNodeParser<O>

All Implemented Interfaces:
  `ContentHandler`, `DTDHandler`, `EntityResolver`, `ErrorHandler`

Direct Known Subclasses:
  `DefaultEntryParser`, `MixinParser`, `PrimaryTypeParser`

    public abstract class AbstractJcrNodeParser<O>
    extends DefaultHandler

### Field Summary

Fields
`protected String` `detectedPrimaryType`
`static String` `JCR_ROOT`

### Constructor Summary

Constructors
`protected` `AbstractJcrNodeParser​(@NotNull String... primaryTypes)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract O` `getParsingResult()`
`protected abstract void` `onJcrRootElement​(String uri, String localName, String qName, Attributes attributes)`
`protected void` `onJcrRootNode​(String uri, String localName, String qName, Attributes attributes, String primaryType)`
`O` `parse​(InputStream input)`
`void` `startElement​(String uri, String localName, String qName, Attributes attributes)`

### Methods inherited from class org.xml.sax.helpers.DefaultHandler

`characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### JCR_ROOT

    public static final String JCR_ROOT

See Also:
  Constant Field Values

#### detectedPrimaryType

    protected String detectedPrimaryType

### Constructor Detail

#### AbstractJcrNodeParser

    protected AbstractJcrNodeParser​(@NotNull
                                    @NotNull String... primaryTypes)

### Method Detail

#### parse

    public O parse​(InputStream input)
            throws IOException

Throws:
  `IOException`

#### startElement

    public void startElement​(String uri,
                             String localName,
                             String qName,
                             Attributes attributes)
                      throws SAXException

Specified by:
  `startElement` in interface `ContentHandler`
Overrides:
  `startElement` in class `DefaultHandler`
Throws:
  `SAXException`

#### onJcrRootNode

    protected void onJcrRootNode​(String uri,
                                 String localName,
                                 String qName,
                                 Attributes attributes,
                                 String primaryType)

#### onJcrRootElement

    protected abstract void onJcrRootElement​(String uri,
                                             String localName,
                                             String qName,
                                             Attributes attributes)

#### getParsingResult

    protected abstract O getParsingResult()