Class Binding<T,D extends Binding>
- java.lang.Object
-
- org.glassfish.jersey.internal.inject.Binding<T,D>
-
- Type Parameters:
T
- type of the bean described by this injection binding.D
- concrete injection binding implementation type.
- Direct Known Subclasses:
ClassBinding
,InjectionResolverBinding
,InstanceBinding
,SupplierClassBinding
,SupplierInstanceBinding
public abstract class Binding<T,D extends Binding> extends java.lang.Object
Abstract injection binding description of a bean.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<AliasBinding>
aliases
private java.lang.String
analyzer
private java.util.Set<java.lang.reflect.Type>
contracts
private java.lang.Class<T>
implementationType
private java.lang.String
name
private java.lang.Boolean
proxiable
private java.lang.Boolean
proxyForSameScope
private java.util.Set<java.lang.annotation.Annotation>
qualifiers
private java.lang.Integer
ranked
private java.lang.Class<? extends java.lang.annotation.Annotation>
scope
-
Constructor Summary
Constructors Constructor Description Binding()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AliasBinding
addAlias(java.lang.Class<?> contract)
Adds service's alias.D
analyzeWith(java.lang.String analyzer)
Adds service's analyzer.(package private) D
asType(java.lang.Class type)
Adds service's type.java.util.Set<AliasBinding>
getAliases()
Gets service's aliases.java.lang.String
getAnalyzer()
Gets service's analyzer.java.util.Set<java.lang.reflect.Type>
getContracts()
Gets service's contracts.java.lang.Class<T>
getImplementationType()
Gets service's type.java.lang.String
getName()
Gets service's name.java.util.Set<java.lang.annotation.Annotation>
getQualifiers()
Gets service's qualifiers.java.lang.Integer
getRank()
Gets rank of the service.java.lang.Class<? extends java.lang.annotation.Annotation>
getScope()
Gets service's scope.D
in(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)
Adds service's scope.java.lang.Boolean
isProxiable()
Gets information whether the service is proxiable.java.lang.Boolean
isProxiedForSameScope()
Gets information whether the service creates the proxy for the same scope.D
named(java.lang.String name)
Adds service's name.D
proxy(boolean proxiable)
Adds information about proxy creation.D
proxyForSameScope(boolean proxyForSameScope)
Adds information about proxy creation when the service is in the same scope.D
qualifiedBy(java.lang.annotation.Annotation annotation)
Adds service's qualifier.void
ranked(int rank)
Adds service's rank.D
to(java.lang.Class<? super T> contract)
Adds service's contract.D
to(java.lang.reflect.Type contract)
Adds service's contract.D
to(java.util.Collection<java.lang.Class<? super T>> contracts)
Adds service's contracts.D
to(javax.ws.rs.core.GenericType<?> contract)
Adds service's contract.
-
-
-
Field Detail
-
contracts
private final java.util.Set<java.lang.reflect.Type> contracts
-
qualifiers
private final java.util.Set<java.lang.annotation.Annotation> qualifiers
-
aliases
private final java.util.Set<AliasBinding> aliases
-
scope
private java.lang.Class<? extends java.lang.annotation.Annotation> scope
-
name
private java.lang.String name
-
implementationType
private java.lang.Class<T> implementationType
-
analyzer
private java.lang.String analyzer
-
proxiable
private java.lang.Boolean proxiable
-
proxyForSameScope
private java.lang.Boolean proxyForSameScope
-
ranked
private java.lang.Integer ranked
-
-
Method Detail
-
isProxiable
public java.lang.Boolean isProxiable()
Gets information whether the service is proxiable.- Returns:
true
if the service is proxiable.
-
isProxiedForSameScope
public java.lang.Boolean isProxiedForSameScope()
Gets information whether the service creates the proxy for the same scope.- Returns:
true
if the service creates the proxy for the same scop.
-
getRank
public java.lang.Integer getRank()
Gets rank of the service.- Returns:
- service's rank.
-
getContracts
public java.util.Set<java.lang.reflect.Type> getContracts()
Gets service's contracts.- Returns:
- service's contracts.
-
getQualifiers
public java.util.Set<java.lang.annotation.Annotation> getQualifiers()
Gets service's qualifiers.- Returns:
- service's qualifiers.
-
getScope
public java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
Gets service's scope.- Returns:
- service's scope.
-
getName
public java.lang.String getName()
Gets service's name.- Returns:
- service's name.
-
getImplementationType
public java.lang.Class<T> getImplementationType()
Gets service's type.- Returns:
- service's type.
-
getAnalyzer
public java.lang.String getAnalyzer()
Gets service's analyzer.- Returns:
- service's analyzer.
-
getAliases
public java.util.Set<AliasBinding> getAliases()
Gets service's aliases.- Returns:
- service's aliases.
-
analyzeWith
public D analyzeWith(java.lang.String analyzer)
Adds service's analyzer.- Returns:
- current instance.
-
to
public D to(java.util.Collection<java.lang.Class<? super T>> contracts)
Adds service's contracts.- Returns:
- current instance.
-
to
public D to(java.lang.Class<? super T> contract)
Adds service's contract.- Returns:
- current instance.
-
to
public D to(javax.ws.rs.core.GenericType<?> contract)
Adds service's contract.- Returns:
- current instance.
-
to
public D to(java.lang.reflect.Type contract)
Adds service's contract.- Returns:
- current instance.
-
qualifiedBy
public D qualifiedBy(java.lang.annotation.Annotation annotation)
Adds service's qualifier.- Returns:
- current instance.
-
in
public D in(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)
Adds service's scope.- Returns:
- current instance.
-
named
public D named(java.lang.String name)
Adds service's name.- Returns:
- current instance.
-
addAlias
public AliasBinding addAlias(java.lang.Class<?> contract)
Adds service's alias.- Parameters:
contract
- contract of the alias.- Returns:
- instance of a new alias for this binding descriptor that can be further specified.
-
proxy
public D proxy(boolean proxiable)
Adds information about proxy creation.- Returns:
- current instance.
-
proxyForSameScope
public D proxyForSameScope(boolean proxyForSameScope)
Adds information about proxy creation when the service is in the same scope.- Returns:
- current instance.
-
ranked
public void ranked(int rank)
Adds service's rank.
-
asType
D asType(java.lang.Class type)
Adds service's type.- Returns:
- current instance.
-
-