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; }