public abstract class Lister<T>
extends java.lang.Object
List
, etc)
of items.Modifier and Type | Field and Description |
---|---|
private static java.lang.Class[] |
CONCRETE_TYPES |
java.lang.reflect.Type |
itemGenericType |
java.lang.Class |
itemType
Type of the individual item
|
protected java.util.Collection |
r |
Modifier | Constructor and Description |
---|---|
protected |
Lister(java.lang.Class itemType,
java.lang.reflect.Type itemGenericType) |
protected |
Lister(java.lang.Class itemType,
java.lang.reflect.Type itemGenericType,
java.util.Collection r) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object o) |
static <T> Lister<T> |
create(java.lang.Class<T> c,
java.lang.reflect.Type t)
Creates a
Lister instance that produces the given type. |
static Lister |
create(java.lang.reflect.Type t)
Creates a
Lister instance that produces the given type. |
abstract T |
toCollection() |
private static java.lang.IllegalAccessError |
toError(java.lang.IllegalAccessException e) |
private static java.lang.InstantiationError |
toError(java.lang.InstantiationException e) |
public final java.lang.Class itemType
public final java.lang.reflect.Type itemGenericType
protected final java.util.Collection r
private static final java.lang.Class[] CONCRETE_TYPES
protected Lister(java.lang.Class itemType, java.lang.reflect.Type itemGenericType)
protected Lister(java.lang.Class itemType, java.lang.reflect.Type itemGenericType, java.util.Collection r)
public void add(java.lang.Object o)
public abstract T toCollection()
public static Lister create(java.lang.reflect.Type t)
Lister
instance that produces the given type.public static <T> Lister<T> create(java.lang.Class<T> c, java.lang.reflect.Type t)
Lister
instance that produces the given type.c
- The erasure version of 't'. This is taken
as a parameter as a performance optimizaiton.java.lang.IllegalArgumentException
- if the given type does look like a collection yet this implementation
is not capable of how to handle it.private static java.lang.IllegalAccessError toError(java.lang.IllegalAccessException e)
private static java.lang.InstantiationError toError(java.lang.InstantiationException e)