T - The type to wrap.public class JacksonRepresentation<T> extends OutputRepresentation
| Modifier and Type | Field and Description |
|---|---|
static boolean |
XML_EXPANDING_ENTITY_REFS
True for expanding entity references when parsing XML representations.
|
static boolean |
XML_VALIDATING_DTD
True for validating DTD documents when parsing XML representations.
|
UNKNOWN_SIZE| Constructor and Description |
|---|
JacksonRepresentation(MediaType mediaType,
T object)
Constructor.
|
JacksonRepresentation(Representation representation,
java.lang.Class<T> objectClass)
Constructor.
|
JacksonRepresentation(T object)
Constructor for the JSON media type.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.dataformat.csv.CsvSchema |
createCsvSchema(com.fasterxml.jackson.dataformat.csv.CsvMapper csvMapper)
Creates a Jackson CSV schema based on a mapper and the current object
class.
|
protected com.fasterxml.jackson.databind.ObjectMapper |
createObjectMapper()
Creates a Jackson object mapper based on a media type.
|
protected com.fasterxml.jackson.databind.ObjectReader |
createObjectReader()
Creates a Jackson object reader based on a mapper.
|
protected com.fasterxml.jackson.databind.ObjectWriter |
createObjectWriter()
Creates a Jackson object writer based on a mapper.
|
com.fasterxml.jackson.dataformat.csv.CsvSchema |
getCsvSchema()
Returns the modifiable Jackson CSV schema.
|
T |
getObject()
Returns the wrapped object, deserializing the representation with Jackson
if necessary.
|
java.lang.Class<T> |
getObjectClass()
Returns the object class to instantiate.
|
com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper()
Returns the modifiable Jackson object mapper.
|
com.fasterxml.jackson.databind.ObjectReader |
getObjectReader()
Returns the modifiable Jackson object reader.
|
com.fasterxml.jackson.databind.ObjectWriter |
getObjectWriter()
Returns the modifiable Jackson object writer.
|
boolean |
isExpandingEntityRefs()
Indicates if the parser will expand entity reference nodes.
|
boolean |
isValidatingDtd()
Indicates the desire for validating this type of XML representations
against an XML schema if one is referenced within the contents.
|
void |
setCsvSchema(com.fasterxml.jackson.dataformat.csv.CsvSchema csvSchema)
Sets the Jackson CSV schema.
|
void |
setExpandingEntityRefs(boolean expandEntityRefs)
Indicates if the parser will expand entity reference nodes.
|
void |
setObject(T object)
Sets the object to format.
|
void |
setObjectClass(java.lang.Class<T> objectClass)
Sets the object class to instantiate.
|
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Sets the Jackson object mapper.
|
void |
setObjectReader(com.fasterxml.jackson.databind.ObjectReader objectReader)
Sets the Jackson object reader.
|
void |
setObjectWriter(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
Sets the Jackson object writer.
|
void |
setValidatingDtd(boolean validating)
Indicates the desire for validating this type of XML representations
against an XML schema if one is referenced within the contents.
|
void |
write(java.io.OutputStream outputStream) |
getChannel, getStreamgetReader, write, writeappend, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransientgetModificationDate, getTag, setModificationDate, setTagcreateClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toStringpublic static final boolean XML_EXPANDING_ENTITY_REFS
public static final boolean XML_VALIDATING_DTD
public JacksonRepresentation(MediaType mediaType, T object)
mediaType - The target media type.object - The object to format.public JacksonRepresentation(Representation representation, java.lang.Class<T> objectClass)
representation - The representation to parse.objectClass - The object class to instantiate.public JacksonRepresentation(T object)
object - The object to format.protected com.fasterxml.jackson.dataformat.csv.CsvSchema createCsvSchema(com.fasterxml.jackson.dataformat.csv.CsvMapper csvMapper)
csvMapper - The source CSV mapper.protected com.fasterxml.jackson.databind.ObjectMapper createObjectMapper()
protected com.fasterxml.jackson.databind.ObjectReader createObjectReader()
protected com.fasterxml.jackson.databind.ObjectWriter createObjectWriter()
public com.fasterxml.jackson.dataformat.csv.CsvSchema getCsvSchema()
public T getObject() throws java.io.IOException
java.io.IOExceptionpublic java.lang.Class<T> getObjectClass()
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public com.fasterxml.jackson.databind.ObjectReader getObjectReader()
public com.fasterxml.jackson.databind.ObjectWriter getObjectWriter()
public boolean isExpandingEntityRefs()
public boolean isValidatingDtd()
public void setCsvSchema(com.fasterxml.jackson.dataformat.csv.CsvSchema csvSchema)
csvSchema - The Jackson CSV schema.public void setExpandingEntityRefs(boolean expandEntityRefs)
expandEntityRefs - True if the parser will expand entity reference nodes.public void setObject(T object)
object - The object to format.public void setObjectClass(java.lang.Class<T> objectClass)
objectClass - The object class to instantiate.public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
objectMapper - The Jackson object mapper.public void setObjectReader(com.fasterxml.jackson.databind.ObjectReader objectReader)
objectReader - The Jackson object reader.public void setObjectWriter(com.fasterxml.jackson.databind.ObjectWriter objectWriter)
objectWriter - The Jackson object writer.public void setValidatingDtd(boolean validating)
validating - The new validation flag to set.public void write(java.io.OutputStream outputStream)
throws java.io.IOException
write in class Representationjava.io.IOExceptionCopyright © 2005-2024 Restlet.