From commits-return-5088-archive-asf-public=cust-asf.ponee.io@juneau.apache.org Thu Feb 8 03:05:51 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id C02AA18065B for ; Thu, 8 Feb 2018 03:05:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A997E160C5C; Thu, 8 Feb 2018 02:05:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3423B160C5B for ; Thu, 8 Feb 2018 03:05:49 +0100 (CET) Received: (qmail 13575 invoked by uid 500); 8 Feb 2018 02:05:48 -0000 Mailing-List: contact commits-help@juneau.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.apache.org Delivered-To: mailing list commits@juneau.apache.org Received: (qmail 13562 invoked by uid 99); 8 Feb 2018 02:05:48 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Feb 2018 02:05:48 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id B17F68233F; Thu, 8 Feb 2018 02:05:46 +0000 (UTC) Date: Thu, 08 Feb 2018 02:05:46 +0000 To: "commits@juneau.apache.org" Subject: [juneau] branch master updated: Javadoc updates. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151805554663.10895.11821025278360151948@gitbox.apache.org> From: jamesbognar@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: juneau X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8bb9659328bf4d5fe29d8f1afee0f97ca574e3a6 X-Git-Newrev: e92db67039ad2c283643c971f5cf10f18fe9639f X-Git-Rev: e92db67039ad2c283643c971f5cf10f18fe9639f X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. jamesbognar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git The following commit(s) were added to refs/heads/master by this push: new e92db67 Javadoc updates. e92db67 is described below commit e92db67039ad2c283643c971f5cf10f18fe9639f Author: JamesBognar AuthorDate: Wed Feb 7 21:05:41 2018 -0500 Javadoc updates. --- .../java/org/apache/juneau/ini/ConfigFileImpl.java | 1 + .../org/apache/juneau/ini/ConfigFileWrapped.java | 1 + .../juneau/ini/{ => vars}/ConfigFileVar.java | 9 +- .../org/apache/juneau/ini/vars/package-info.java} | 62 +-- .../java/org/apache/juneau/svl/DefaultingVar.java | 10 +- .../main/java/org/apache/juneau/svl/MapVar.java | 5 +- .../apache/juneau/svl/MultipartResolvingVar.java | 10 +- .../java/org/apache/juneau/svl/MultipartVar.java | 11 +- .../org/apache/juneau/svl/ResolvingObjectMap.java | 5 + .../main/java/org/apache/juneau/svl/SimpleVar.java | 12 +- .../java/org/apache/juneau/svl/StreamedVar.java | 14 +- .../src/main/java/org/apache/juneau/svl/Var.java | 19 +- .../java/org/apache/juneau/svl/VarResolver.java | 79 +-- .../org/apache/juneau/svl/VarResolverBuilder.java | 9 +- .../org/apache/juneau/svl/VarResolverContext.java | 5 +- .../org/apache/juneau/svl/VarResolverSession.java | 9 +- .../juneau/svl/{MapVar.java => package-info.java} | 34 +- .../main/java/org/apache/juneau/svl/package.html | 302 ------------ .../juneau/svl/vars/CoalesceAndRecurseVar.java | 7 +- .../org/apache/juneau/svl/vars/CoalesceVar.java | 7 +- .../apache/juneau/svl/vars/EnvVariablesVar.java | 9 +- .../java/org/apache/juneau/svl/vars/IfVar.java | 11 +- .../java/org/apache/juneau/svl/vars/SwitchVar.java | 9 +- .../juneau/svl/vars/SystemPropertiesVar.java | 9 +- juneau-doc/src/main/javadoc/overview.html | 529 +++++++++++++++++---- .../apache/juneau/microservice/Microservice.java | 2 + .../org/apache/juneau/microservice/Resource.java | 2 +- .../apache/juneau/microservice/ResourceGroup.java | 2 +- .../juneau/microservice/ResourceJenaGroup.java | 2 +- .../apache/juneau/microservice}/vars/ArgsVar.java | 2 +- .../juneau/microservice}/vars/ManifestFileVar.java | 2 +- .../juneau/microservice/vars/package-info.java | 62 +-- .../org/apache/juneau/rest/RestContextBuilder.java | 1 + .../juneau/rest/annotation/ResourceSwagger.java | 2 +- .../java/org/apache/juneau/rest/vars/FileVar.java | 2 +- 35 files changed, 638 insertions(+), 619 deletions(-) diff --git a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java index a504261..820abb8 100644 --- a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java +++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileImpl.java @@ -23,6 +23,7 @@ import java.util.*; import java.util.concurrent.locks.*; import org.apache.juneau.*; +import org.apache.juneau.ini.vars.*; import org.apache.juneau.internal.*; import org.apache.juneau.json.*; import org.apache.juneau.parser.*; diff --git a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileWrapped.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileWrapped.java index a1db452..11dd437 100644 --- a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileWrapped.java +++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileWrapped.java @@ -19,6 +19,7 @@ import java.lang.reflect.*; import java.util.*; import org.apache.juneau.*; +import org.apache.juneau.ini.vars.*; import org.apache.juneau.parser.*; import org.apache.juneau.serializer.*; import org.apache.juneau.svl.*; diff --git a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileVar.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/vars/ConfigFileVar.java similarity index 91% rename from juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileVar.java rename to juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/vars/ConfigFileVar.java index 70406cc..75f25df 100644 --- a/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/ConfigFileVar.java +++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/vars/ConfigFileVar.java @@ -10,8 +10,9 @@ // * "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 org.apache.juneau.ini; +package org.apache.juneau.ini.vars; +import org.apache.juneau.ini.*; import org.apache.juneau.svl.*; /** @@ -42,8 +43,10 @@ import org.apache.juneau.svl.*; * Since this is a {@link SimpleVar}, any variables contained in the result will be recursively resolved. * Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. * - * @see org.apache.juneau.ini.ConfigFile - * @see org.apache.juneau.svl + *
See Also:
+ * */ public class ConfigFileVar extends DefaultingVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/vars/package-info.java old mode 100644 new mode 100755 similarity index 65% copy from juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java copy to juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/vars/package-info.java index 4dd0471..97742b2 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java +++ b/juneau-core/juneau-config/src/main/java/org/apache/juneau/ini/vars/package-info.java @@ -1,44 +1,18 @@ -// *************************************************************************************************************************** -// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * -// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * -// * to you 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 org.apache.juneau.svl.vars; - -import org.apache.juneau.svl.*; - -/** - * A basic variable resolver that returns the first non-null value. - * - *

- * The format for this var is "$CR{arg1[,arg2...]}". - * - *

- * The difference between {@link CoalesceVar} and {@link CoalesceAndRecurseVar} is that the first will not resolve - * inner variables nor recursively resolve variables, and the second will. - * Use {@link CoalesceVar} when resolving user-input. - */ -public class CoalesceAndRecurseVar extends MultipartResolvingVar { - - /** The name of this variable. */ - public static final String NAME = "CR"; - - /** - * Constructor. - */ - public CoalesceAndRecurseVar() { - super(NAME); - } - - @Override - public String resolve(VarResolverSession session, String arg) throws Exception { - return arg; - } -} +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you 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. * +// *************************************************************************************************************************** + +/** + * Predefined SVL Variables + */ +package org.apache.juneau.ini.vars; + diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/DefaultingVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/DefaultingVar.java index 3b3d2a6..1a0a1ef 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/DefaultingVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/DefaultingVar.java @@ -22,9 +22,15 @@ import static org.apache.juneau.internal.StringUtils.*; * property doesn't exist: "$S{myProperty,not found}" * *

