当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationException.getPartialValue方法代码示例

本文整理汇总了Java中com.google.inject.ConfigurationException.getPartialValue方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationException.getPartialValue方法的具体用法?Java ConfigurationException.getPartialValue怎么用?Java ConfigurationException.getPartialValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.inject.ConfigurationException的用法示例。


在下文中一共展示了ConfigurationException.getPartialValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toInstance

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
@Override
public void toInstance(T instance) {
  checkNotTargetted();

  // lookup the injection points, adding any errors to the binder's errors list
  Set<InjectionPoint> injectionPoints;
  if (instance != null) {
    try {
      injectionPoints = InjectionPoint.forInstanceMethodsAndFields(instance.getClass());
    } catch (ConfigurationException e) {
      copyErrorsToBinder(e);
      injectionPoints = e.getPartialValue();
    }
  } else {
    binder.addError(BINDING_TO_NULL);
    injectionPoints = ImmutableSet.of();
  }

  BindingImpl<T> base = getBinding();
  setBinding(
      new InstanceBindingImpl<T>(
          base.getSource(), base.getKey(), Scoping.EAGER_SINGLETON, injectionPoints, instance));
}
 
开发者ID:google,项目名称:guice,代码行数:24,代码来源:BindingBuilder.java

示例2: toProvider

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
@Override
public BindingBuilder<T> toProvider(javax.inject.Provider<? extends T> provider) {
  checkNotNull(provider, "provider");
  checkNotTargetted();

  // lookup the injection points, adding any errors to the binder's errors list
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints = InjectionPoint.forInstanceMethodsAndFields(provider.getClass());
  } catch (ConfigurationException e) {
    copyErrorsToBinder(e);
    injectionPoints = e.getPartialValue();
  }

  BindingImpl<T> base = getBinding();
  setBinding(
      new ProviderInstanceBindingImpl<T>(
          base.getSource(), base.getKey(), base.getScoping(), injectionPoints, provider));
  return this;
}
 
开发者ID:google,项目名称:guice,代码行数:21,代码来源:BindingBuilder.java

示例3: validate

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
void validate() {
  Errors errorsForMember = errors.withSource(source);
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints = request.getInjectionPoints();
  } catch (ConfigurationException e) {
    errorsForMember.merge(e.getErrorMessages());
    injectionPoints = e.getPartialValue();
  }
  if (injectionPoints != null) {
    memberInjectors =
        injector.membersInjectorStore.getInjectors(injectionPoints, errorsForMember);
  } else {
    memberInjectors = ImmutableList.of();
  }

  errors.merge(errorsForMember);
}
 
开发者ID:google,项目名称:guice,代码行数:19,代码来源:InjectionRequestProcessor.java

示例4: toInstance

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
public void toInstance(T instance) {
  checkNotTargetted();

  // lookup the injection points, adding any errors to the binder's errors list
  Set<InjectionPoint> injectionPoints;
  if (instance != null) {
    try {
      injectionPoints = InjectionPoint.forInstanceMethodsAndFields(instance.getClass());
    } catch (ConfigurationException e) {
      copyErrorsToBinder(e);
      injectionPoints = e.getPartialValue();
    }
  } else {
    binder.addError(BINDING_TO_NULL);
    injectionPoints = ImmutableSet.of();
  }

  BindingImpl<T> base = getBinding();
  setBinding(new InstanceBindingImpl<T>(
      base.getSource(), base.getKey(), Scoping.EAGER_SINGLETON, injectionPoints, instance));
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:22,代码来源:BindingBuilder.java

示例5: toProvider

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
public BindingBuilder<T> toProvider(javax.inject.Provider<? extends T> provider) {
  checkNotNull(provider, "provider");
  checkNotTargetted();

  // lookup the injection points, adding any errors to the binder's errors list
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints = InjectionPoint.forInstanceMethodsAndFields(provider.getClass());
  } catch (ConfigurationException e) {
    copyErrorsToBinder(e);
    injectionPoints = e.getPartialValue();
  }

  BindingImpl<T> base = getBinding();
  setBinding(new ProviderInstanceBindingImpl<T>(
      base.getSource(), base.getKey(), base.getScoping(), injectionPoints, provider));
  return this;
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:19,代码来源:BindingBuilder.java

示例6: validate

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
void validate() {
  Errors errorsForMember = errors.withSource(source);
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints = request.getInjectionPoints();
  } catch (ConfigurationException e) {
    errorsForMember.merge(e.getErrorMessages());
    injectionPoints = e.getPartialValue();
  }
  if (injectionPoints != null) {
    memberInjectors = injector.membersInjectorStore.getInjectors(
        injectionPoints, errorsForMember);
  } else {
    memberInjectors = ImmutableList.of();
  }
  
  errors.merge(errorsForMember);
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:19,代码来源:InjectionRequestProcessor.java

示例7: toProvider

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
public BindingBuilder<T> toProvider(Provider<? extends T> provider) {
  checkNotNull(provider, "provider");
  checkNotTargetted();

  // lookup the injection points, adding any errors to the binder's errors list
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints = InjectionPoint.forInstanceMethodsAndFields(provider.getClass());
  } catch (ConfigurationException e) {
    copyErrorsToBinder(e);
    injectionPoints = e.getPartialValue();
  }

  BindingImpl<T> base = getBinding();
  setBinding(new ProviderInstanceBindingImpl<T>(
      base.getSource(), base.getKey(), base.getScoping(), injectionPoints, provider));
  return this;
}
 
开发者ID:utopiazh,项目名称:google-guice,代码行数:19,代码来源:BindingBuilder.java

示例8: ProviderInstanceAdapter

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
ProviderInstanceAdapter(ContextSensitiveProvider<? extends T> instance) {
    this.instance = instance;

    Set<InjectionPoint> injectionPoints;
    try {
        injectionPoints = InjectionPoint.forInstanceMethodsAndFields(instance.getClass());
    } catch (ConfigurationException e) {
        // We can ignore the error, the earlier requestInjection(instance) call will have reported it
        injectionPoints = e.getPartialValue();
    }
    this.injectionPoints = injectionPoints;
}
 
开发者ID:tavianator,项目名称:sangria,代码行数:13,代码来源:ContextSensitiveBinder.java

示例9: visit

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
@Override
public Boolean visit(InjectionRequest<?> request) {
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints = request.getInjectionPoints();
  } catch (ConfigurationException e) {
    errors.merge(e.getErrorMessages());
    injectionPoints = e.getPartialValue();
  }

  initializer.requestInjection(
      injector, request.getInstance(), null, request.getSource(), injectionPoints);
  return true;
}
 
开发者ID:google,项目名称:guice,代码行数:15,代码来源:InjectionRequestProcessor.java

示例10: visit

import com.google.inject.ConfigurationException; //导入方法依赖的package包/类
@Override public Boolean visit(InjectionRequest<?> request) {
  Set<InjectionPoint> injectionPoints;
  try {
    injectionPoints = request.getInjectionPoints();
  } catch (ConfigurationException e) {
    errors.merge(e.getErrorMessages());
    injectionPoints = e.getPartialValue();
  }

  initializer.requestInjection(
      injector, request.getInstance(), null, request.getSource(), injectionPoints);
  return true;
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:14,代码来源:InjectionRequestProcessor.java


注:本文中的com.google.inject.ConfigurationException.getPartialValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。