當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。