summaryrefslogtreecommitdiff
path: root/java/com/google/devtools/common/options/ExpansionFunction.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/google/devtools/common/options/ExpansionFunction.java')
-rw-r--r--java/com/google/devtools/common/options/ExpansionFunction.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/java/com/google/devtools/common/options/ExpansionFunction.java b/java/com/google/devtools/common/options/ExpansionFunction.java
new file mode 100644
index 0000000..ffab6e7
--- /dev/null
+++ b/java/com/google/devtools/common/options/ExpansionFunction.java
@@ -0,0 +1,31 @@
+// Copyright 2017 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package com.google.devtools.common.options;
+
+/**
+ * A function from an option parser's static setup (what flags it knows about) to an expansion
+ * String[] to use for one of its options.
+ */
+public interface ExpansionFunction {
+
+ /**
+ * Compute the expansion for an option. May be called at any time during or after the {@link
+ * OptionsParser}'s construction, or not at all.
+ *
+ * @param optionsData the parser's indexed information about its own options, before expansion
+ * information is computed
+ * @return An expansion to use for all occurrences of this option in this parser
+ */
+ public String[] getExpansion(IsolatedOptionsData optionsData);
+}