Uses of Interface
org.apache.juneau.commons.svl.VarFunction
Packages that use VarFunction
Package
Description
Simple Variable Language (SVL).
Built-in
VarFunction catalog for
#{name(args...)} script-evaluation syntax.Safe, structured templates for template authors who are less trusted than the application.
-
Uses of VarFunction in org.apache.juneau.commons.svl
Classes in org.apache.juneau.commons.svl that implement VarFunctionModifier and TypeClassDescriptionclassReflection-based base class forVarFunctionimplementations that prefer typed argument signatures over manualList<Object>unpacking.Methods in org.apache.juneau.commons.svl that return VarFunctionModifier and TypeMethodDescriptionVarResolverSession.findFunction(String name) Looks up a registered function by exact name.Methods in org.apache.juneau.commons.svl that return types with arguments of type VarFunctionModifier and TypeMethodDescriptionprotected Map<String,VarFunction> VarResolver.getFunctionMap()Returns an unmodifiable map ofVarFunctionsassociated with this context.Methods in org.apache.juneau.commons.svl with parameters of type VarFunctionModifier and TypeMethodDescriptionVarResolver.Builder.functions(VarFunction... values) Register one or moreVarFunctioninstances on this builder. -
Uses of VarFunction in org.apache.juneau.commons.svl.functions
Classes in org.apache.juneau.commons.svl.functions that implement VarFunctionModifier and TypeClassDescriptionstatic class#{abs(a)}— returns the absolute value ofa.static class#{add(a, b)}— returnsa + b.static class#{divide(a, b)}— returnsa / b.static class#{max(a, b)}— returns the larger of two numbers.static class#{min(a, b)}— returns the smaller of two numbers.static class#{modulo(a, b)}— returnsa % b.static class#{multiply(a, b)}— returnsa * b.static class#{subtract(a, b)}— returnsa - b.static class#{and(a, b, ...)}— returns"true"only if all args are true.static class#{eq(a, b)}— string-equality.static class#{gt(a, b)}— numeric greater-than.static class#{gte(a, b)}— numeric greater-than-or-equal.static class#{lt(a, b)}— numeric less-than.static class#{lte(a, b)}— numeric less-than-or-equal.static class#{neq(a, b)}— string-inequality.static class#{not(a)}— returns the boolean negation ofa.static class#{or(a, b, ...)}— returns"true"if any arg is true.static class#{xor(a, b)}— returnsa XOR b.static class#{list(a, b, ...)}— a list of the arguments;list()is empty.static class#{take(list, n)}— the firstnelements oflist(all of them if it is shorter).static class#{coalesce(a, b, ...)}— replacement for the legacyCOvariable.static class#{if(cond, then, else)}— replacement for the legacyIFvariable.static class#{notEmpty(s)}— replacement for the legacyNEvariable.static class#{switch(value, case1, val1, case2, val2, ..., default)}— replacement for the legacySWvariable.static classstatic class#{now()}— current epoch milliseconds (UTC).static class#{parseDate(s)}/#{parseDate(s, format)}— parses an ISO-8601 string or aDateTimeFormatter-pattern string to epoch milliseconds.static class#{base64Decode(s)}— Base64-decodess(UTF-8 result).static class#{base64Encode(s)}— Base64-encodess(UTF-8).static class#{htmlEscape(s)}— escapes&,<,>,",'(the OWASP minimal HTML-injection-safe set).static class#{htmlUnescape(s)}— inverse ofEncodingFunctions.HtmlEscape.static class#{urlDecode(s)}— URL-form-decodes.static class#{urlEncode(s)}— URL-form-encodes (i.e.static class#{get(json, key)}— extractsjson[key](object) orjson[index](array, whenkeyparses as int).static class#{jsonPath(json, path)}/#{jsonPath(json, path, default)}— extracts a value via a slash-rooted path (e.g.static class#{keys(json)}— returns a JSON-array-shortcut string of an object's keys.static class#{size(x)}— returns the count as a number: element count of a collection or map value, otherwise (for JSON text) object key count, array length, string length, or0for null/primitives.static class#{values(json)}— returns a JSON-array-shortcut string of an object's values (or array elements).static class$op.add.static class$op.and.static class$op.div.static class$op.elvis.static class$op.eq.static class$op.ge.static class$op.gt.static class$op.le.static class$op.lt.static class$op.matches.static class$op.mod.static class$op.mul.static class$op.ne.static class$op.neg.static class$op.not.static class$op.or.static class$op.pos.static classRegistered stub for the evaluator-only$op.projectoperator.static classRegistered stub for the evaluator-only$op.selectoperator.static class$op.sub.static class$op.ternary.static class#{rand()}— random double in[0.0, 1.0).static class#{randChoice(option1, option2, ...)}— variadic.static class#{randInt(max)}— random int in[0, max).static class#{randLong(min, max)}— random long in[min, max](inclusive both ends).static class#{randString(length)}— random alphanumeric[A-Za-z0-9]string oflengthcharacters.static class#{uuid()}— random UUID viaUUID.randomUUID().static class#{extract(s, regex)}/#{extract(s, regex, group)}— replacement for the legacyPEvariable.static class#{match(s, regex)}— replacement for the legacyPMvariable.static class#{replaceRegex(s, regex, replacement)}— replacement for the legacyPRvariable.static class#{concat(s1, s2, ...)}— variadic string concatenation.static class#{contains(s, substr)}— returns"true"or"false".static class#{endsWith(s, suffix)}— returns"true"or"false".static class#{format(pattern, args...)}—Java formatter-style formatting.static class#{join(separator, parts...)}— concatenatespartswithseparatorbetween each pair.static class#{len(s)}/#{len(s, delimiter)}— replacement for the legacyLNvariable.static class#{lower(s)}— replacement for the legacyLCvariable.static class#{pathToken(s)}— normalize a user-supplied path token for safe interpolation into apath=template.static class#{repeat(s, n)}— repeatssntimes.static class#{replace(s, target, replacement)}— literal (non-regex) string replacement.static class#{reverse(s)}— reverses the characters ofs.static class#{split(s, separator)}— splitsson the literalseparatorsubstring.static class#{startsWith(s, prefix)}— returns"true"or"false".static class#{stripLeading(s)}— strips leading whitespace.static class#{stripSlashes(s)}— strips leading and trailing/characters.static class#{stripTrailing(s)}— strips trailing whitespace.static class#{substring(s, start)}/#{substring(s, start, end)}— replacement for the legacySTSubstringVar.static class#{trim(s)}— strips leading and trailing whitespace.static class#{upper(s)}— replacement for the legacyUCvariable.static class#{block(x)}.static class#{ol(items...)}or#{ol(list)}.static class#{table(headerList, rowsList)}; each row is a list (or collection).static class#{ul(items...)}or#{ul(list)}.static class#{toBool(s)}— coercesstobooleanand renders as a String.static class#{toDouble(s)}— coercesstodoubleand renders as a String.static class#{toInt(s)}— coercesstointand renders as a String.static class#{toLong(s)}— coercesstolongand renders as a String. -
Uses of VarFunction in org.apache.juneau.commons.template
Methods in org.apache.juneau.commons.template with parameters of type VarFunctionModifier and TypeMethodDescriptionTemplateResolver.Builder.functions(VarFunction... values) Registers additional functions.