Package net.solarnetwork.web.support
Class SimpleCsvHttpMessageConverter
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<Object>
net.solarnetwork.web.support.SimpleCsvHttpMessageConverter
- All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<Object>
public class SimpleCsvHttpMessageConverter
extends org.springframework.http.converter.AbstractHttpMessageConverter<Object>
HttpMessageConverter that marshals objects into CSV documents.- Version:
- 1.3
- Author:
- matt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]The default value for thejavaBeanIgnorePropertiesproperty.static final Class<?>[]The default value for thejavaBeanTreatAsStringValuesproperty.Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the JavaBean properties to ignore.Get the JavaBean classes to treat as strings.net.solarnetwork.codec.PropertySerializerRegistrarGet the property serializer registrar.booleanGet the "include header" option.protected ObjectreadInternal(Class<? extends Object> clazz, org.springframework.http.HttpInputMessage inputMessage) voidsetIncludeHeader(boolean includeHeader) Set the "include header" option.voidsetJavaBeanIgnoreProperties(Set<String> javaBeanIgnoreProperties) Set the JavaBean properties to ignore.voidsetJavaBeanTreatAsStringValues(Set<Class<?>> javaBeanTreatAsStringValues) Set the JavaBean classes to treat as strings.voidsetPropertySerializerRegistrar(net.solarnetwork.codec.PropertySerializerRegistrar propertySerializerRegistrar) Set the property serializer registrar.protected booleanprotected voidwriteInternal(Object t, org.springframework.http.HttpOutputMessage outputMessage) Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
-
Field Details
-
DEFAULT_JAVA_BEAN_IGNORE_PROPERTIES
The default value for thejavaBeanIgnorePropertiesproperty. -
DEFAULT_JAVA_BEAN_STRING_VALUES
The default value for thejavaBeanTreatAsStringValuesproperty.
-
-
Constructor Details
-
SimpleCsvHttpMessageConverter
public SimpleCsvHttpMessageConverter()Default constructor.
-
-
Method Details
-
supports
- Specified by:
supportsin classorg.springframework.http.converter.AbstractHttpMessageConverter<Object>
-
readInternal
protected Object readInternal(Class<? extends Object> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException - Specified by:
readInternalin classorg.springframework.http.converter.AbstractHttpMessageConverter<Object>- Throws:
IOExceptionorg.springframework.http.converter.HttpMessageNotReadableException
-
writeInternal
protected void writeInternal(Object t, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException - Specified by:
writeInternalin classorg.springframework.http.converter.AbstractHttpMessageConverter<Object>- Throws:
IOExceptionorg.springframework.http.converter.HttpMessageNotWritableException
-
getPropertySerializerRegistrar
public net.solarnetwork.codec.PropertySerializerRegistrar getPropertySerializerRegistrar()Get the property serializer registrar.- Returns:
- the registrar
-
setPropertySerializerRegistrar
public void setPropertySerializerRegistrar(net.solarnetwork.codec.PropertySerializerRegistrar propertySerializerRegistrar) Set the property serializer registrar.- Parameters:
propertySerializerRegistrar- the registrar to set
-
getJavaBeanIgnoreProperties
Get the JavaBean properties to ignore.- Returns:
- the properties
-
setJavaBeanIgnoreProperties
Set the JavaBean properties to ignore.- Parameters:
javaBeanIgnoreProperties- the properties
-
getJavaBeanTreatAsStringValues
Get the JavaBean classes to treat as strings.- Returns:
- the class set
-
setJavaBeanTreatAsStringValues
Set the JavaBean classes to treat as strings.- Parameters:
javaBeanTreatAsStringValues- the class set
-
isIncludeHeader
public boolean isIncludeHeader()Get the "include header" option.- Returns:
- true to include a header row in the output; defaults to true
-
setIncludeHeader
public void setIncludeHeader(boolean includeHeader) Set the "include header" option.- Parameters:
includeHeader- true to include a header row in the output
-