App ScriptsWhitelisted Groovy Classes

Whitelisted Groovy Classes for Application Scripts

This page enumerates the Groovy classes that are whitelisted for use in TrackVia Application Scripts. Using classes or methods not on this list will result in an error.

Java Core Classes

ClassMethods Allowed
java.lang.ClassgetName()
java.lang.EnumAll methods
java.lang.IntegerAll methods
java.lang.DoubleAll methods
java.lang.NumberAll methods
java.lang.ObjectAll methods
java.lang.RuntimeExceptionAll methods
java.lang.StringAll methods
java.lang.SystemcurrentTimeMillis(), nanoTime()
java.lang.ThreadLocalget()
java.lang.MathAll methods

Java Collections

ClassMethods Allowed
java.util.CalendarAll methods
java.util.DateAll methods
java.util.CollectionAll methods
java.util.IteratorAll methods
java.util.ListAll methods
java.util.MapAll methods
java.util.Map.EntrygetKey()
java.util.SetAll methods
java.util.TimeZoneAll methods (except: setDefault(TimeZone))

Java Time API (Complete)

All methods are permitted for the following classes in the java.time package.

ClassClass
java.time.LocalDatejava.time.format.DateTimeFormatter
java.time.Instantjava.time.format.DateTimeFormatterBuilder
java.time.LocalDateTimejava.time.format.DecimalStyle
java.time.LocalTimejava.time.format.ResolverStyle
java.time.Yearjava.time.format.FormatStyle
java.time.YearMonthjava.time.format.SignStyle
java.time.Monthjava.time.format.TextStyle
java.time.MonthDayjava.time.format.DateTimeParseException
java.time.ZonedDateTimejava.time.temporal.ChronoField
java.time.ZoneIdjava.time.temporal.ChronoUnit
java.time.ZoneOffsetjava.time.temporal.ValueRange
java.time.OffsetDateTimejava.time.temporal.IsoFields
java.time.OffsetTimejava.time.temporal.TemporalAdjusters
java.time.DayOfWeekjava.time.temporal.TemporalQueries
java.time.DateTimeExceptionjava.time.chrono.IsoChronology
java.time.Period
java.time.Duration

Java Text & Math

ClassMethods Allowed
java.text.DateFormatAll methods
java.text.SimpleDateFormatAll methods
java.math.BigDecimalAll methods

Groovy Classes

ClassMethods Allowed
groovy.lang.ClosureAll methods
groovy.json.JsonSlurperAll methods
groovy.json.JsonBuilderAll methods
org.apache.groovy.dateutil.extensions.DateUtilExtensionsAll methods
org.apache.groovy.dateutil.extensions.DateUtilStaticExtensionsAll methods
org.codehaus.groovy.runtime.DefaultGroovyMethodsAll methods (exceptions below)
org.codehaus.groovy.runtime.StringGroovyMethodsAll methods

Exceptions for org.codehaus.groovy.runtime.DefaultGroovyMethods: The following methods and types are not permitted:

  • println/printf/print
  • addShutdownHook(Object, Closure)
  • getRootLoader(ClassLoader)
  • Any method whose parameter or return type is in java.io, java.net, java.lang.Class, groovy.lang.MetaClass

Apache Commons

ClassMethods Allowed
org.apache.commons.codec.digest.DigestUtilssha256Hex()