Package dev.cel.expr
Class SourceInfo
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
dev.cel.expr.SourceInfo
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,SourceInfoOrBuilder,Serializable
public final class SourceInfo
extends com.google.protobuf.GeneratedMessage
implements SourceInfoOrBuilder
Source information collected at parse time.Protobuf type
cel.expr.SourceInfo- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSource information collected at parse time.static final classAn extension that was requested for the source expression.static interfaceprivate static final classprivate static final classNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final SourceInfoprivate List<SourceInfo.Extension> static final intstatic final intprivate com.google.protobuf.Internal.IntListprivate intprivate Objectstatic final intstatic final intprivate byteprivate static final com.google.protobuf.Parser<SourceInfo> static final intprivate static final longstatic final intprivate ObjectFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprivateSourceInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsMacroCalls(long key) A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion.booleancontainsPositions(long key) A map from the parse node id (e.g.booleanstatic SourceInfostatic final com.google.protobuf.Descriptors.DescriptorgetExtensions(int index) A list of tags for extensions that were used while parsing or type checking the source expression.intA list of tags for extensions that were used while parsing or type checking the source expression.A list of tags for extensions that were used while parsing or type checking the source expression.getExtensionsOrBuilder(int index) A list of tags for extensions that were used while parsing or type checking the source expression.List<? extends SourceInfo.ExtensionOrBuilder> A list of tags for extensions that were used while parsing or type checking the source expression.intgetLineOffsets(int index) Monotonically increasing list of code point offsets where newlines `\n` appear.intMonotonically increasing list of code point offsets where newlines `\n` appear.Monotonically increasing list of code point offsets where newlines `\n` appear.The location name.com.google.protobuf.ByteStringThe location name.Deprecated.intA map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion.A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion.getMacroCallsOrDefault(long key, Expr defaultValue) A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion.getMacroCallsOrThrow(long key) A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion.com.google.protobuf.Parser<SourceInfo> Deprecated.intA map from the parse node id (e.g.A map from the parse node id (e.g.intgetPositionsOrDefault(long key, int defaultValue) A map from the parse node id (e.g.intgetPositionsOrThrow(long key) A map from the parse node id (e.g.intThe syntax version of the source, e.g.com.google.protobuf.ByteStringThe syntax version of the source, e.g.inthashCode()protected com.google.protobuf.GeneratedMessage.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) final booleanstatic SourceInfo.Builderstatic SourceInfo.BuildernewBuilder(SourceInfo prototype) protected SourceInfo.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static SourceInfoparseDelimitedFrom(InputStream input) static SourceInfoparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static SourceInfoparseFrom(byte[] data) static SourceInfoparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static SourceInfoparseFrom(com.google.protobuf.ByteString data) static SourceInfoparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static SourceInfoparseFrom(com.google.protobuf.CodedInputStream input) static SourceInfoparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static SourceInfoparseFrom(InputStream input) static SourceInfoparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static SourceInfoparseFrom(ByteBuffer data) static SourceInfoparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<SourceInfo> parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
SYNTAX_VERSION_FIELD_NUMBER
public static final int SYNTAX_VERSION_FIELD_NUMBER- See Also:
-
syntaxVersion_
-
LOCATION_FIELD_NUMBER
public static final int LOCATION_FIELD_NUMBER- See Also:
-
location_
-
LINE_OFFSETS_FIELD_NUMBER
public static final int LINE_OFFSETS_FIELD_NUMBER- See Also:
-
lineOffsets_
private com.google.protobuf.Internal.IntList lineOffsets_ -
lineOffsetsMemoizedSerializedSize
private int lineOffsetsMemoizedSerializedSize -
POSITIONS_FIELD_NUMBER
public static final int POSITIONS_FIELD_NUMBER- See Also:
-
positions_
-
MACRO_CALLS_FIELD_NUMBER
public static final int MACRO_CALLS_FIELD_NUMBER- See Also:
-
macroCalls_
-
EXTENSIONS_FIELD_NUMBER
public static final int EXTENSIONS_FIELD_NUMBER- See Also:
-
extensions_
-
memoizedIsInitialized
private byte memoizedIsInitialized -
DEFAULT_INSTANCE
-
PARSER
-
-
Constructor Details
-
SourceInfo
private SourceInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
SourceInfo
private SourceInfo()
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessage
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getSyntaxVersion
The syntax version of the source, e.g. `cel1`.
string syntax_version = 1;- Specified by:
getSyntaxVersionin interfaceSourceInfoOrBuilder- Returns:
- The syntaxVersion.
-
getSyntaxVersionBytes
public com.google.protobuf.ByteString getSyntaxVersionBytes()The syntax version of the source, e.g. `cel1`.
string syntax_version = 1;- Specified by:
getSyntaxVersionBytesin interfaceSourceInfoOrBuilder- Returns:
- The bytes for syntaxVersion.
-
getLocation
The location name. All position information attached to an expression is relative to this location. The location could be a file, UI element, or similar. For example, `acme/app/AnvilPolicy.cel`.
string location = 2;- Specified by:
getLocationin interfaceSourceInfoOrBuilder- Returns:
- The location.
-
getLocationBytes
public com.google.protobuf.ByteString getLocationBytes()The location name. All position information attached to an expression is relative to this location. The location could be a file, UI element, or similar. For example, `acme/app/AnvilPolicy.cel`.
string location = 2;- Specified by:
getLocationBytesin interfaceSourceInfoOrBuilder- Returns:
- The bytes for location.
-
getLineOffsetsList
Monotonically increasing list of code point offsets where newlines `\n` appear. The line number of a given position is the index `i` where for a given `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The column may be derived from `id_positions[id] - line_offsets[i]`.
repeated int32 line_offsets = 3;- Specified by:
getLineOffsetsListin interfaceSourceInfoOrBuilder- Returns:
- A list containing the lineOffsets.
-
getLineOffsetsCount
public int getLineOffsetsCount()Monotonically increasing list of code point offsets where newlines `\n` appear. The line number of a given position is the index `i` where for a given `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The column may be derived from `id_positions[id] - line_offsets[i]`.
repeated int32 line_offsets = 3;- Specified by:
getLineOffsetsCountin interfaceSourceInfoOrBuilder- Returns:
- The count of lineOffsets.
-
getLineOffsets
public int getLineOffsets(int index) Monotonically increasing list of code point offsets where newlines `\n` appear. The line number of a given position is the index `i` where for a given `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The column may be derived from `id_positions[id] - line_offsets[i]`.
repeated int32 line_offsets = 3;- Specified by:
getLineOffsetsin interfaceSourceInfoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The lineOffsets at the given index.
-
internalGetPositions
-
getPositionsCount
public int getPositionsCount()Description copied from interface:SourceInfoOrBuilderA map from the parse node id (e.g. `Expr.id`) to the code point offset within the source.
map<int64, int32> positions = 4;- Specified by:
getPositionsCountin interfaceSourceInfoOrBuilder
-
containsPositions
public boolean containsPositions(long key) A map from the parse node id (e.g. `Expr.id`) to the code point offset within the source.
map<int64, int32> positions = 4;- Specified by:
containsPositionsin interfaceSourceInfoOrBuilder
-
getPositions
Deprecated.UsegetPositionsMap()instead.- Specified by:
getPositionsin interfaceSourceInfoOrBuilder
-
getPositionsMap
A map from the parse node id (e.g. `Expr.id`) to the code point offset within the source.
map<int64, int32> positions = 4;- Specified by:
getPositionsMapin interfaceSourceInfoOrBuilder
-
getPositionsOrDefault
public int getPositionsOrDefault(long key, int defaultValue) A map from the parse node id (e.g. `Expr.id`) to the code point offset within the source.
map<int64, int32> positions = 4;- Specified by:
getPositionsOrDefaultin interfaceSourceInfoOrBuilder
-
getPositionsOrThrow
public int getPositionsOrThrow(long key) A map from the parse node id (e.g. `Expr.id`) to the code point offset within the source.
map<int64, int32> positions = 4;- Specified by:
getPositionsOrThrowin interfaceSourceInfoOrBuilder
-
internalGetMacroCalls
-
getMacroCallsCount
public int getMacroCallsCount()Description copied from interface:SourceInfoOrBuilderA map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion. For example, `has(value.field)` is a function call that is replaced by a `test_only` field selection in the AST. Likewise, the call `list.exists(e, e > 10)` translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call `Expr` that was replaced.
map<int64, .cel.expr.Expr> macro_calls = 5;- Specified by:
getMacroCallsCountin interfaceSourceInfoOrBuilder
-
containsMacroCalls
public boolean containsMacroCalls(long key) A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion. For example, `has(value.field)` is a function call that is replaced by a `test_only` field selection in the AST. Likewise, the call `list.exists(e, e > 10)` translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call `Expr` that was replaced.
map<int64, .cel.expr.Expr> macro_calls = 5;- Specified by:
containsMacroCallsin interfaceSourceInfoOrBuilder
-
getMacroCalls
Deprecated.UsegetMacroCallsMap()instead.- Specified by:
getMacroCallsin interfaceSourceInfoOrBuilder
-
getMacroCallsMap
A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion. For example, `has(value.field)` is a function call that is replaced by a `test_only` field selection in the AST. Likewise, the call `list.exists(e, e > 10)` translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call `Expr` that was replaced.
map<int64, .cel.expr.Expr> macro_calls = 5;- Specified by:
getMacroCallsMapin interfaceSourceInfoOrBuilder
-
getMacroCallsOrDefault
A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion. For example, `has(value.field)` is a function call that is replaced by a `test_only` field selection in the AST. Likewise, the call `list.exists(e, e > 10)` translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call `Expr` that was replaced.
map<int64, .cel.expr.Expr> macro_calls = 5;- Specified by:
getMacroCallsOrDefaultin interfaceSourceInfoOrBuilder
-
getMacroCallsOrThrow
A map from the parse node id where a macro replacement was made to the call `Expr` that resulted in a macro expansion. For example, `has(value.field)` is a function call that is replaced by a `test_only` field selection in the AST. Likewise, the call `list.exists(e, e > 10)` translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call `Expr` that was replaced.
map<int64, .cel.expr.Expr> macro_calls = 5;- Specified by:
getMacroCallsOrThrowin interfaceSourceInfoOrBuilder
-
getExtensionsList
A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported.
repeated .cel.expr.SourceInfo.Extension extensions = 6;- Specified by:
getExtensionsListin interfaceSourceInfoOrBuilder
-
getExtensionsOrBuilderList
A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported.
repeated .cel.expr.SourceInfo.Extension extensions = 6;- Specified by:
getExtensionsOrBuilderListin interfaceSourceInfoOrBuilder
-
getExtensionsCount
public int getExtensionsCount()A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported.
repeated .cel.expr.SourceInfo.Extension extensions = 6;- Specified by:
getExtensionsCountin interfaceSourceInfoOrBuilder
-
getExtensions
A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported.
repeated .cel.expr.SourceInfo.Extension extensions = 6;- Specified by:
getExtensionsin interfaceSourceInfoOrBuilder
-
getExtensionsOrBuilder
A list of tags for extensions that were used while parsing or type checking the source expression. For example, optimizations that require special runtime support may be specified. These are used to check feature support between components in separate implementations. This can be used to either skip redundant work or report an error if the extension is unsupported.
repeated .cel.expr.SourceInfo.Extension extensions = 6;- Specified by:
getExtensionsOrBuilderin interfaceSourceInfoOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static SourceInfo parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static SourceInfo parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static SourceInfo parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static SourceInfo parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static SourceInfo parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static SourceInfo parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static SourceInfo parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static SourceInfo parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static SourceInfo parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected SourceInfo.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-