From 8354a3b7d423aa3f6f61f05c5bad58ca738d28ca Mon Sep 17 00:00:00 2001 From: Christian Dietrich Date: Tue, 14 Feb 2017 10:04:18 +0100 Subject: [PATCH] Introduce Nullable Annotation to allow Null-Injections with google guice. see https://github.com/eclipse/xtext-eclipse/issues/153 for details Signed-off-by: Christian Dietrich --- .../eclipse/xtext/util/internal/Nullable.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 org.eclipse.xtext.util/src/org/eclipse/xtext/util/internal/Nullable.java diff --git a/org.eclipse.xtext.util/src/org/eclipse/xtext/util/internal/Nullable.java b/org.eclipse.xtext.util/src/org/eclipse/xtext/util/internal/Nullable.java new file mode 100644 index 000000000..cd5e74b5a --- /dev/null +++ b/org.eclipse.xtext.util/src/org/eclipse/xtext/util/internal/Nullable.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2017 itemis AG (http://www.itemis.eu) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.xtext.util.internal; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * This annotation is not intended to be used to do null analysis. + * The only purpose is to allow Google Guice to inject @Inject(optional=true) places with null instances. + * + * @author Christian Dietrich - Initial contribution and API + * + * @since 2.12 + */ +@Retention(RetentionPolicy.RUNTIME) +public @interface Nullable { + +}