本文整理了Java中org.elasticsearch.common.inject.Key.getRawType()
方法的一些代码示例,展示了Key.getRawType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.getRawType()
方法的具体详情如下:
包路径:org.elasticsearch.common.inject.Key
类名称:Key
方法名:getRawType
暂无
代码示例来源:origin: org.elasticsearch/elasticsearch
private <T> void validateKey(Object source, Key<T> key) {
Annotations.checkForMisplacedScopeAnnotations(key.getRawType(), source, errors);
}
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
@SuppressWarnings("unchecked")
public T get(Errors errors, InternalContext context, Dependency<?> dependency)
throws ErrorsException {
if (constructorInjector == null) {
throw new IllegalStateException("Constructor not ready");
}
// This may not actually be safe because it could return a super type of T (if that's all the
// client needs), but it should be OK in practice thanks to the wonders of erasure.
return (T) constructorInjector.construct(errors, context, dependency.getKey().getRawType());
}
}
代码示例来源:origin: org.elasticsearch/elasticsearch
private void putBinding(BindingImpl<?> binding) {
Key<?> key = binding.getKey();
Class<?> rawType = key.getRawType();
if (FORBIDDEN_TYPES.contains(rawType)) {
errors.cannotBindToGuiceType(rawType.getSimpleName());
return;
}
Binding<?> original = injector.state.getExplicitBinding(key);
if (original != null && !isOkayDuplicate(original, binding)) {
errors.bindingAlreadySet(key, original.getSource());
return;
}
// prevent the parent from creating a JIT binding for this key
injector.state.parent().blacklist(key);
injector.state.putBinding(key, binding);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
private <T> void validateKey(Object source, Key<T> key) {
Annotations.checkForMisplacedScopeAnnotations(key.getRawType(), source, errors);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
private <T> void validateKey(Object source, Key<T> key) {
Annotations.checkForMisplacedScopeAnnotations(key.getRawType(), source, errors);
}
代码示例来源:origin: org.elasticsearch/elasticsearch
final Object source = command.getSource();
if (Void.class.equals(command.getKey().getRawType())) {
if (command instanceof ProviderInstanceBinding
&& ((ProviderInstanceBinding) command).getProviderInstance() instanceof ProviderMethod) {
代码示例来源:origin: apache/servicemix-bundles
private <T> void validateKey(Object source, Key<T> key) {
Annotations.checkForMisplacedScopeAnnotations(key.getRawType(), source, errors);
}
代码示例来源:origin: harbby/presto-connectors
private <T> void validateKey(Object source, Key<T> key) {
Annotations.checkForMisplacedScopeAnnotations(key.getRawType(), source, errors);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
@SuppressWarnings("unchecked")
public T get(Errors errors, InternalContext context, Dependency<?> dependency)
throws ErrorsException {
if (constructorInjector == null) {
throw new IllegalStateException("Constructor not ready");
}
// This may not actually be safe because it could return a super type of T (if that's all the
// client needs), but it should be OK in practice thanks to the wonders of erasure.
return (T) constructorInjector.construct(errors, context, dependency.getKey().getRawType());
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
@SuppressWarnings("unchecked")
public T get(Errors errors, InternalContext context, Dependency<?> dependency)
throws ErrorsException {
if (constructorInjector == null) {
throw new IllegalStateException("Constructor not ready");
}
// This may not actually be safe because it could return a super type of T (if that's all the
// client needs), but it should be OK in practice thanks to the wonders of erasure.
return (T) constructorInjector.construct(errors, context, dependency.getKey().getRawType());
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
@SuppressWarnings("unchecked")
public T get(Errors errors, InternalContext context, Dependency<?> dependency)
throws ErrorsException {
if (constructorInjector == null) {
throw new IllegalStateException("Constructor not ready");
}
// This may not actually be safe because it could return a super type of T (if that's all the
// client needs), but it should be OK in practice thanks to the wonders of erasure.
return (T) constructorInjector.construct(errors, context, dependency.getKey().getRawType());
}
}
代码示例来源:origin: harbby/presto-connectors
@Override
@SuppressWarnings("unchecked")
public T get(Errors errors, InternalContext context, Dependency<?> dependency)
throws ErrorsException {
checkState(constructorInjector != null, "Constructor not ready");
// This may not actually be safe because it could return a super type of T (if that's all the
// client needs), but it should be OK in practice thanks to the wonders of erasure.
return (T) constructorInjector.construct(errors, context, dependency.getKey().getRawType());
}
}
代码示例来源:origin: com.strapdata.elasticsearch.test/framework
if (element instanceof InstanceBinding) {
InstanceBinding binding = (InstanceBinding) element;
if (binding.getKey().getRawType().equals(valueType)) {
values.put(binding.getKey(), (V) binding.getInstance());
} else if (binding.getInstance() instanceof Map.Entry) {
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
private void putBinding(BindingImpl<?> binding) {
Key<?> key = binding.getKey();
Class<?> rawType = key.getRawType();
if (FORBIDDEN_TYPES.contains(rawType)) {
errors.cannotBindToGuiceType(rawType.getSimpleName());
return;
}
Binding<?> original = injector.state.getExplicitBinding(key);
if (original != null && !isOkayDuplicate(original, binding)) {
errors.bindingAlreadySet(key, original.getSource());
return;
}
// prevent the parent from creating a JIT binding for this key
injector.state.parent().blacklist(key);
injector.state.putBinding(key, binding);
}
代码示例来源:origin: harbby/presto-connectors
private void putBinding(BindingImpl<?> binding) {
Key<?> key = binding.getKey();
Class<?> rawType = key.getRawType();
if (FORBIDDEN_TYPES.contains(rawType)) {
errors.cannotBindToGuiceType(rawType.getSimpleName());
return;
}
Binding<?> original = injector.state.getExplicitBinding(key);
if (original != null && !isOkayDuplicate(original, binding)) {
errors.bindingAlreadySet(key, original.getSource());
return;
}
// prevent the parent from creating a JIT binding for this key
injector.state.parent().blacklist(key);
injector.state.putBinding(key, binding);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
private void putBinding(BindingImpl<?> binding) {
Key<?> key = binding.getKey();
Class<?> rawType = key.getRawType();
if (FORBIDDEN_TYPES.contains(rawType)) {
errors.cannotBindToGuiceType(rawType.getSimpleName());
return;
}
Binding<?> original = injector.state.getExplicitBinding(key);
if (original != null && !isOkayDuplicate(original, binding)) {
errors.bindingAlreadySet(key, original.getSource());
return;
}
// prevent the parent from creating a JIT binding for this key
injector.state.parent().blacklist(key);
injector.state.putBinding(key, binding);
}
代码示例来源:origin: apache/servicemix-bundles
private void putBinding(BindingImpl<?> binding) {
Key<?> key = binding.getKey();
Class<?> rawType = key.getRawType();
if (FORBIDDEN_TYPES.contains(rawType)) {
errors.cannotBindToGuiceType(rawType.getSimpleName());
return;
}
Binding<?> original = injector.state.getExplicitBinding(key);
if (original != null && !isOkayDuplicate(original, binding)) {
errors.bindingAlreadySet(key, original.getSource());
return;
}
// prevent the parent from creating a JIT binding for this key
injector.state.parent().blacklist(key);
injector.state.putBinding(key, binding);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
final Object source = command.getSource();
if (Void.class.equals(command.getKey().getRawType())) {
if (command instanceof ProviderInstanceBinding
&& ((ProviderInstanceBinding) command).getProviderInstance() instanceof ProviderMethod) {
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
final Object source = command.getSource();
if (Void.class.equals(command.getKey().getRawType())) {
if (command instanceof ProviderInstanceBinding
&& ((ProviderInstanceBinding) command).getProviderInstance() instanceof ProviderMethod) {
代码示例来源:origin: apache/servicemix-bundles
final Object source = command.getSource();
if (Void.class.equals(command.getKey().getRawType())) {
if (command instanceof ProviderInstanceBinding
&& ((ProviderInstanceBinding) command).getProviderInstance() instanceof ProviderMethod) {
内容来源于网络,如有侵权,请联系作者删除!