Class EntryContentReader

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class EntryContentReader
    extends EntryReader
    Content reader for entries.
    • Field Detail

      • contentBuffer

        private java.lang.StringBuilder contentBuffer
        Buffer for the current text content of the current tag.
      • contentDepth

        private int contentDepth
        Mark the Content depth.
      • contentType

        private MediaType contentType
        The media type of the Content (for inline cases).
      • currentCategory

        private Category currentCategory
        The currently parsed Category.
      • currentContent

        private Content currentContent
        The currently parsed Content.
      • currentContentWriter

        private XmlWriter currentContentWriter
        The currently parsed XML content writer.
      • currentDate

        private java.util.Date currentDate
        The currently date parsed from the current text content.
      • currentEntry

        private Entry currentEntry
        The currently parsed Entry.
      • currentLink

        private Link currentLink
        The currently parsed Link.
      • currentPerson

        private Person currentPerson
        The currently parsed Person.
      • currentText

        private Text currentText
        The currently parsed Text.
      • prefixMappings

        private java.util.Map<java.lang.String,​java.lang.String> prefixMappings
        The current list of prefix mappings.
    • Constructor Detail

      • EntryContentReader

        public EntryContentReader​(Entry entry)
        Constructor.
        Parameters:
        entry - The entry object to update during the parsing.
      • EntryContentReader

        public EntryContentReader​(Entry entry,
                                  EntryReader extraEntryHandler)
        Constructor.
        Parameters:
        entry - The entry object to update during the parsing.
        extraEntryHandler - Custom handler of all events.
    • Method Detail

      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class EntryReader
        Throws:
        org.xml.sax.SAXException
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Overrides:
        endDocument in class EntryReader
        Throws:
        org.xml.sax.SAXException
      • endElement

        public void endElement​(java.lang.String uri,
                               java.lang.String localName,
                               java.lang.String qName)
                        throws org.xml.sax.SAXException
        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Overrides:
        endElement in class EntryReader
        Throws:
        org.xml.sax.SAXException
      • endPrefixMapping

        public void endPrefixMapping​(java.lang.String prefix)
                              throws org.xml.sax.SAXException
        Specified by:
        endPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        endPrefixMapping in class EntryReader
        Throws:
        org.xml.sax.SAXException
      • getMediaType

        private MediaType getMediaType​(java.lang.String type)
        Returns a media type from an Atom type attribute.
        Parameters:
        type - The Atom type attribute.
        Returns:
        The media type.
      • initiateInlineMixedContent

        private void initiateInlineMixedContent()
        Initiates the parsing of a mixed content part of the current document.
      • startDocument

        public void startDocument()
                           throws org.xml.sax.SAXException
        Specified by:
        startDocument in interface org.xml.sax.ContentHandler
        Overrides:
        startDocument in class EntryReader
        Throws:
        org.xml.sax.SAXException
      • startElement

        public void startElement​(java.lang.String uri,
                                 java.lang.String localName,
                                 java.lang.String qName,
                                 org.xml.sax.Attributes attrs)
                          throws org.xml.sax.SAXException
        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Overrides:
        startElement in class EntryReader
        Throws:
        org.xml.sax.SAXException
      • startPrefixMapping

        public void startPrefixMapping​(java.lang.String prefix,
                                       java.lang.String uri)
                                throws org.xml.sax.SAXException
        Specified by:
        startPrefixMapping in interface org.xml.sax.ContentHandler
        Overrides:
        startPrefixMapping in class EntryReader
        Throws:
        org.xml.sax.SAXException
      • startTextElement

        public void startTextElement​(org.xml.sax.Attributes attrs)
        Receive notification of the beginning of a text element.
        Parameters:
        attrs - The attributes attached to the element.