- * Subclasses must implement the {@link #resolve(VarResolverSession, String)} method. + * Subclasses must implement the following method: + *

    + *
  • {@link #resolve(VarResolverSession, String)} + *
* - * @see org.apache.juneau.svl + *
See Also:
+ * */ public abstract class DefaultingVar extends SimpleVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MapVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MapVar.java index 41e5bc7..f8ee406 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MapVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MapVar.java @@ -21,7 +21,10 @@ import org.apache.juneau.internal.*; /** * A subclass of {@link DefaultingVar} that simply pulls values from a {@link Map}. * - * @see org.apache.juneau.svl + *
See Also:
+ * */ @SuppressWarnings("rawtypes") public abstract class MapVar extends DefaultingVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartResolvingVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartResolvingVar.java index 9ba8acf..15e1da4 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartResolvingVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartResolvingVar.java @@ -22,9 +22,15 @@ import static org.apache.juneau.internal.StringUtils.*; * property doesn't exist: "$S{myProperty1,myProperty2}" * *

- * Subclasses must implement the {@link #resolve(VarResolverSession, String)} method. + * Subclasses must implement the following method: + *

    + *
  • {@link #resolve(VarResolverSession, String)} + *
* - * @see org.apache.juneau.svl + *
See Also:
+ * */ public abstract class MultipartResolvingVar extends SimpleVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartVar.java index 7fe18c0..17e2fd6 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MultipartVar.java @@ -17,10 +17,15 @@ import static org.apache.juneau.internal.StringUtils.*; /** * Interface for the resolution of vars that consist of a comma-delimited list. * - *

- * (e.g. "$X{foo, bar, baz}") + *

Example:
+ *

+ * "$X{foo, bar, baz}" + *

* - * @see org.apache.juneau.svl + *
See Also:
+ * */ public abstract class MultipartVar extends SimpleVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/ResolvingObjectMap.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/ResolvingObjectMap.java index 75d2506..cfaf6c3 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/ResolvingObjectMap.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/ResolvingObjectMap.java @@ -28,6 +28,11 @@ import org.apache.juneau.*; * *

* All other data types are left as-is. + * + *

See Also:
+ * */ @SuppressWarnings({"serial"}) public class ResolvingObjectMap extends ObjectMap { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/SimpleVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/SimpleVar.java index fcf2ff0..284caee 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/SimpleVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/SimpleVar.java @@ -19,13 +19,19 @@ import java.io.*; * *

* Note the difference between this class and {@link StreamedVar} that streams values to writers. - * Unlike the {@link StreamedVar} class, the returned value from this class can contain nested variables that will be + *
Unlike the {@link StreamedVar} class, the returned value from this class can contain nested variables that will be * recursively resolved by {@link VarResolver}. * *

- * Subclasses must implement the {@link #resolve(VarResolverSession, String)} method. + * Subclasses must implement the following method: + *

    + *
  • {@link #resolve(VarResolverSession, String)} + *
* - * @see org.apache.juneau.svl + *
See Also:
+ * */ public abstract class SimpleVar extends Var { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/StreamedVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/StreamedVar.java index 4819cf8..665be5e 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/StreamedVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/StreamedVar.java @@ -17,14 +17,20 @@ package org.apache.juneau.svl; * *

* Note the difference between this class and {@link SimpleVar} that returns simple string values. - * Unlike the {@link SimpleVar} class, the output from this class cannot contain nested variables. - * However, this class can be more efficient for variables that produce large amounts of output so that the creation + *
Unlike the {@link SimpleVar} class, the output from this class cannot contain nested variables. + *
However, this class can be more efficient for variables that produce large amounts of output so that the creation * of large in-memory strings is avoided. * *

- * Subclasses must implement the {@link #resolveTo(VarResolverSession, java.io.Writer, String)} method. + * Subclasses must implement the following method: + *

    + *
  • {@link #resolveTo(VarResolverSession, java.io.Writer, String)} + *
* - * @see org.apache.juneau.svl + *
See Also:
+ * */ public abstract class StreamedVar extends Var { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/Var.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/Var.java index 5d76c85..3bb7a72 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/Var.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/Var.java @@ -26,23 +26,26 @@ import java.io.*; *

* Subclasses must implement one of the following two methods: *

    - *
  • {@link #resolve(VarResolverSession,String)} - For simple vars. - *
  • {@link #resolveTo(VarResolverSession,Writer,String)} - For streamed vars. + *
  • {@link #resolve(VarResolverSession,String)} - For simple vars. + *
  • {@link #resolveTo(VarResolverSession,Writer,String)} - For streamed vars. *
* *

* Subclasses MUST implement a no-arg constructor so that class names can be passed to the * {@link VarResolverBuilder#vars(Class...)} method. - * They must also be thread safe! + *
They must also be thread safe! * *

* Two direct abstract subclasses are provided to differentiated between simple and streamed vars: *

    - *
  • {@link SimpleVar} - *
  • {@link StreamedVar} + *
  • {@link SimpleVar} + *
  • {@link StreamedVar} *
* - * @see org.apache.juneau.svl + *
See Also:
+ * */ public abstract class Var { @@ -111,7 +114,7 @@ public abstract class Var { * *

* The default implementation of this method always returns true. - * Subclasses can override this method to override the default behavior. + *
Subclasses can override this method to override the default behavior. * *

Important Note
*

@@ -129,7 +132,7 @@ public abstract class Var { * *

* Can be overridden to intercept the request and do special handling. - * Default implementation simply calls resolve(String). + *
Default implementation simply calls resolve(String). * * @param session The session object used for a single instance of a string resolution. * @param arg The inside argument of the variable. diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolver.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolver.java index 1a9976a..dfabaa6 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolver.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolver.java @@ -12,7 +12,6 @@ // *************************************************************************************************************************** package org.apache.juneau.svl; - import java.io.*; import java.util.*; @@ -47,56 +46,16 @@ import org.apache.juneau.svl.vars.*; * } * * // Create a variable resolver that resolves system properties (e.g. "$S{java.home}") - * VarResolver r = new VarResolver().addVars(SystemPropertiesVar.class); + * VarResolver r = VarResolver.create().vars(SystemPropertiesVar.class).build(); * * // Use it! * System.out.println(r.resolve("java.home is set to $S{java.home}")); *

* - *
Context objects
- * - * Var resolvers can have zero or more context objects associated with them. - * - *

- * Context objects are arbitrary objects associated with this var resolver, such as a ConfigFile object. - * They can be any class type. - * - *

- * Context objects can be retrieved by {@link Var} classes through the - * {@link VarResolverSession#getSessionObject(Class, String)} method. - * - *

Session objects
- * - * Session objects are considered more ephemeral than context objects. - * While a context object is unlikely to ever change, a session object may change on every use of the var resolver. - * For example, the server API defines various Var objects that use the RestRequest - * object as a session object for the duration of a single HTTP request. - * - *

- * Session objects are used by calling the {@link #createSession()} or {@link #createSession(Map)} methods to create - * an instance of a {@link VarResolverSession} object that contains {@link VarResolverSession#resolve(String)} - * and {@link VarResolverSession#resolveTo(String,Writer)} methods that are identical to - * {@link VarResolver#resolve(String)} and {@link VarResolver#resolveTo(String, Writer)} except that the - * Var objects have access to the session objects through the - * {@link VarResolverSession#getSessionObject(Class, String)} method. - * - *

- * Session objects are specified through either the {@link #createSession(Map)} method or the - * {@link VarResolverSession#sessionObject(String, Object)} methods. - * - *

Cloning
- * - * Var resolvers can be cloned by using the {@link #builder()} method. - * Cloning a resolver will copy it's {@link Var} class names and context objects. - * - *
Example:
- *

- * // Create a resolver that copies the default resolver and adds $C and $ARG vars. - * VarResolver myVarResolver = VarResolver.DEFAULT.builder().vars(ConfigVar.class, - * ArgsVar.class).build(); - *

- * - * @see org.apache.juneau.svl + *
See Also:
+ * */ public class VarResolver { @@ -104,10 +63,12 @@ public class VarResolver { * Default string variable resolver with support for system properties and environment variables: * *
    - *
  • $S{key},$S{key,default} - System properties. - *
  • $E{key},$E{key,default} - Environment variables. - *
  • $IF{booleanValue,thenValue[,elseValue]} - If-else patterns. - *
  • $SW{test,matchPattern,thenValue[,matchPattern,thenValue][,elseValue]} - Switch patterns. + *
  • $S{key},$S{key,default} - {@link SystemPropertiesVar} + *
  • $E{key},$E{key,default} - {@link EnvVariablesVar} + *
  • $IF{booleanValue,thenValue[,elseValue]} - {@link IfVar} + *
  • $SW{test,matchPattern,thenValue[,matchPattern,thenValue][,elseValue]} - {@link SwitchVar} + *
  • $CO{arg1[,arg2...]} - {@link CoalesceVar} + *
  • $CR{arg1[,arg2...]} - {@link CoalesceAndRecurseVar} *
* * @see SystemPropertiesVar @@ -118,12 +79,24 @@ public class VarResolver { final VarResolverContext ctx; /** + * Instantiates a new clean-slate {@link VarResolverBuilder} object. + * + *

+ * This is equivalent to simply calling new VarResolverBuilder(). + * + * @return A new {@link VarResolverBuilder} object. + */ + public static VarResolverBuilder create() { + return new VarResolverBuilder(); + } + + /** * Constructor. * * @param vars The var classes * @param contextObjects */ - public VarResolver(Class[] vars, Map contextObjects) { + VarResolver(Class[] vars, Map contextObjects) { this.ctx = new VarResolverContext(vars, contextObjects); } @@ -175,7 +148,7 @@ public class VarResolver { * *

* This is a shortcut for calling createSession(null).resolve(s);. - * This method can only be used if the string doesn't contain variables that rely on the existence of session + *
This method can only be used if the string doesn't contain variables that rely on the existence of session * variables. * * @param s The input string. @@ -190,7 +163,7 @@ public class VarResolver { * *

* This is a shortcut for calling createSession(null).resolveTo(s, w);. - * This method can only be used if the string doesn't contain variables that rely on the existence of session + *
This method can only be used if the string doesn't contain variables that rely on the existence of session * variables. * * @param s The input string. diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java index 58d02b1..3f2ccf5 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverBuilder.java @@ -20,6 +20,11 @@ import org.apache.juneau.svl.vars.*; /** * Builder class for building instances of {@link VarResolver}. + * + *

See Also:
+ * */ public class VarResolverBuilder { @@ -62,12 +67,14 @@ public class VarResolverBuilder { *
  • {@link EnvVariablesVar} *
  • {@link SwitchVar} *
  • {@link IfVar} + *
  • {@link CoalesceVar} + *
  • {@link CoalesceAndRecurseVar} * * * @return This object (for method chaining). */ public VarResolverBuilder defaultVars() { - return vars(SystemPropertiesVar.class, EnvVariablesVar.class, SwitchVar.class, IfVar.class); + return vars(SystemPropertiesVar.class, EnvVariablesVar.class, SwitchVar.class, IfVar.class, CoalesceAndRecurseVar.class, CoalesceVar.class); } /** diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverContext.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverContext.java index 5283de8..be59001 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverContext.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverContext.java @@ -23,7 +23,10 @@ import java.util.concurrent.*; *

    * Used to associate {@link Var Vars} and context objects with {@link VarResolver VarResolvers}. * - * @see org.apache.juneau.svl + *

    See Also:
    + * */ public class VarResolverContext { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverSession.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverSession.java index 4009b56..dd2cbbd 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverSession.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/VarResolverSession.java @@ -36,7 +36,10 @@ import org.apache.juneau.*; *

    * Instances of this class are NOT guaranteed to be thread safe. * - * @see org.apache.juneau.svl + *

    See Also:
    + * */ public class VarResolverSession { @@ -370,7 +373,9 @@ public class VarResolverSession { * * @param c The class type to cast to. * @param name The name of the session object. - * @return The session object. Never null. + * @return + * The session object. + *
    Never null. * @throws RuntimeException If session object with specified name does not exist. */ @SuppressWarnings("unchecked") diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MapVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/package-info.java old mode 100644 new mode 100755 similarity index 66% copy from juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MapVar.java copy to juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/package-info.java index 41e5bc7..4b8eabf --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/MapVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/package-info.java @@ -10,39 +10,9 @@ // * "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 org.apache.juneau.svl; - -import static org.apache.juneau.internal.ThrowableUtils.*; - -import java.util.*; - -import org.apache.juneau.internal.*; /** - * A subclass of {@link DefaultingVar} that simply pulls values from a {@link Map}. - * - * @see org.apache.juneau.svl + * Simple Variable Language */ -@SuppressWarnings("rawtypes") -public abstract class MapVar extends DefaultingVar { - - private final Map m; - - /** - * Constructor. - * - * @param name The name of this variable. - * @param m The map to pull values from. - */ - public MapVar(String name, Map m) { - super(name); - if (m == null) - illegalArg("''m'' parameter cannot be null."); - this.m = m; - } +package org.apache.juneau.svl; - @Override /* Var */ - public String resolve(VarResolverSession session, String varVal) { - return StringUtils.toString(m.get(varVal)); - } -} diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/package.html b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/package.html deleted file mode 100644 index c9189db..0000000 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/package.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - - - -

    Simple Variable Language

    - - -
    Table of Contents
    -
      -
    1. Simple Variable Language

      -
        -
      1. Vars

        -
      2. VarResolvers and VarResolverSessions

        -
      3. Other Notes

        -
      -
    2. -
    - - - -

    1 - Simple Variable Language

    -
    -

    - The org.apache.juneau.svl package defines an API for a language called "Simple Variable Language". - In a nutshell, Simple Variable Language (or SVL) is text that contains variables of the form "$varName{varKey}". -

    -

    - Variables can be recursively nested within the varKey (e.g. "$FOO{$BAR{xxx},$BAZ{xxx}}"). - Variables can also return values that themselves contain more variables. -

    -

    - The {@link org.apache.juneau.svl.VarResolver} class is used to resolve variables. - The {@link org.apache.juneau.svl.VarResolver#DEFAULT} resolver will resolve "$S{systemProperty}" - and "$E{envVariable}" variables. -

    -

    - // Use the default variable resolver to resolve a string that contains $S (system property) variables - String myProperty = VarResolver.DEFAULT.resolve("The Java home directory is $S{java.home}"); -

    -

    - The following shows how variables can be arbitrarily nested... -

    -

    - // Look up a property in the following order: - // 1) MYPROPERTY environment variable. - // 2) 'my.property' system property if environment variable not found. - // 3) 'not found' string if system property not found. - String myproperty = VarResolver.DEFAULT.resolve("$E{MYPROPERTY,$S{my.property,not found}}"); -

    - - - -

    1.1 - Vars

    -
    -

    - Variables are defined through the {@link org.apache.juneau.svl.Var} API. -

    -

    - // Create a var resolver that extends the default resolver and appends our own "$URLEncode{...}" variable - - // First create our var. - public class UrlEncodeVar extends SimpleVar { - - // Must have a no-arg constructor! - public UrlEncodeVar() { - super("URLEncode"); - } - - // The method we must implement - @Override - public String resolve(VarResolverSession session, String varVal) { - return URLEncoder.encode(varVal, "UTF-8"); - } - } - - // Next create a var resolver that extends the existing DEFAULT resolver - // that supports resolving system properties. - VarResolver r = VarResolver.DEFAULT.builder().vars(UrlEncodeVar.class).build(); - - // Retrieve a system property and URL-encode it if necessary. - String myProperty = r.resolve("$URLEncode{$S{my.property}}"); -

    -

    - The following shows the class hierarchy of the {@link org.apache.juneau.svl.Var} class and all current - predefined implementations. -

    -
      -
    • - {@link org.apache.juneau.svl.Var} - - Superclass of all vars. -
        -
      • - {@link org.apache.juneau.svl.SimpleVar} - - Superclass of all vars that return strings. -
          -
        • - {@link org.apache.juneau.svl.DefaultingVar} - - Variables that define a default value if the resolve method returns null. -
            -
          • - {@link org.apache.juneau.svl.MapVar} - - Variables that pull values from maps. -
              -
            • - {@link org.apache.juneau.svl.vars.SystemPropertiesVar} - - Resolves system properties. -
            -
          • -
          • - {@link org.apache.juneau.svl.vars.ArgsVar} - - Resolves variables from an {@link org.apache.juneau.utils.Args} object. -
          • - ConfigFileVar - - Resolves variables from a {@link org.apache.juneau.ini.ConfigFile} object. -
          • - {@link org.apache.juneau.svl.vars.EnvVariablesVar} - - Resolves environment variables. -
          • - {@link org.apache.juneau.svl.vars.ManifestFileVar} - - Resolves variables from a {@link org.apache.juneau.utils.ManifestFile} object. -
          • - {@link org.apache.juneau.rest.vars.ServletInitParamVar} - - Resolves servlet initialization parameters. -
          -
        • -
        • - {@link org.apache.juneau.svl.MultipartVar} - - Variables that consist of 2 or more comma-delimited arguments. -
            -
          • - {@link org.apache.juneau.rest.vars.LocalizationVar} - - Resolves localized strings for an HTTP request. -
          -
        • -
        • - {@link org.apache.juneau.rest.vars.RequestVar} - - Resolves specialized HTTP request values. -
        • - {@link org.apache.juneau.rest.vars.UrlEncodeVar} - - URL-encodes the value inside the variable. -
        -
      • -
      • - {@link org.apache.juneau.svl.StreamedVar} - - Superclass of all vars that stream their value to writers. -
          -
        • - {@link org.apache.juneau.rest.vars.SerializedRequestAttrVar} - - Resolves HTTP request attribute values passed through a - {@link org.apache.juneau.serializer.Serializer}. -
        -
      • -
      -
    • -
    -
    - - - -

    1.2 - VarResolvers and VarResolverSessions

    -
    -

    - The main class for performing variable resolution is {@link org.apache.juneau.svl.VarResolver}. - Two methods are provided for resolving variables: -

    -
      -
    • - {@link org.apache.juneau.svl.VarResolver#resolve(String)} - - Resolves variables and returns the results as a simple string. -
    • - {@link org.apache.juneau.svl.VarResolver#resolveTo(String,Writer)} - - Resolves variables and sends results to a writer. -
    -

    - Var resolvers can have zero or more context objects associated with them. - Some {@link org.apache.juneau.svl.Var Vars} rely on the existence of some other object, such as an - {@link org.apache.juneau.utils.Args} object - for {@link org.apache.juneau.svl.vars.ArgsVar} or a {@link org.apache.juneau.ini.ConfigFile} for a - ConfigFileVar. - These object dependencies are made by setting context objects on the var resolver. -

    -

    - Context objects are set through the {@link org.apache.juneau.svl.VarResolverBuilder - #contextObject(String,Object)} method. - They can be any class type. -

    -

    - Context objects are used by {@link org.apache.juneau.svl.Var Vars} by calling the - {@link org.apache.juneau.svl.VarResolverSession#getSessionObject(Class, String)} method. -

    -

    - In addition to context objects, there are also session objects. - Session objects are considered more ephemeral than context objects. - While a context object is unlikely to ever change, a session object may change on every use of the var - resolver. - For example, the server API defines various Var objects that use the RestRequest - object as a session object for the duration of a single HTTP request. -

    -

    - Session objects are used by calling the {@link org.apache.juneau.svl.VarResolver#createSession()} or - {@link org.apache.juneau.svl.VarResolver#createSession(Map)} methods to create an instance of a - {@link org.apache.juneau.svl.VarResolverSession} object that contains - {@link org.apache.juneau.svl.VarResolverSession#resolve(String)} and - {@link org.apache.juneau.svl.VarResolverSession#resolveTo(String,Writer)} methods that are identical to - {@link org.apache.juneau.svl.VarResolver#resolve(String)} and - {@link org.apache.juneau.svl.VarResolver#resolveTo(String, Writer)} except that the Var objects - have access to the session objects through the - {@link org.apache.juneau.svl.VarResolverSession#getSessionObject(Class, String)} method. - Session objects are specified through either the {@link org.apache.juneau.svl.VarResolver#createSession(Map)} - method or the {@link org.apache.juneau.svl.VarResolverSession#sessionObject(String, Object)} methods. -

    -

    - Like Context object, Session objects are used by {@link org.apache.juneau.svl.Var Vars} by calling the - {@link org.apache.juneau.svl.VarResolverSession#getSessionObject(Class, String)} method. -

    -

    - Var resolvers can be cloned and extended by using the {@link org.apache.juneau.svl.VarResolver#builder()} - method. - Cloning a resolver will copy it's {@link org.apache.juneau.svl.Var} class names and context objects. -

    - -
    Example:
    -

    - // Create a resolver that copies the default resolver and adds $C and $ARG vars. - VarResolver myVarResolver = VarResolver.DEFAULT.builder().vars(ConfigFileVar.class, - ArgsVar.class).build(); -

    -
    - - - -

    1.3 - Other Notes

    -
    -
      -
    • - The escape character '\' can be used when necessary to escape the following characters: - $ , { } -
    • - WARNING: It is possible to cause {@link java.lang.StackOverflowError StackOverflowErrors} if - your nested variables result in a recursive loop (e.g. the environment variable - 'MYPROPERTY' has the value '$E{MYPROPERTY}'). - So don't do that! -
    • - As a general rule, this class tries to be as efficient as possible by not creating new strings when not - needed. -
      For example, calling the resolve method on a string that doesn't contain variables (e.g. - resolver.resolve("foobar")) will simply be a no-op and return the same string. -
    -
    -
    - - \ No newline at end of file diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java index 4dd0471..98bc245 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java @@ -23,7 +23,12 @@ import org.apache.juneau.svl.*; *

    * The difference between {@link CoalesceVar} and {@link CoalesceAndRecurseVar} is that the first will not resolve * inner variables nor recursively resolve variables, and the second will. - * Use {@link CoalesceVar} when resolving user-input. + *
    Use {@link CoalesceVar} when resolving user-input. + * + *

    See Also:
    + * */ public class CoalesceAndRecurseVar extends MultipartResolvingVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceVar.java index 6844a3a..4e7af41 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceVar.java @@ -23,7 +23,12 @@ import org.apache.juneau.svl.*; *

    * The difference between {@link CoalesceVar} and {@link CoalesceAndRecurseVar} is that the first will not resolve * inner variables nor recursively resolve variables, and the second will. - * Use {@link CoalesceVar} when resolving user-input. + *
    Use {@link CoalesceVar} when resolving user-input. + * + *

    See Also:
    + * */ public class CoalesceVar extends MultipartResolvingVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/EnvVariablesVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/EnvVariablesVar.java index f9da2fd..ccf0ab2 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/EnvVariablesVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/EnvVariablesVar.java @@ -23,7 +23,7 @@ import org.apache.juneau.svl.*; *
    Example:
    *

    * // Create a variable resolver that resolves environment variables (e.g. "$E{PATH}") - * VarResolver r = new VarResolver().addVars(EnvVariablesVar.class); + * VarResolver r = VarResolver.create().vars(EnvVariablesVar.class).build(); * * // Use it! * System.out.println(r.resolve("Environment variable PATH is set to $E{PATH}")); @@ -31,9 +31,12 @@ import org.apache.juneau.svl.*; * *

    * Since this is a {@link SimpleVar}, any variables contained in the result will be recursively resolved. - * Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. + *
    Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. * - * @see org.apache.juneau.svl + *

    See Also:
    + * */ public class EnvVariablesVar extends DefaultingVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/IfVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/IfVar.java index e26f306..6c3f857 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/IfVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/IfVar.java @@ -35,7 +35,7 @@ import org.apache.juneau.svl.*; *
    Example:
    *

    * // Create a variable resolver that resolves system properties and $IF vars. - * VarResolver r = new VarResolver().addVars(IfVar.class, SystemPropertiesVar.class); + * VarResolver r = VarResolver.create().vars(IfVar.class, SystemPropertiesVar.class).build(); * * // Use it! * System.out.println(r.resolve("Property $IF{$S{someBooleanFlag},IS,IS NOT} set!")); @@ -43,10 +43,13 @@ import org.apache.juneau.svl.*; * *

    * Since this is a {@link MultipartVar}, any variables contained in the result will be recursively resolved. - * Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. + *
    Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. * - * @see org.apache.juneau.svl -*/ + *

    See Also:
    + * + */ public class IfVar extends MultipartVar { /** The name of this variable. */ diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SwitchVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SwitchVar.java index e51740c..2cdbbed 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SwitchVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SwitchVar.java @@ -38,7 +38,7 @@ import org.apache.juneau.svl.*; *
    Example:
    *

    * // Create a variable resolver that resolves system properties and $SW vars. - * VarResolver r = new VarResolver().addVars(SwitchVar.class, SystemPropertiesVar.class); + * VarResolver r = VarResolver.create().vars(SwitchVar.class, SystemPropertiesVar.class).build(); * * // Use it! * System.out.println(r.resolve("We are running on $SW{$P{os.name},*win*,Windows,Something else}!")); @@ -46,7 +46,12 @@ import org.apache.juneau.svl.*; * *

    * Since this is a {@link MultipartVar}, any variables contained in the result will be recursively resolved. - * Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. + *
    Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. + * + *

    See Also:
    + * */ public class SwitchVar extends MultipartVar { diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SystemPropertiesVar.java b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SystemPropertiesVar.java index 2218df7..65aecb0 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SystemPropertiesVar.java +++ b/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/SystemPropertiesVar.java @@ -23,7 +23,7 @@ import org.apache.juneau.svl.*; *
    Example:
    *

    * // Create a variable resolver that resolves system properties (e.g. "$S{java.home}") - * VarResolver r = new VarResolver().addVars(SystemPropertiesVar.class); + * VarResolver r = VarResolver.create().vars(SystemPropertiesVar.class).build(); * * // Use it! * System.out.println(r.resolve("java.home is set to $S{java.home}")); @@ -31,9 +31,12 @@ import org.apache.juneau.svl.*; * *

    * Since this is a {@link SimpleVar}, any variables contained in the result will be recursively resolved. - * Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. + *
    Likewise, if the arguments contain any variables, those will be resolved before they are passed to this var. * - * @see org.apache.juneau.svl + *

    See Also:
    + * */ public class SystemPropertiesVar extends MapVar { diff --git a/juneau-doc/src/main/javadoc/overview.html b/juneau-doc/src/main/javadoc/overview.html index 46579a3..18209e6 100644 --- a/juneau-doc/src/main/javadoc/overview.html +++ b/juneau-doc/src/main/javadoc/overview.html @@ -136,6 +136,12 @@
  • Swagger

  • juneau-svl

    +
      +
    1. Simple Variable Language

      +
    2. SVL Variables

      +
    3. VarResolvers and VarResolverSessions

      +
    4. Other Notes

      +
  • juneau-config

  • juneau-rest-server

      @@ -4321,44 +4327,291 @@ org.apache.juneau.svl_7.0.0.jar

      -

      - The juneau-svl library defines an API for a language called "Simple Variable Language". - In a nutshell, Simple Variable Language (or SVL) is text that contains variables of the form - "$varName{varKey}". -

      -

      - Variables can be recursively nested within the varKey (e.g. "$FOO{$BAR{xxx},$BAZ{xxx}}"). - Variables can also return values that themselves contain more variables. -

      -

      + + +

      5.1 - Simple Variable Language

      +
      +

      + The juneau-svl module defines an API for a language called Simple Variable Language. +
      In a nutshell, Simple Variable Language (or SVL) is text that contains variables of the form "$varName{varKey}". +
      It is used extensively in the ConfigFile, REST and Microservice APIs. +

      +

      + Most variables can be recursively nested within the varKey (e.g. "$FOO{$BAR{xxx},$BAZ{xxx}}") + and can return values that themselves contain more variables. +

      +

      + The {@link org.apache.juneau.svl.VarResolver} class is used to resolve variables. +
      The {@link org.apache.juneau.svl.VarResolver#DEFAULT} resolver is a reusable instance of this class + configured with the following basic variables: +

      +
        +
      • $S{key},$S{key,default} - System properties. +
      • $E{key},$E{key,default} - Environment variables. +
      • $IF{booleanValue,thenValue[,elseValue]} - If-else patterns. +
      • $SW{test,matchPattern,thenValue[,matchPattern,thenValue][,elseValue]} - Switch patterns. +
      • $CO{arg1[,arg2...]} - Coalesce variable. +
      • $CR{arg1[,arg2...]} - Coalesce-and-recurse variable. +
      +
      Example:
      +

      // Use the default variable resolver to resolve a string that contains $S (system property) variables String myProperty = VarResolver.DEFAULT.resolve("The Java home directory is $S{java.home}"); -

      -

      - The following shows how variables can be arbitrarily nested... -

      -

      +

      +

      + The following shows how variables can be arbitrarily nested... +

      +

      // Look up a property in the following order: // 1) MYPROPERTY environment variable. // 2) 'my.property' system property if environment variable not found. // 3) 'not found' string if system property not found. String myproperty = VarResolver.DEFAULT.resolve("$E{MYPROPERTY,$S{my.property,not found}}"); -

      -

      - SVL is a large topic on it's own. - It is used extensively in the ConfigFile, REST and Microservice APIs. -

      +

      +
      -
      Additional Information - org.apache.juneau.svl
      -
        -
      1. Simple Variable Language

        -
          -
        1. Vars

          -
        2. VarResolvers and VarResolverSessions

          -
        3. Other Notes

          -
        -
      2. -
      + + +

      5.2 - SVL Variables

      +
      +

      + Variables are defined through the {@link org.apache.juneau.svl.Var} API. +
      The API comes with several predefined variables and is easily extensible. +

      +

      + The following is an example of a variable that performs URL-Encoding on strings. +

      +

      + // First create our var. + public class UrlEncodeVar extends SimpleVar { + + // Must have a no-arg constructor! + public UrlEncodeVar() { + super("UE"); + } + + // The method we must implement + @Override + public String resolve(VarResolverSession session, String key) { + return URLEncoder.encode(key, "UTF-8"); + } + } + + // Next create a var resolver that extends the existing DEFAULT resolver + // that supports resolving system properties. + VarResolver r = VarResolver.DEFAULT + .builder() + .vars(UrlEncodeVar.class) + .build(); + + // Retrieve a system property and URL-encode it if necessary. + String myProperty = r.resolve("$UE{$S{my.property}}"); +

      +

      + The following shows the class hierarchy of the {@link org.apache.juneau.svl.Var} class: +

      +
        +
      • {@link org.apache.juneau.svl.Var} - Superclass of all vars. +
          +
        • {@link org.apache.juneau.svl.SimpleVar} - Superclass of all vars that return strings. +
            +
          • {@link org.apache.juneau.svl.DefaultingVar} - Variables that define a default value if the resolve method returns null. +
              +
            • {@link org.apache.juneau.svl.MapVar} - Variables that pull values from maps. +
            +
          • {@link org.apache.juneau.svl.MultipartVar} - Variables that consist of 2 or more comma-delimited arguments. +
          +
        • {@link org.apache.juneau.svl.StreamedVar} - Superclass of all vars that stream their value to writers. +
        +
      +

      + The following is the list of default variables defined in all modules: +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      ModuleClassPattern
      juneau-svl{@link org.apache.juneau.svl.vars.EnvVariablesVar}$E{envVar[,defaultValue]}
      {@link org.apache.juneau.svl.vars.SystemPropertiesVar}$S{systemProperty[,defaultValue]}
      {@link org.apache.juneau.svl.vars.CoalesceVar}$CO{arg1[,arg2...]}
      {@link org.apache.juneau.svl.vars.CoalesceAndRecurseVar}$CR{arg1[,arg2...]}
      {@link org.apache.juneau.svl.vars.IfVar}$IF{booleanArg,thenValue[,elseValue]}
      {@link org.apache.juneau.svl.vars.SwitchVar}$SW{stringArg(,pattern,thenValue)+[,elseValue]}
      juneau-config{@link org.apache.juneau.ini.vars.ConfigFileVar}$C{key[,defaultValue]}
      juneau-rest-server{@link org.apache.juneau.rest.vars.FileVar}$F{path[,defaultValue]}}
      {@link org.apache.juneau.rest.vars.ServletInitParamVar}$I{name[,defaultValue]}
      {@link org.apache.juneau.rest.vars.LocalizationVar}$L{key[,args...]}
      {@link org.apache.juneau.rest.vars.RequestAttributeVar}$RA{key1[,key2...]}
      {@link org.apache.juneau.rest.vars.RequestFormDataVar}$RF{key1[,key2...]}
      {@link org.apache.juneau.rest.vars.RequestHeaderVar}$RH{key1[,key2...]}
      {@link org.apache.juneau.rest.vars.RequestHeaderVar}$RI{key}
      {@link org.apache.juneau.rest.vars.RequestPathVar}$RP{key1[,key2...]}
      {@link org.apache.juneau.rest.vars.RequestQueryVar}$RQ{key1[,key2...]}
      {@link org.apache.juneau.rest.vars.RequestVar}$R{key1[,key2...]}
      {@link org.apache.juneau.rest.vars.SerializedRequestAttrVar}$SA{contentType,key[,defaultValue]}
      {@link org.apache.juneau.rest.vars.UrlVar}$U{uri}>
      {@link org.apache.juneau.rest.vars.UrlEncodeVar}$UE{uriPart}
      {@link org.apache.juneau.rest.vars.WidgetVar}$W{widgetName}
      juneau-microservice-server{@link org.apache.juneau.microservice.vars.ArgsVar}$ARG{key[,defaultValue]}
      {@link org.apache.juneau.microservice.vars.ManifestFileVar}$MF{key[,defaultValue]}
      +
      + + + +

      5.3 - VarResolvers and VarResolverSessions

      +
      +

      + The main class for performing variable resolution is {@link org.apache.juneau.svl.VarResolver}. +
      Two methods are provided for resolving variables: +

      +
        +
      • {@link org.apache.juneau.svl.VarResolver} +
          +
        • {@link org.apache.juneau.svl.VarResolver#resolve(String) resolve(String)} + - Resolves variables and returns the results as a simple string. +
        • {@link org.apache.juneau.svl.VarResolver#resolveTo(String,Writer) resolveTo(String,Writer)} + - Resolves variables and sends results to a writer. +
        +
      +

      + Var resolvers can rely on the existence of other objects. +
      For example, {@link org.apache.juneau.ini.vars.ConfigFileVar} relies on the existence of a {@link org.apache.juneau.ini.ConfigFile}. +
      This is accomplished through the following: +

      +
        +
      • Context-objects - Objects set on the resolver. +
      • Session-objects - Objects set on the resolver session. +
      +

      + The following two classes are identical in behavior except for which objects they can access: +

      +
        +
      • {@link org.apache.juneau.svl.VarResolver} - Has access to context objects only. +
      • {@link org.apache.juneau.svl.VarResolverSession} - Has access to context and session objects. +
      +

      + Context and session objects are set through the following methods: +

      +
        +
      • {@link org.apache.juneau.svl.VarResolverBuilder#contextObject(String,Object)} - Context objects. +
      • {@link org.apache.juneau.svl.VarResolverSession#sessionObject(String,Object)} - Session objects. +
      • {@link org.apache.juneau.svl.VarResolver#createSession(Map)} - Session objects. +
      +

      + Both kinds of objects are accessible through the following method: +

      +
        +
      • {@link org.apache.juneau.svl.VarResolverSession#getSessionObject(Class, String)} +
      +

      + Var resolvers can be cloned and extended by using the {@link org.apache.juneau.svl.VarResolver#builder()} method. +
      Cloning a resolver will copy it's {@link org.apache.juneau.svl.Var} class names and context objects. +

      + +
      Example:
      +

      + // Create a resolver that copies the default resolver and adds $C and $ARG vars. + VarResolver myVarResolver = VarResolver.DEFAULT + .builder() + .vars(ConfigFileVar.class, ArgsVar.class) + .build(); +

      +
      + + + +

      5.4 - Other Notes

      +
      +
        +
      • + The escape character '\' can be used when necessary to escape the following characters: + $ , { } +
      • + WARNING: It is possible to cause {@link java.lang.StackOverflowError StackOverflowErrors} if + your nested variables result in a recursive loop (e.g. the environment variable + 'MYPROPERTY' has the value '$E{MYPROPERTY}'). + So don't do that! +
      • + As a general rule, this class tries to be as efficient as possible by not creating new strings when not + needed. +
        For example, calling the resolve method on a string that doesn't contain variables (e.g. + resolver.resolve("foobar")) will simply be a no-op and return the same string. +
      +
      @@ -7221,68 +7474,158 @@

      The following is the default list of supported variables.

      - -
      Default REST SVL variables
      -
        -
      • Initialization-time variables: -
          -
        • $C{key[,defaultValue]} - {@link org.apache.juneau.ini.ConfigFileVar} -
        • $E{envVar[,defaultValue]} - {@link org.apache.juneau.svl.vars.EnvVariablesVar} -
        • $S{systemProperty[,defaultValue]} - {@link org.apache.juneau.svl.vars.SystemPropertiesVar} -
        -
      • Initialization-time construct variables: -
          -
        • $CO{arg1[,arg2...]} - {@link org.apache.juneau.svl.vars.CoalesceVar} -
        • $CR{arg1[,arg2...]} - {@link org.apache.juneau.svl.vars.CoalesceAndRecurseVar} -
        • $IF{booleanArg,thenValue[,elseValue]} - {@link org.apache.juneau.svl.vars.IfVar} -
        • $SW{stringArg(,pattern,thenValue)+[,elseValue]} - {@link org.apache.juneau.svl.vars.SwitchVar} -
        -
      • Request-time variables: -
          -
        • $F{path[,defaultValue]} - {@link org.apache.juneau.rest.vars.FileVar} -
        • $I{name[,defaultValue]} - {@link org.apache.juneau.rest.vars.ServletInitParamVar} -
        • $L{key[,args...]} - {@link org.apache.juneau.rest.vars.LocalizationVar} -
        • $RA{key1[,key2...]} - {@link org.apache.juneau.rest.vars.RequestAttributeVar} -
        • $RF{key1[,key2...]} - {@link org.apache.juneau.rest.vars.RequestFormDataVar} -
        • $RH{key1[,key2...]} - {@link org.apache.juneau.rest.vars.RequestHeaderVar} -
        • $RI{key} - {@link org.apache.juneau.rest.vars.RequestHeaderVar} -
          Possible keys: -
            -
          • $RI{contact} - {@link org.apache.juneau.dto.swagger.Info#getContact()} -
          • $RI{description} - {@link org.apache.juneau.rest.RestInfoProvider#getDescription(RestRequest)} -
          • $RI{externalDocs} - {@link org.apache.juneau.dto.swagger.Swagger#getExternalDocs()} -
          • $RI{license} - {@link org.apache.juneau.dto.swagger.Info#getLicense()} -
          • $RI{methodDescription} - {@link org.apache.juneau.rest.RestInfoProvider#getMethodDescription(Method,RestRequest)} -
          • $RI{methodSummary} - {@link org.apache.juneau.rest.RestInfoProvider#getMethodSummary(Method,RestRequest)} -
          • $RI{siteName} - {@link org.apache.juneau.rest.RestInfoProvider#getSiteName(RestRequest)} -
          • $RI{tags} - {@link org.apache.juneau.dto.swagger.Swagger#getTags()} -
          • $RI{termsOfService} - {@link org.apache.juneau.dto.swagger.Info#getTermsOfService()} -
          • $RI{title} - {@link org.apache.juneau.rest.RestInfoProvider#getTitle(RestRequest)} -
          • $RI{version} - {@link org.apache.juneau.dto.swagger.Info#getVersion()} -
          -
        • $RP{key1[,key2...]} - {@link org.apache.juneau.rest.vars.RequestPathVar} -
        • $RQ{key1[,key2...]} - {@link org.apache.juneau.rest.vars.RequestQueryVar} -
        • $R{key1[,key2...]} - {@link org.apache.juneau.rest.vars.RequestVar} -
          Possible keys: -
            -
          • $R{method} - {@link org.apache.juneau.rest.RestRequest#getMethod()} -
          • $R{methodSummary} - {@link org.apache.juneau.rest.RestRequest#getMethodSummary()} -
          • $R{methodDescription} - {@link org.apache.juneau.rest.RestRequest#getMethodDescription()} -
          • $R{pathInfo} - {@link org.apache.juneau.rest.RestRequest#getPathInfo()} -
          • $R{requestParentURI} - {@link org.apache.juneau.UriContext#getRootRelativePathInfoParent()} -
          • $R{requestURI} - {@link org.apache.juneau.rest.RestRequest#getRequestURI()} -
          • $R{resourceDescription} - {@link org.apache.juneau.rest.RestRequest#getResourceDescription()} -
          • $R{resourceTitle} - {@link org.apache.juneau.rest.RestRequest#getResourceTitle()} -
          • $R{servletParentURI} - {@link org.apache.juneau.UriContext#getRootRelativeServletPathParent()} -
          • $R{servletPath} - {@link org.apache.juneau.rest.RestRequest#getServletPath()} -
          • $R{servletURI} - {@link org.apache.juneau.UriContext#getRootRelativeServletPath()} -
          -
        • $SA{contentType,key[,defaultValue]} - {@link org.apache.juneau.rest.vars.SerializedRequestAttrVar} -
        • $U{uri} - {@link org.apache.juneau.rest.vars.UrlVar} -
        • $UE{uriPart} - {@link org.apache.juneau.rest.vars.UrlEncodeVar} -
        • $W{widgetName} - {@link org.apache.juneau.rest.vars.WidgetVar} -
        -
      + +
      Default REST SVL Variables:
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      ModuleClassPatternInitialization
      time
      Request
      time
      juneau-svl{@link org.apache.juneau.svl.vars.EnvVariablesVar}$E{envVar[,defaultValue]}yesyes
      {@link org.apache.juneau.svl.vars.SystemPropertiesVar}$S{systemProperty[,defaultValue]}yesyes
      {@link org.apache.juneau.svl.vars.CoalesceVar}$CO{arg1[,arg2...]}yesyes
      {@link org.apache.juneau.svl.vars.CoalesceAndRecurseVar}$CR{arg1[,arg2...]}yesyes
      {@link org.apache.juneau.svl.vars.IfVar}$IF{booleanArg,thenValue[,elseValue]}yesyes
      {@link org.apache.juneau.svl.vars.SwitchVar}$SW{stringArg(,pattern,thenValue)+[,elseValue]}yesyes
      juneau-config{@link org.apache.juneau.ini.vars.ConfigFileVar}$C{key[,defaultValue]}yesyes
      juneau-rest-server{@link org.apache.juneau.rest.vars.FileVar}$F{path[,defaultValue]}}noyes
      {@link org.apache.juneau.rest.vars.ServletInitParamVar}$I{name[,defaultValue]}yesyes
      {@link org.apache.juneau.rest.vars.LocalizationVar}$L{key[,args...]}noyes
      {@link org.apache.juneau.rest.vars.RequestAttributeVar}$RA{key1[,key2...]}noyes
      {@link org.apache.juneau.rest.vars.RequestFormDataVar}$RF{key1[,key2...]}noyes
      {@link org.apache.juneau.rest.vars.RequestHeaderVar}$RH{key1[,key2...]}noyes
      {@link org.apache.juneau.rest.vars.RequestHeaderVar}$RI{key}noyes
      {@link org.apache.juneau.rest.vars.RequestPathVar}$RP{key1[,key2...]}noyes
      {@link org.apache.juneau.rest.vars.RequestQueryVar}$RQ{key1[,key2...]}noyes
      {@link org.apache.juneau.rest.vars.RequestVar}$R{key1[,key2...]}noyes
      {@link org.apache.juneau.rest.vars.SerializedRequestAttrVar}$SA{contentType,key[,defaultValue]}noyes
      {@link org.apache.juneau.rest.vars.UrlVar}$U{uri}>noyes
      {@link org.apache.juneau.rest.vars.UrlEncodeVar}$UE{uriPart}yesyes
      {@link org.apache.juneau.rest.vars.WidgetVar}$W{widgetName}noyes
      juneau-microservice-server{@link org.apache.juneau.microservice.vars.ArgsVar}$ARG{key[,defaultValue]}yes*yes*
      {@link org.apache.juneau.microservice.vars.ManifestFileVar}$MF{key[,defaultValue]}yes*yes*
      +

      + * = Only if extending from {@link org.apache.juneau.microservice.Resource} +

      @@ -17208,7 +17551,7 @@

    1. More consistent handling of exceptions.
    2. More consistent method declarations. -
    3. Refactored var resolver API and added them to a new package - org.apache.juneau.svl. +
    4. Refactored var resolver API and added them to a new package - org.apache.juneau.svl.
      • Support for stream-based variables - {@link org.apache.juneau.svl.StreamedVar}.
      • Added support for context and session objects. diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java index c15753f..5746d35 100755 --- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Microservice.java @@ -25,9 +25,11 @@ import java.util.logging.*; import org.apache.juneau.*; import org.apache.juneau.ini.*; +import org.apache.juneau.ini.vars.*; import org.apache.juneau.internal.*; import org.apache.juneau.microservice.console.*; import org.apache.juneau.microservice.resources.*; +import org.apache.juneau.microservice.vars.*; import org.apache.juneau.svl.*; import org.apache.juneau.svl.vars.*; import org.apache.juneau.utils.*; diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Resource.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Resource.java index 0e1d64b..c0d7014 100755 --- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Resource.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/Resource.java @@ -14,9 +14,9 @@ package org.apache.juneau.microservice; import static org.apache.juneau.rest.annotation.HookEvent.*; +import org.apache.juneau.microservice.vars.*; import org.apache.juneau.rest.*; import org.apache.juneau.rest.annotation.*; -import org.apache.juneau.svl.vars.*; /** * Superclass for all REST resources. diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceGroup.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceGroup.java index c27c6e5..3b2da75 100755 --- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceGroup.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceGroup.java @@ -14,9 +14,9 @@ package org.apache.juneau.microservice; import static org.apache.juneau.rest.annotation.HookEvent.*; +import org.apache.juneau.microservice.vars.*; import org.apache.juneau.rest.*; import org.apache.juneau.rest.annotation.*; -import org.apache.juneau.svl.vars.*; /** * Superclass for all REST resource groups. diff --git a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java index 535af3a..d31ca0c 100644 --- a/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/ResourceJenaGroup.java @@ -15,9 +15,9 @@ package org.apache.juneau.microservice; import static org.apache.juneau.rest.annotation.HookEvent.*; import org.apache.juneau.jena.*; +import org.apache.juneau.microservice.vars.*; import org.apache.juneau.rest.*; import org.apache.juneau.rest.annotation.*; -import org.apache.juneau.svl.vars.*; /** * Superclass for all REST resource groups. diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/ArgsVar.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/ArgsVar.java similarity index 98% rename from juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/ArgsVar.java rename to juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/ArgsVar.java index 5387299..d3cb8cb 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/ArgsVar.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/ArgsVar.java @@ -10,7 +10,7 @@ // * "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 org.apache.juneau.svl.vars; +package org.apache.juneau.microservice.vars; import org.apache.juneau.svl.*; import org.apache.juneau.utils.*; diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/ManifestFileVar.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/ManifestFileVar.java similarity index 98% rename from juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/ManifestFileVar.java rename to juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/ManifestFileVar.java index d6bbc83..ae7d3a6 100644 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/ManifestFileVar.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/ManifestFileVar.java @@ -10,7 +10,7 @@ // * "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 org.apache.juneau.svl.vars; +package org.apache.juneau.microservice.vars; import org.apache.juneau.svl.*; import org.apache.juneau.utils.*; diff --git a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/package-info.java old mode 100644 new mode 100755 similarity index 65% copy from juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java copy to juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/package-info.java index 4dd0471..40b9863 --- a/juneau-core/juneau-svl/src/main/java/org/apache/juneau/svl/vars/CoalesceAndRecurseVar.java +++ b/juneau-microservice/juneau-microservice-server/src/main/java/org/apache/juneau/microservice/vars/package-info.java @@ -1,44 +1,18 @@ -// *************************************************************************************************************************** -// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * -// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * -// * to you 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 org.apache.juneau.svl.vars; - -import org.apache.juneau.svl.*; - -/** - * A basic variable resolver that returns the first non-null value. - * - *

        - * The format for this var is "$CR{arg1[,arg2...]}". - * - *

        - * The difference between {@link CoalesceVar} and {@link CoalesceAndRecurseVar} is that the first will not resolve - * inner variables nor recursively resolve variables, and the second will. - * Use {@link CoalesceVar} when resolving user-input. - */ -public class CoalesceAndRecurseVar extends MultipartResolvingVar { - - /** The name of this variable. */ - public static final String NAME = "CR"; - - /** - * Constructor. - */ - public CoalesceAndRecurseVar() { - super(NAME); - } - - @Override - public String resolve(VarResolverSession session, String arg) throws Exception { - return arg; - } -} +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you 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. * +// *************************************************************************************************************************** + +/** + * Predefined SVL Variables + */ +package org.apache.juneau.microservice.vars; + diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java index b93b69b..9ae0f9c 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java @@ -31,6 +31,7 @@ import org.apache.juneau.encoders.Encoder; import org.apache.juneau.http.*; import org.apache.juneau.httppart.*; import org.apache.juneau.ini.*; +import org.apache.juneau.ini.vars.*; import org.apache.juneau.internal.*; import org.apache.juneau.parser.*; import org.apache.juneau.rest.annotation.*; diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java index 14713fa..2b1bdb7 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/ResourceSwagger.java @@ -12,7 +12,7 @@ // *************************************************************************************************************************** package org.apache.juneau.rest.annotation; -import org.apache.juneau.ini.*; +import org.apache.juneau.ini.vars.*; import org.apache.juneau.rest.vars.*; import org.apache.juneau.svl.vars.*; diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java index b5ef9c3..1f3e3e8 100644 --- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java +++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/vars/FileVar.java @@ -61,7 +61,7 @@ import org.apache.juneau.utils.*; * *

        See Also:
        * */ public class FileVar extends DefaultingVar { -- To stop receiving notification emails like this one, please contact jamesbognar@apache.org.