Java 类com.google.inject.internal.ExposureBuilder 实例源码

项目:guice    文件:Elements.java   
private <T> AnnotatedElementBuilder exposeInternal(Key<T> key) {
  if (privateElements == null) {
    addError(
        "Cannot expose %s on a standard binder. "
            + "Exposed bindings are only applicable to private binders.",
        key);
    return new AnnotatedElementBuilder() {
      @Override
      public void annotatedWith(Class<? extends Annotation> annotationType) {}

      @Override
      public void annotatedWith(Annotation annotation) {}
    };
  }

  ExposureBuilder<T> builder =
      new ExposureBuilder<T>(this, getElementSource(), MoreTypes.canonicalizeKey(key));
  privateElements.addExposureBuilder(builder);
  return builder;
}
项目:guice-old    文件:Elements.java   
private <T> AnnotatedElementBuilder exposeInternal(Key<T> key) {
  if (privateElements == null) {
    addError("Cannot expose %s on a standard binder. "
        + "Exposed bindings are only applicable to private binders.", key);
    return new AnnotatedElementBuilder() {
      public void annotatedWith(Class<? extends Annotation> annotationType) {}
      public void annotatedWith(Annotation annotation) {}
    };
  }

  ExposureBuilder<T> builder = new ExposureBuilder<T>(this, getElementSource(), key);
  privateElements.addExposureBuilder(builder);
  return builder;
}
项目:google-guice    文件:Elements.java   
private <T> AnnotatedElementBuilder exposeInternal(Key<T> key) {
  if (privateElements == null) {
    addError("Cannot expose %s on a standard binder. "
        + "Exposed bindings are only applicable to private binders.", key);
    return new AnnotatedElementBuilder() {
      public void annotatedWith(Class<? extends Annotation> annotationType) {}
      public void annotatedWith(Annotation annotation) {}
    };
  }

  ExposureBuilder<T> builder = new ExposureBuilder<T>(this, getSource(), key);
  privateElements.addExposureBuilder(builder);
  return builder;
}