public abstract class AbstractCollectionReflectionTranscoder extends Object implements ReflectionTranscoder
Collection
.Modifier and Type | Field and Description |
---|---|
private ArrayReflectionTranscoder |
arrayTranscoder
Used for collections that contain arrays.
|
private SingleValueReflectionTranscoder<?> |
singleValueTranscoder
Used for collections that do not contain arrays.
|
private Class<?> |
type
Type that is a collection.
|
Constructor and Description |
---|
AbstractCollectionReflectionTranscoder(Class<?> c,
ArrayReflectionTranscoder transcoder)
Creates a new abstract collection reflection transcoder.
|
AbstractCollectionReflectionTranscoder(Class<?> c,
SingleValueReflectionTranscoder<?> transcoder)
Creates a new abstract collection reflection transcoder.
|
Modifier and Type | Method and Description |
---|---|
protected abstract <T> Collection<T> |
createCollection(Class<T> clazz)
Returns a collection implementation of the correct type for this transcoder.
|
Object |
decodeBinaryValues(Collection<byte[]> values)
Decodes the supplied values into an object.
|
Object |
decodeStringValues(Collection<String> values)
Decodes the supplied values into an object.
|
Collection<byte[]> |
encodeBinaryValues(Object values)
Encodes the supplied value into one or more byte arrays for use in an attribute.
|
Collection<String> |
encodeStringValues(Object values)
Encodes the supplied value into one or more strings for use in an attribute.
|
Class<?> |
getType()
Returns the type produced by this transcoder.
|
boolean |
supports(Class<?> t)
Returns whether this transcoder can convert object of the supplied type.
|
String |
toString() |
private final Class<?> type
private final SingleValueReflectionTranscoder<?> singleValueTranscoder
private final ArrayReflectionTranscoder arrayTranscoder
public AbstractCollectionReflectionTranscoder(Class<?> c, SingleValueReflectionTranscoder<?> transcoder)
c
- class that is a collectiontranscoder
- to operate on elements of the collectionpublic AbstractCollectionReflectionTranscoder(Class<?> c, ArrayReflectionTranscoder transcoder)
c
- class that is a collectiontranscoder
- to operate on elements of the collectionpublic Object decodeStringValues(Collection<String> values)
ReflectionTranscoder
decodeStringValues
in interface ReflectionTranscoder
values
- to decodepublic Object decodeBinaryValues(Collection<byte[]> values)
ReflectionTranscoder
decodeBinaryValues
in interface ReflectionTranscoder
values
- to decodepublic Collection<String> encodeStringValues(Object values)
ReflectionTranscoder
encodeStringValues
in interface ReflectionTranscoder
values
- containing data to encode as stringspublic Collection<byte[]> encodeBinaryValues(Object values)
ReflectionTranscoder
encodeBinaryValues
in interface ReflectionTranscoder
values
- containing data to encode as byte arraysprotected abstract <T> Collection<T> createCollection(Class<T> clazz)
T
- type of collectionclazz
- type of collectionpublic Class<?> getType()
ReflectionTranscoder
getType
in interface ReflectionTranscoder
public boolean supports(Class<?> t)
ReflectionTranscoder
supports
in interface ReflectionTranscoder
t
- of objectCopyright © 2003-2019 Virginia Tech. All Rights Reserved.