T
- The type of collection that will be created.public abstract class AbstractCollectionFormInjector<T> extends PrefixedFormInjector
NestedFormInjector
that can inject collections.Modifier and Type | Field and Description |
---|---|
private java.lang.Class |
collectionType |
private java.util.regex.Pattern |
pattern |
Modifier | Constructor and Description |
---|---|
protected |
AbstractCollectionFormInjector(java.lang.Class collectionType,
java.lang.Class genericType,
java.lang.String prefix,
java.util.regex.Pattern pattern,
ResteasyProviderFactory factory)
Creates an injector to inject a collection.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addTo(T collection,
java.lang.String key,
java.lang.Object value)
Adds the item to the collection.
|
protected abstract T |
createInstance(java.lang.Class collectionType)
Creates an instance of the collection type.
|
private java.util.Set<java.lang.String> |
findMatchingPrefixesWithNoneEmptyValues(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> parameters)
Finds all field names that follow the pattern.
|
java.lang.Object |
inject(HttpRequest request,
HttpResponse response)
Inject inside the context of an HTTP request.
|
doInject, hasValue
inject
private final java.lang.Class collectionType
private final java.util.regex.Pattern pattern
protected AbstractCollectionFormInjector(java.lang.Class collectionType, java.lang.Class genericType, java.lang.String prefix, java.util.regex.Pattern pattern, ResteasyProviderFactory factory)
collectionType
- The type of collection to return.genericType
- The type of elements in the collection.pattern
- 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.public java.lang.Object inject(HttpRequest request, HttpResponse response)
inject
in interface ValueInjector
inject
in class PrefixedFormInjector
private java.util.Set<java.lang.String> findMatchingPrefixesWithNoneEmptyValues(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> parameters)
protected abstract T createInstance(java.lang.Class collectionType)
protected abstract void addTo(T collection, java.lang.String key, java.lang.Object value)