org.glassfish.jersey.model
Class ContractProvider.Builder

java.lang.Object
  extended by org.glassfish.jersey.model.ContractProvider.Builder
Enclosing class:
ContractProvider

public static final class ContractProvider.Builder
extends Object

Contract provider model builder.


Method Summary
 ContractProvider.Builder addContract(Class<?> contract)
          Add a new provided contract.
 ContractProvider.Builder addContract(Class<?> contract, int priority)
          Add a new provided contract with priority.
 ContractProvider.Builder addContracts(Collection<Class<?>> contracts)
          Add a new provided contracts.
 ContractProvider.Builder addContracts(Map<Class<?>,Integer> contracts)
          Add a new provided contracts.
 ContractProvider.Builder addNameBinding(Class<? extends Annotation> binding)
          Add a new contract provider name binding.
 ContractProvider build()
          Build a new contract provider model.
 ContractProvider.Builder defaultPriority(int defaultPriority)
          Set the contract default provider priority.
 ContractProvider.Builder scope(Class<? extends Annotation> scope)
          Change contract provider scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

scope

public ContractProvider.Builder scope(Class<? extends Annotation> scope)
Change contract provider scope. (Default scope is Singleton.)

Parameters:
scope - contract provider scope.
Returns:
updated builder.

addContract

public ContractProvider.Builder addContract(Class<?> contract)
Add a new provided contract.

Parameters:
contract - additional provided contract.
Returns:
updated builder.

addContract

public ContractProvider.Builder addContract(Class<?> contract,
                                            int priority)
Add a new provided contract with priority.

Parameters:
contract - additional provided contract.
priority - priority for the contract.
Returns:
updated builder.

addContracts

public ContractProvider.Builder addContracts(Map<Class<?>,Integer> contracts)
Add a new provided contracts.

Parameters:
contracts - additional provided contracts.
Returns:
updated builder.

addContracts

public ContractProvider.Builder addContracts(Collection<Class<?>> contracts)
Add a new provided contracts.

Parameters:
contracts - additional provided contracts.
Returns:
updated builder.

defaultPriority

public ContractProvider.Builder defaultPriority(int defaultPriority)
Set the contract default provider priority. (Default value is ContractProvider.NO_PRIORITY)

Parameters:
defaultPriority - default contract provider priority.
Returns:
updated builder.

addNameBinding

public ContractProvider.Builder addNameBinding(Class<? extends Annotation> binding)
Add a new contract provider name binding.

Parameters:
binding - name binding.
Returns:
updated builder.

build

public ContractProvider build()
Build a new contract provider model.

Returns:
new contract provider model.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.