Package org.restlet.ext.atom.internal
Class EntryContentReader
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.restlet.ext.atom.EntryReader
-
- org.restlet.ext.atom.internal.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classEntryContentReader.State
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringBuildercontentBufferBuffer for the current text content of the current tag.private intcontentDepthMark the Content depth.private MediaTypecontentTypeThe media type of the Content (for inline cases).private CategorycurrentCategoryThe currently parsed Category.private ContentcurrentContentThe currently parsed Content.private XmlWritercurrentContentWriterThe currently parsed XML content writer.private java.util.DatecurrentDateThe currently date parsed from the current text content.private EntrycurrentEntryThe currently parsed Entry.private LinkcurrentLinkThe currently parsed Link.private PersoncurrentPersonThe currently parsed Person.private TextcurrentTextThe currently parsed Text.private java.util.Map<java.lang.String,java.lang.String>prefixMappingsThe current list of prefix mappings.private EntryContentReader.StatestateThe currently state.
-
Constructor Summary
Constructors Constructor Description EntryContentReader(Entry entry)Constructor.EntryContentReader(Entry entry, EntryReader extraEntryHandler)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)voidendDocument()voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)voidendPrefixMapping(java.lang.String prefix)private MediaTypegetMediaType(java.lang.String type)Returns a media type from an Atom type attribute.private voidinitiateInlineMixedContent()Initiates the parsing of a mixed content part of the current document.voidstartDocument()voidstartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs)voidstartPrefixMapping(java.lang.String prefix, java.lang.String uri)voidstartTextElement(org.xml.sax.Attributes attrs)Receive notification of the beginning of a text element.-
Methods inherited from class org.restlet.ext.atom.EntryReader
endContent, endEntry, endLink, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startContent, startEntry, startLink, unparsedEntityDecl, warning
-
-
-
-
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.
-
state
private EntryContentReader.State state
The currently state.
-
-
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:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classEntryReader- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXException- Specified by:
endDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
endDocumentin classEntryReader- 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:
endElementin interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classEntryReader- Throws:
org.xml.sax.SAXException
-
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException- Specified by:
endPrefixMappingin interfaceorg.xml.sax.ContentHandler- Overrides:
endPrefixMappingin classEntryReader- 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:
startDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
startDocumentin classEntryReader- 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:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classEntryReader- Throws:
org.xml.sax.SAXException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException- Specified by:
startPrefixMappingin interfaceorg.xml.sax.ContentHandler- Overrides:
startPrefixMappingin classEntryReader- 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.
-
-