Class BIF

java.lang.Object
ortus.boxlang.runtime.bifs.BIF
Direct Known Subclasses:
Abs, Acos, ApplicationRestart, ApplicationStartTime, ApplicationStop, ArrayAppend, ArrayAvg, ArrayClear, ArrayDelete, ArrayDeleteAt, ArrayEach, ArrayEvery, ArrayFilter, ArrayFind, ArrayFindAll, ArrayFirst, ArrayGetMetadata, ArrayIndexExists, ArrayInsertAt, ArrayIsEmpty, ArrayLast, ArrayMap, ArrayMax, ArrayMedian, ArrayMerge, ArrayMin, ArrayNew, ArrayPop, ArrayPrepend, ArrayPush, ArrayReduce, ArrayReduceRight, ArrayResize, ArrayReverse, ArraySet, ArrayShift, ArraySlice, ArraySome, ArraySort, ArraySplice, ArraySum, ArraySwap, ArrayToList, ArrayToStruct, ArrayUnshift, Ascii, Asin, Atn, Attempt, BinaryDecode, BinaryEncode, BitAnd, BitMaskClear, BitMaskRead, BitMaskSet, BitNot, BitOr, BitSh, BitXor, BooleanFormat, BoxAnnounce, BoxAnnounceAsync, BoxLangBIFProxy, BoxRegisterInterceptor, CallStackGet, CamelCase, Ceiling, Char, CharsetDecode, CharsetEncode, ClearLocale, ClearTimezone, Compare, CompareNoCase, Cos, CreateDateTime, CreateDynamicProxy, CreateGUID, CreateObject, CreateODBCDateTime, CreateTempDirectory, CreateTempFile, CreateTimeSpan, CreateUUID, DataNavigate, DateAdd, DateCompare, DateConvert, DateDiff, DateTimeFormat, DE, DebugBoxContexts, DecimalFormat, DecrementValue, Decrypt, DirectoryCopy, DirectoryCreate, DirectoryDelete, DirectoryExists, DirectoryList, DirectoryMove, Dump, Duplicate, EncodeForHTML, Encrypt, Exp, ExpandPath, FileAppend, FileClose, FileCopy, FileDelete, FileExists, FileGetMimeType, FileInfo, FileIsEOF, FileMove, FileOpen, FileRead, FileReadLine, FileSeek, FileSetAccessMode, FileSetAttribute, FileSetLastModified, FileWrite, FileWriteLine, Find, FindOneOf, Fix, Floor, FormatBaseN, GenerateSecretKey, GetApplicationMetadata, GetBaseTemplatePath, GetBoxCache, GetBoxCacheFilter, GetBoxCacheNames, GetBoxCacheProviders, GetBoxContext, GetBoxRuntime, GetBoxVersionInfo, GetCanonicalPath, GetClassMetadata, GetComponentList, GetContextRoot, GetCurrentTemplatePath, GetDirectoryFromPath, GetFileFromPath, GetFunctionCalledName, GetFunctionList, GetLocale, GetLocaleInfo, GetMetaData, GetSystemSetting, GetTempDirectory, GetTickCount, GetTimezoneInfo, GetToken, Hash, Hmac, IIF, IncrementValue, InputBaseN, Insert, Int, Invoke, IsArray, IsBinary, IsBoolean, IsClosure, IsCurrency, IsCustomFunction, IsDate, IsDateObject, IsDebugMode, IsDefined, IsEmpty, IsFileObject, IsInstanceOf, IsInThread, IsInTransaction, IsIPv6, IsJSON, IsLeapYear, IsLocalHost, IsNull, IsNumeric, IsObject, IsQuery, IsSimpleValue, IsStruct, IsValid, IsXML, IsXmlAttribute, IsXMLDoc, IsXMLElem, IsXMLNode, IsXMLRoot, JavaCast, JSONDeserialize, JSONPrettify, JSONSerialize, Justify, KebabCase, LCase, Left, Len, ListAppend, ListChangeDelims, ListCompact, ListDeleteAt, ListFilter, ListGetAt, ListGetEndings, ListIndexExists, ListInsertAt, ListItemTrim, ListLen, ListPrepend, ListQualify, ListRemoveDuplicates, ListRest, ListSetAt, ListToArray, ListValueCount, Log, Log10, LSIsDate, LSParseDateTime, LTrim, Max, Mid, Min, Now, NullValue, NumberFormat, PagePoolClear, ParagraphFormat, ParseCurrency, ParseDateTime, ParseNumber, PascalCase, Pi, PrecisionEvaluate, Print, Println, QueryAddColumn, QueryAddRow, QueryAppend, QueryClear, QueryColumnArray, QueryColumnCount, QueryColumnData, QueryColumnExists, QueryCurrentRow, QueryDeleteColumn, QueryDeleteRow, QueryEach, QueryEvery, QueryExecute, QueryFilter, QueryGetCell, QueryGetResult, QueryKeyExists, QueryMap, QueryNew, QueryPrepend, QueryRecordCount, QueryReduce, QueryRowData, QuerySetCell, QuerySetRow, QuerySlice, QuerySome, QuerySort, QueryStringToStruct, Rand, Randomize, RandRange, ReEscape, ReFind, ReMatch, RemoveChars, RepeatString, Replace, ReplaceList, ReplaceNoCase, ReReplace, Reverse, Right, Round, RTrim, RunThreadInContext, SessionInvalidate, SessionRotate, SessionStartTime, SetLocale, SetTimezone, Sgn, Sin, Sleep, Slugify, SnakeCase, SpanExcluding, SpanIncluding, SQLPrettify, Sqr, StripCR, StructAppend, StructClear, StructCopy, StructDelete, StructEach, StructEquals, StructEvery, StructFilter, StructFind, StructFindKey, StructFindValue, StructGet, StructGetMetadata, StructInsert, StructIsCaseSensitive, StructIsOrdered, StructKeyArray, StructKeyExists, StructKeyList, StructKeyTranslate, StructMap, StructNew, StructReduce, StructSome, StructSort, StructToQueryString, StructToSorted, StructValueArray, SystemExecute, SystemOutput, Tan, Throw, TimeUnits, ToBase64, ToBinary, ToImmutable, ToMutable, ToNumeric, ToScript, ToString, TransactionCommit, TransactionRollback, TransactionSetSavepoint, Trim, TrueFalseFormat, UCase, UCFirst, URLDecode, URLEncodedFormat, Val, Wrap, WriteLog, WriteOutput, XMLChildPos, XMLElemNew, XMLFormat, XMLGetNodeType, XMLNew, XMLParse, XMLSearch, XMLTransform, XMLValidate, YesNoFormat

