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; }
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; }
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; }
BindAndExposeBindingBuilder(final AnnotatedBindingBuilder<T> bind, final AnnotatedElementBuilder expose) { this.bind = bind; this.expose = expose; }
@Override default AnnotatedElementBuilder expose(final Class<?> type) { return this.binder().expose(type); }
@Override default AnnotatedElementBuilder expose(final TypeLiteral<?> type) { return this.binder().expose(type); }
AnnotatedElementBuilderAdapter(AnnotatedElementBuilder builder) { this.guiceBuilder = builder; }
@Override public AnnotatedElementBuilder expose(Class<?> type) { return exposeInternal(Key.get(type)); }
@Override public AnnotatedElementBuilder expose(TypeLiteral<?> type) { return exposeInternal(Key.get(type)); }
public AnnotatedElementBuilder expose(Class<?> type) { return exposeInternal(Key.get(type)); }
public AnnotatedElementBuilder expose(TypeLiteral<?> type) { return exposeInternal(Key.get(type)); }
/** * Makes a binding for {@code type} available to other modules and the injector. Use {@link * AnnotatedElementBuilder#annotatedWith(Class) annotatedWith()} to expose {@code type} with a * binding annotation. */ protected final AnnotatedElementBuilder expose(Class<?> type) { return binder().expose(type); }
/** * Makes a binding for {@code type} available to other modules and the injector. Use {@link * AnnotatedElementBuilder#annotatedWith(Class) annotatedWith()} to expose {@code type} with a * binding annotation. */ protected final AnnotatedElementBuilder expose(TypeLiteral<?> type) { return binder().expose(type); }
/** * Makes a binding for {@code type} available to the enclosing environment. Use {@link * com.google.inject.binder.AnnotatedElementBuilder#annotatedWith(Class) annotatedWith()} to * expose {@code type} with a binding annotation. */ AnnotatedElementBuilder expose(Class<?> type);
/** * Makes a binding for {@code type} available to the enclosing environment. Use {@link * AnnotatedElementBuilder#annotatedWith(Class) annotatedWith()} to expose {@code type} with a * binding annotation. */ AnnotatedElementBuilder expose(TypeLiteral<?> type);
/** * Makes a binding for {@code type} available to the enclosing environment. Use {@link * com.google.inject.binder.AnnotatedElementBuilder#annotatedWith(Class) annotatedWith()} to expose {@code type} with a * binding annotation. */ AnnotatedElementBuilder expose(Class<?> type);