T
- The type of collection that will be created.public abstract class AbstractCollectionFormInjector<T> extends PrefixedFormInjector
ValueInjector
that can inject collections.Modifier | Constructor and Description |
---|---|
protected |
AbstractCollectionFormInjector(Class collectionType,
Class genericType,
String prefix,
Pattern pattern,
ResteasyProviderFactory factory)
Creates an injector to inject a collection.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addTo(T collection,
String key,
Object value)
Adds the item to the collection.
|
protected abstract T |
createInstance(Class collectionType)
Creates an instance of the collection type.
|
Object |
inject(HttpRequest request,
HttpResponse response)
Inject inside the context of an HTTP request.
|
doInject, hasValue
inject
protected AbstractCollectionFormInjector(Class collectionType, Class genericType, String prefix, Pattern pattern, ResteasyProviderFactory factory)
collectionType
- The type of collection to return.genericType
- The type of elements in the collection.prefix
- prefixpattern
- The pattern that a field name should follow to be a part of this collection. The first group in the pattern must be the index.factory
- provider factorypublic Object inject(HttpRequest request, HttpResponse response)
inject
in interface ValueInjector
inject
in class PrefixedFormInjector
request
- http requestresponse
- http responseprotected abstract T createInstance(Class collectionType)
collectionType
- collection typeCopyright © 2021 JBoss by Red Hat. All rights reserved.