public abstract class BIF extends Object
Base class for all BIFs. BIFs are invoked by the runtime when a function is called.
  • Field Details

    • __isMemberExecution

      public static final Key __isMemberExecution
      Used to indicate that the BIF is being invoked as a member function and it will replace the first argument with the object on which it is being invoked
    • __functionName

      public static final Key __functionName
      Used to indicate what is the name of the function being invoked just like getCalledFunctionName() but internally
    • declaredArguments

      protected Argument[] declaredArguments
      BIF Arguments
    • runtime

      public BoxRuntime runtime
      The runtime instance. This is public for a unit test to use
    • functionService

      protected FunctionService functionService
      The function service helper
    • componentService

      protected ComponentService componentService
      The component service helper
    • interceptorService

      protected InterceptorService interceptorService
      The interceptor service helper
    • cacheService

      protected CacheService cacheService
      The cache service helper
    • asyncService

      protected AsyncService asyncService
      The async service helper
  • Constructor Details

    • BIF

      public BIF()
  • Method Details

    • invoke

      public Object invoke(IBoxContext context, ArgumentsScope arguments)
      Invoke the BIF with the given arguments
      Parameters:
      context - The context in which the BIF is being invoked
      arguments - The arguments to the BIF
      Returns:
      The result of the invocation
    • _invoke

      public abstract Object _invoke(IBoxContext context, ArgumentsScope arguments)
      This is overridden by the concrete to provide the actual BIF implementation
      Parameters:
      context - The context in which the BIF is being invoked
      arguments - The arguments to the BIF
      Returns:
      The result of the invocation
    • getDeclaredArguments

      public Argument[] getDeclaredArguments()
      Get the arguments for this BIF
      Returns:
      The arguments for this BIF
    • announce

      public void announce(Key state, IStruct data)
      Announce an event with the provided IStruct of data.
      Parameters:
      state - The state key to announce
      data - The data to announce