Package com.floragunn.codova.documents
Class UnparsedDocument<T>
- java.lang.Object
-
- com.floragunn.codova.documents.UnparsedDocument<T>
-
- All Implemented Interfaces:
Document<T>
- Direct Known Subclasses:
UnparsedDocument.BytesDoc,UnparsedDocument.StringDoc
public abstract class UnparsedDocument<T> extends Object implements Document<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUnparsedDocument.BytesDocstatic classUnparsedDocument.StringDoc
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypecontentTypeprotected Formatformat
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract com.fasterxml.jackson.core.JsonParsercreateParser()static UnparsedDocument<?>from(byte[] source, ContentType contentType)static UnparsedDocument<?>from(byte[] source, Format format)static UnparsedDocument<?>from(byte[] source, Format format, Charset charset)static UnparsedDocument<?>from(String source, ContentType contentType)static UnparsedDocument<?>from(String source, Format format)static UnparsedDocument<?>fromJson(String json)ContentTypegetContentType()FormatgetFormat()StringgetMediaType()abstract StringgetSourceAsString()abstract Objectparse()abstract DocNodeparseAsDocNode()abstract Map<String,Object>parseAsMap()ObjecttoBasicObject()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.floragunn.codova.documents.Document
meta, toBytes, toDeepBasicObject, toDocNode, toJsonString, toPrettyJsonString, toSmile, toString, toYamlString
-
-
-
-
Field Detail
-
format
protected final Format format
-
contentType
protected final ContentType contentType
-
-
Method Detail
-
from
public static UnparsedDocument<?> from(String source, Format format)
-
from
public static UnparsedDocument<?> from(String source, ContentType contentType)
-
from
public static UnparsedDocument<?> from(byte[] source, ContentType contentType)
-
from
public static UnparsedDocument<?> from(byte[] source, Format format, Charset charset)
-
from
public static UnparsedDocument<?> from(byte[] source, Format format)
-
fromJson
public static UnparsedDocument<?> fromJson(String json)
-
parseAsMap
public abstract Map<String,Object> parseAsMap() throws DocumentParseException, UnexpectedDocumentStructureException
-
parseAsDocNode
public abstract DocNode parseAsDocNode() throws DocumentParseException
- Throws:
DocumentParseException
-
parse
public abstract Object parse() throws DocumentParseException
- Throws:
DocumentParseException
-
getSourceAsString
public abstract String getSourceAsString()
-
createParser
public abstract com.fasterxml.jackson.core.JsonParser createParser() throws com.fasterxml.jackson.core.JsonParseException, IOException- Throws:
com.fasterxml.jackson.core.JsonParseExceptionIOException
-
getFormat
public Format getFormat()
-
getContentType
public ContentType getContentType()
-
getMediaType
public String getMediaType()
-
toBasicObject
public Object toBasicObject()
- Specified by:
toBasicObjectin interfaceDocument<T>
-
-