public class SimpleGenericFieldFactory<T> extends AbstractGenericClassFactory<T>
hints| Constructor and Description |
|---|
SimpleGenericFieldFactory(Field field,
GenericTypeFactory<T> factory) |
| Modifier and Type | Method and Description |
|---|---|
T |
create(Class rawType,
Type[] actualTypeArguments)
Creates an instance of
rawType, given its actual type arguments actualTypeArguments
See CollectionFactory for an example of generic type instantiation |
T |
create(Field field) |
boolean |
supports(Class clazz)
Checks if this ClassFactory is targetted at a specific Class
|
boolean |
supports(Class clazz,
Type genericType)
Checks if this ClassFactory supports the generic creation of clazz, given its possible generic type genericType
Generic type has 3 possible values
|
boolean |
supports(Field field)
Checks if this ClassFactory is targetted at a specific field (can check for generics, annotations etc)
|
getHint, putHint, removeHintclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitputHintremoveHintpublic SimpleGenericFieldFactory(Field field, GenericTypeFactory<T> factory)
public boolean supports(Class clazz)
ClassFactorysupports in interface ClassFactory<T>supports in class AbstractGenericClassFactory<T>clazz - The class to check support againsttrue if this ClassFactory supports the clazz requested to be created, false otherwisepublic boolean supports(Field field)
ClassFactorysupports in interface ClassFactory<T>supports in class AbstractGenericClassFactory<T>field - The field to check support againsttrue if this ClassFactory supports the field requested to be created, false otherwisepublic boolean supports(Class clazz, Type genericType)
GenericClassFactoryclazz - The class to creategenericType - The generic type of the declared class, which has 3 possible value types:true if this provider can create an instance (or generic instance) of the class in question, or false otherwisepublic T create(Field field)
field - The field to create an instance ofT that this class is a factory forpublic T create(Class rawType, Type[] actualTypeArguments)
GenericClassFactoryrawType, given its actual type arguments actualTypeArguments
See CollectionFactory for an example of generic type instantiationrawType - The raw class of the type being created. (Map, List, Set etc)actualTypeArguments - the declared generic types for the class being createdT that this class is a factory forCollectionFactoryCopyright © 2016. All rights reserved.