Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <[email protected]>
  • Loading branch information
senivam committed Mar 21, 2019
1 parent 9cfc243 commit 8e1cea6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -481,18 +482,19 @@ public static ContractProvider modelFor(final Class<?> componentClass) {
* (if any).
* @param contractMap map of contracts and their binding priorities. If {@code null}, the contracts will
* gathered by introspecting the component class. Content of the contract map
* may be modified during the registration processing.
* may not be modified during the registration processing.
* @param modelEnhancer custom contract provider model enhancer.
* @return contract provider model for the class.
*/
private static ContractProvider modelFor(final Class<?> componentClass,
final int defaultPriority,
final Map<Class<?>, Integer> contractMap,
final Inflector<ContractProvider.Builder, ContractProvider> modelEnhancer) {
Map<Class<?>, Integer> contracts = contractMap;
if (contracts == null) { // introspect
Map<Class<?>, Integer> contracts;
if (contractMap == null) { // introspect
contracts = asMap(Providers.getProviderContracts(componentClass));
} else { // filter custom contracts
contracts = new HashMap<>(contractMap);
final Iterator<Class<?>> it = contracts.keySet().iterator();
while (it.hasNext()) {
final Class<?> contract = it.next();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.glassfish.jersey.spi;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotates custom configuration provided by external users.
*/

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
public @interface CustomConfiguration {
}

0 comments on commit 8e1cea6

Please sign in to comment.