Add missing @since methods

PiperOrigin-RevId: 359326331
This commit is contained in:
Guice Team
2021-02-24 11:11:23 -08:00
committed by Guice Team
parent 96e835f098
commit 6fa83e476a
9 changed files with 31 additions and 4 deletions
@@ -62,6 +62,7 @@ import java.lang.annotation.Target;
* }</pre>
*
* @author vzm@google.com (Vladimir Makaric)
* @since 5.0
*/
@Inherited
@Retention(RUNTIME)
@@ -78,6 +79,8 @@ public @interface RestrictedBindingSource {
* Meta-annotation indicating that the target annotation is a permit for binding restricted
* bindings. Annotating a binding source (defined in top-level javadoc) with a permit gives it
* permission to bind the restricted bindings guarded by the permit (see {@link #permits}).
*
* @since 5.0
*/
@Documented
@Retention(RUNTIME)
@@ -103,7 +106,11 @@ public @interface RestrictedBindingSource {
*/
String exemptModules() default "";
/** Level of restriction. Determines how violations are handled. */
/**
* Level of restriction. Determines how violations are handled.
*
* @since 5.0
*/
public static enum RestrictionLevel {
WARNING,
ERROR;
@@ -13,6 +13,7 @@ import com.google.inject.RestrictedBindingSource;
import com.google.inject.RestrictedBindingSource.RestrictionLevel;
import com.google.inject.internal.Errors;
import com.google.inject.internal.GuiceInternal;
import java.util.regex.Pattern;
import java.lang.annotation.Annotation;
import java.util.ArrayDeque;
import java.util.Arrays;
@@ -22,7 +23,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.regex.Pattern;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Stream;
@@ -45,6 +45,7 @@ import java.util.stream.StreamSupport;
* which happens on a single thread.
*
* @author vzm@google.com (Vladimir Makaric)
* @since 5.0
*/
public final class BindingSourceRestriction {
private BindingSourceRestriction() {}
@@ -125,6 +125,8 @@ public final class Elements {
*
* <p>Using Binder.withSource is not trustworthy because it's a public API that external users can
* use to spoof the original ElementSource of a binding by calling withSource(bogusElementSource).
*
* @since 5.0
*/
public static Binder withTrustedSource(
GuiceInternal guiceInternal, Binder binder, Object source) {
@@ -13,6 +13,8 @@ import java.util.Optional;
* errors.
*
* <p>WARNING: The class and its APIs are still experimental and subject to change.
*
* @since 5.0
*/
public abstract class ErrorDetail<SelfT extends ErrorDetail<SelfT>> implements Serializable {
private final String message;
@@ -282,6 +282,7 @@ public final class InjectionPoint {
* @throws ConfigurationException if there is no injectable constructor, more than one injectable
* constructor, or if parameters of the injectable constructor are malformed, such as a
* parameter with multiple binding annotations.
* @since 5.0
*/
public static InjectionPoint forConstructorOf(TypeLiteral<?> type, boolean atInjectRequired) {
Class<?> rawType = getRawType(type.getType());
@@ -873,6 +874,8 @@ public final class InjectionPoint {
/**
* Returns all the annotations on a field. If Kotlin-support is enabled, the annotations will
* include annotations on the related Kotlin-property.
*
* @since 5.0
*/
public static Annotation[] getAnnotations(Field field) {
Annotation[] javaAnnotations = field.getAnnotations();
+5 -1
View File
@@ -152,7 +152,11 @@ public final class Message implements Serializable, Element {
binder.withSource(getSource()).addError(this);
}
/** Returns a copy of this {@link Message} with its sources replaced. */
/**
* Returns a copy of this {@link Message} with its sources replaced.
*
* @since 5.0
*/
public Message withSource(List<Object> newSources) {
return new Message(errorId, errorDetail.withSources(newSources));
}
@@ -311,6 +311,8 @@ public final class FactoryModuleBuilder {
* <p>Guice will try to work properly even if this method is not called (or called with a lookups
* that doesn't have access to the factory), but doing so requires reflection into the JDK, which
* may break at any time (and trigger unsafe access warnings).
*
* @since 5.0
*/
public <T> FactoryModuleBuilder withLookups(MethodHandles.Lookup lookups) {
this.lookups = lookups;
@@ -87,7 +87,11 @@ public final class DaggerAdapter {
return new Builder();
}
/** Builder for setting configuration options on DaggerAdapter. */
/**
* Builder for setting configuration options on DaggerAdapter.
*
* @since 5.0
*/
public static class Builder {
private final ImmutableList.Builder<Object> modules = ImmutableList.builder();
private Predicate<Method> predicate = Predicates.alwaysTrue();
@@ -135,6 +135,8 @@ public final class BoundFieldModule implements Module {
* bindings), create an instance of an anonymous class extending this one and annotate it with
* those permits. For example: {@code new @Permit1 @Permit2 BoundFieldModule.WithPermits(instance)
* {}}.
*
* @since 5.0
*/
public static class WithPermits extends AbstractModule {
private final Object instance;