Package dev.cel.common.ast
Class CelExprFactory
- java.lang.Object
-
- dev.cel.common.ast.CelExprFactory
-
- Direct Known Subclasses:
CelMacroExprFactory
@Internal public class CelExprFactory extends java.lang.ObjectFactory for generating expression nodes.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCelExprFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description dev.cel.common.ast.CelExprfold(java.lang.String iterVar, dev.cel.common.ast.CelExpr iterRange, java.lang.String accuVar, dev.cel.common.ast.CelExpr accuInit, dev.cel.common.ast.CelExpr condition, dev.cel.common.ast.CelExpr step, dev.cel.common.ast.CelExpr result)Fold creates a fold for one variable comprehension instruction.dev.cel.common.ast.CelExprfold(java.lang.String iterVar, java.lang.String iterVar2, dev.cel.common.ast.CelExpr iterRange, java.lang.String accuVar, dev.cel.common.ast.CelExpr accuInit, dev.cel.common.ast.CelExpr condition, dev.cel.common.ast.CelExpr step, dev.cel.common.ast.CelExpr result)Fold creates a fold for two variable comprehension instruction.dev.cel.common.ast.CelExprnewBoolLiteral(boolean value)Creates a new constantCelExprfor a bool value.dev.cel.common.ast.CelExprnewBytesLiteral(byte[] value)Creates a new constantCelExprfor a bytes value.dev.cel.common.ast.CelExprnewBytesLiteral(dev.cel.common.values.CelByteString value)Creates a new constantCelExprfor a bytes value.dev.cel.common.ast.CelExprnewBytesLiteral(java.lang.String value)Creates a new constantCelExprfor a bytes value.dev.cel.common.ast.CelExprnewConstant(dev.cel.common.ast.CelConstant constant)Create a new constant expression.dev.cel.common.ast.CelExprnewDoubleLiteral(double value)Creates a new constantCelExprfor a double value.dev.cel.common.ast.CelExprnewGlobalCall(java.lang.String function, dev.cel.common.ast.CelExpr... arguments)Creates a global (free) function callCelExprfor the given function and arguments.dev.cel.common.ast.CelExprnewGlobalCall(java.lang.String function, java.lang.Iterable<dev.cel.common.ast.CelExpr> arguments)Creates a global (free) function callCelExprfor the given function and arguments.dev.cel.common.ast.CelExprnewIdentifier(java.lang.String name)Creates an identifierCelExprfor the given name.static CelExprFactorynewInstance()dev.cel.common.ast.CelExprnewIntLiteral(long value)Creates a new constantCelExprfor an int value.dev.cel.common.ast.CelExprnewList(dev.cel.common.ast.CelExpr... elements)Creates a new listCelExprcomprised of the elements.dev.cel.common.ast.CelExprnewList(java.lang.Iterable<dev.cel.common.ast.CelExpr> elements)Creates a new listCelExprcomprised of the elements.dev.cel.common.ast.CelExprnewMap(dev.cel.common.ast.CelExpr.CelMap.Entry... entries)Creates a new mapCelExprcomprised of the entries.dev.cel.common.ast.CelExprnewMap(java.lang.Iterable<dev.cel.common.ast.CelExpr.CelMap.Entry> entries)Creates a new mapCelExprcomprised of the entries.dev.cel.common.ast.CelExpr.CelMap.EntrynewMapEntry(dev.cel.common.ast.CelExpr key, dev.cel.common.ast.CelExpr value)Creates a new mapCelExpr.CelStruct.Entrycomprised of the given key and value.dev.cel.common.ast.CelExprnewMessage(java.lang.String typeName, dev.cel.common.ast.CelExpr.CelStruct.Entry... fields)Creates a new messageCelExprof the given type comprised of the given fields.dev.cel.common.ast.CelExprnewMessage(java.lang.String typeName, java.lang.Iterable<dev.cel.common.ast.CelExpr.CelStruct.Entry> fields)Creates a new messageCelExprof the given type comprised of the given fields.dev.cel.common.ast.CelExpr.CelStruct.EntrynewMessageField(java.lang.String field, dev.cel.common.ast.CelExpr value)Creates a new messageCelExpr.CelStruct.Entrycomprised of the given field and value.dev.cel.common.ast.CelExprnewReceiverCall(java.lang.String function, dev.cel.common.ast.CelExpr target, dev.cel.common.ast.CelExpr... arguments)Creates a receiver-style function callCelExprfor the given function, target, and arguments.dev.cel.common.ast.CelExprnewReceiverCall(java.lang.String function, dev.cel.common.ast.CelExpr target, java.lang.Iterable<dev.cel.common.ast.CelExpr> arguments)Creates a receiver-style function callCelExprfor the given function, target, and arguments.dev.cel.common.ast.CelExprnewSelect(dev.cel.common.ast.CelExpr operand, java.lang.String field, boolean testOnly)Creates a field traversal or field presence testCelExprfor the given operand and field.dev.cel.common.ast.CelExprnewStringLiteral(java.lang.String value)Creates a new constantCelExprfor a string value.dev.cel.common.ast.CelExprnewUintLiteral(long value)Creates a new constantCelExprfor a uint value.protected longnextExprId()Returns the next unique expression ID.
-
-
-
Method Detail
-
newInstance
public static CelExprFactory newInstance()
-
newConstant
public final dev.cel.common.ast.CelExpr newConstant(dev.cel.common.ast.CelConstant constant)
Create a new constant expression.
-
newBoolLiteral
public final dev.cel.common.ast.CelExpr newBoolLiteral(boolean value)
Creates a new constantCelExprfor a bool value.
-
newBytesLiteral
public final dev.cel.common.ast.CelExpr newBytesLiteral(java.lang.String value)
Creates a new constantCelExprfor a bytes value.
-
newBytesLiteral
public final dev.cel.common.ast.CelExpr newBytesLiteral(byte[] value)
Creates a new constantCelExprfor a bytes value.
-
newBytesLiteral
public final dev.cel.common.ast.CelExpr newBytesLiteral(dev.cel.common.values.CelByteString value)
Creates a new constantCelExprfor a bytes value.
-
newDoubleLiteral
public final dev.cel.common.ast.CelExpr newDoubleLiteral(double value)
Creates a new constantCelExprfor a double value.
-
newIntLiteral
public final dev.cel.common.ast.CelExpr newIntLiteral(long value)
Creates a new constantCelExprfor an int value.
-
newStringLiteral
public final dev.cel.common.ast.CelExpr newStringLiteral(java.lang.String value)
Creates a new constantCelExprfor a string value.
-
newUintLiteral
public final dev.cel.common.ast.CelExpr newUintLiteral(long value)
Creates a new constantCelExprfor a uint value.
-
newList
public final dev.cel.common.ast.CelExpr newList(dev.cel.common.ast.CelExpr... elements)
Creates a new listCelExprcomprised of the elements.
-
newList
public final dev.cel.common.ast.CelExpr newList(java.lang.Iterable<dev.cel.common.ast.CelExpr> elements)
Creates a new listCelExprcomprised of the elements.
-
newMap
public final dev.cel.common.ast.CelExpr newMap(dev.cel.common.ast.CelExpr.CelMap.Entry... entries)
Creates a new mapCelExprcomprised of the entries.
-
newMap
public final dev.cel.common.ast.CelExpr newMap(java.lang.Iterable<dev.cel.common.ast.CelExpr.CelMap.Entry> entries)
Creates a new mapCelExprcomprised of the entries.
-
newMapEntry
public final dev.cel.common.ast.CelExpr.CelMap.Entry newMapEntry(dev.cel.common.ast.CelExpr key, dev.cel.common.ast.CelExpr value)Creates a new mapCelExpr.CelStruct.Entrycomprised of the given key and value.
-
newMessage
public final dev.cel.common.ast.CelExpr newMessage(java.lang.String typeName, dev.cel.common.ast.CelExpr.CelStruct.Entry... fields)Creates a new messageCelExprof the given type comprised of the given fields.
-
newMessage
public final dev.cel.common.ast.CelExpr newMessage(java.lang.String typeName, java.lang.Iterable<dev.cel.common.ast.CelExpr.CelStruct.Entry> fields)Creates a new messageCelExprof the given type comprised of the given fields.
-
newMessageField
public final dev.cel.common.ast.CelExpr.CelStruct.Entry newMessageField(java.lang.String field, dev.cel.common.ast.CelExpr value)Creates a new messageCelExpr.CelStruct.Entrycomprised of the given field and value.
-
fold
public final dev.cel.common.ast.CelExpr fold(java.lang.String iterVar, dev.cel.common.ast.CelExpr iterRange, java.lang.String accuVar, dev.cel.common.ast.CelExpr accuInit, dev.cel.common.ast.CelExpr condition, dev.cel.common.ast.CelExpr step, dev.cel.common.ast.CelExpr result)Fold creates a fold for one variable comprehension instruction.
-
fold
public final dev.cel.common.ast.CelExpr fold(java.lang.String iterVar, java.lang.String iterVar2, dev.cel.common.ast.CelExpr iterRange, java.lang.String accuVar, dev.cel.common.ast.CelExpr accuInit, dev.cel.common.ast.CelExpr condition, dev.cel.common.ast.CelExpr step, dev.cel.common.ast.CelExpr result)Fold creates a fold for two variable comprehension instruction.
-
newIdentifier
public final dev.cel.common.ast.CelExpr newIdentifier(java.lang.String name)
Creates an identifierCelExprfor the given name.
-
newGlobalCall
public final dev.cel.common.ast.CelExpr newGlobalCall(java.lang.String function, dev.cel.common.ast.CelExpr... arguments)Creates a global (free) function callCelExprfor the given function and arguments.
-
newGlobalCall
public final dev.cel.common.ast.CelExpr newGlobalCall(java.lang.String function, java.lang.Iterable<dev.cel.common.ast.CelExpr> arguments)Creates a global (free) function callCelExprfor the given function and arguments.
-
newReceiverCall
public final dev.cel.common.ast.CelExpr newReceiverCall(java.lang.String function, dev.cel.common.ast.CelExpr target, dev.cel.common.ast.CelExpr... arguments)Creates a receiver-style function callCelExprfor the given function, target, and arguments.
-
newReceiverCall
public final dev.cel.common.ast.CelExpr newReceiverCall(java.lang.String function, dev.cel.common.ast.CelExpr target, java.lang.Iterable<dev.cel.common.ast.CelExpr> arguments)Creates a receiver-style function callCelExprfor the given function, target, and arguments.
-
newSelect
public final dev.cel.common.ast.CelExpr newSelect(dev.cel.common.ast.CelExpr operand, java.lang.String field, boolean testOnly)Creates a field traversal or field presence testCelExprfor the given operand and field.
-
nextExprId
protected long nextExprId()
Returns the next unique expression ID.
-
-