本文整理匯總了Java中javax.enterprise.inject.spi.InjectionPoint.getQualifiers方法的典型用法代碼示例。如果您正苦於以下問題:Java InjectionPoint.getQualifiers方法的具體用法?Java InjectionPoint.getQualifiers怎麽用?Java InjectionPoint.getQualifiers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.enterprise.inject.spi.InjectionPoint
的用法示例。
在下文中一共展示了InjectionPoint.getQualifiers方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getName
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
private String getName(InjectionPoint injectionPoint) {
for (Annotation qualifier : injectionPoint.getQualifiers()) {
if (qualifier.annotationType().equals(ConfigProperty.class)) {
ConfigProperty configProperty = ((ConfigProperty)qualifier);
return ConfigExtension.getConfigKey(injectionPoint, configProperty);
}
}
return null;
}
示例2: getDefaultValue
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
private String getDefaultValue(InjectionPoint injectionPoint) {
for (Annotation qualifier : injectionPoint.getQualifiers()) {
if (qualifier.annotationType().equals(ConfigProperty.class)) {
return ((ConfigProperty) qualifier).defaultValue();
}
}
return null;
}
示例3: getConfiguration
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
/**
*
* @param injectionPoint <p>
* @return
*/
@Produces
@GlobalConfiguration( "" )
@Dependent
Configuration getConfiguration( InjectionPoint injectionPoint )
{
for( Annotation a : injectionPoint.getQualifiers() )
{
if( a instanceof GlobalConfiguration )
{
return getConfiguration( ((GlobalConfiguration) a).value() );
}
}
return getConfiguration( "default" );
}
示例4: getDataSource
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
@Produces
@Database("")
DataSource getDataSource( InjectionPoint injectionPoint )
{
for( Annotation a: injectionPoint.getQualifiers() ) {
if( a instanceof Database ) {
return getDataSource( ((Database) a).value() );
}
}
throw new IllegalArgumentException( "Unable to inject unnamed DataSource" );
}
示例5: getName
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
String getName(InjectionPoint ip) {
String name = null;
for (Annotation ann : ip.getQualifiers()) {
if (ann instanceof Claim) {
Claim claim = (Claim) ann;
name = claim.standard() == Claims.UNKNOWN ? claim.value() : claim.standard().name();
}
}
return name;
}
示例6: getName
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
private String getName(InjectionPoint injectionPoint) {
for (Annotation qualifier : injectionPoint.getQualifiers()) {
if (qualifier.annotationType().equals(Claim.class)) {
// Check for a non-default value
Claim claim = (Claim) qualifier;
String name = claim.standard() == Claims.UNKNOWN ? claim.value() : claim.standard().name();
if (name.length() == 0) {
//
name = injectionPoint.getMember().getName();
}
return name;
}
}
return null;
}
示例7: getName
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
private String getName(InjectionPoint injectionPoint) {
for (Annotation qualifier : injectionPoint.getQualifiers()) {
if (qualifier.annotationType().equals(ConfigurationValue.class)) {
return ((ConfigurationValue) qualifier).value();
}
}
return null;
}
示例8: selectContext
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
private static <T extends CamelContext> T selectContext(InjectionPoint ip, Instance<T> instance, CdiCamelExtension extension) {
Collection<Annotation> qualifiers = new HashSet<>(ip.getQualifiers());
qualifiers.retainAll(extension.getContextQualifiers());
if (qualifiers.isEmpty() && !instance.select(DEFAULT).isUnsatisfied()) {
return instance.select(DEFAULT).get();
}
return instance.select(qualifiers.stream().toArray(Annotation[]::new)).get();
}
示例9: SimpleBean
import javax.enterprise.inject.spi.InjectionPoint; //導入方法依賴的package包/類
public SimpleBean(Class clazz, Class<? extends Annotation> scope, InjectionPoint ip, Supplier<T> supplier) {
this(clazz, scope, Collections.singleton(ip.getType()), ip.getQualifiers(), supplier);
}