public static final class OutboundMessage.CanonicalizeRequest.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder> implements OutboundMessage.CanonicalizeRequestOrBuilder
A request for a custom importer to convert an imported URL to its canonical format. If the URL is not recognized by this importer, or if no stylesheet is found at that URL, `CanonicalizeResponse.result` must be `null`. Otherwise, the importer must return an absolute URL, including a scheme. > The host's documentation should encourage the use of file importers (via > `CompileRequest.Importer.file_importer_id`, `FileImportRequest`, and > `FileImportResponse`) for any importers that simply refer to files on > disk. This will allow Sass to handle the logic of resolving partials, > file extensions, and index files. If Sass has already loaded a stylesheet with the returned canonical URL, it re-uses the existing parse tree. This means that importers must ensure that the same canonical URL always refers to the same stylesheet, *even across different importers*. Importers must also ensure that any canonicalized URLs they return can be passed back to `CanonicalizeRequest` and will be returned unchanged. If this importer's URL format supports file extensions, it should canonicalize them the same way as the default filesystem importer: * The importer should look for stylesheets by adding the prefix `_` to the URL's basename, and by adding the extensions `.sass` and `.scss` if the URL doesn't already have one of those extensions. For example, if the URL was `foo/bar/baz`, the importer would look for: * `foo/bar/baz.sass` * `foo/bar/baz.scss` * `foo/bar/_baz.sass` * `foo/bar/_baz.scss` If the URL was foo/bar/baz.scss, the importer would just look for: * `foo/bar/baz.scss` * `foo/bar/_baz.scss` If the importer finds a stylesheet at more than one of these URLs, it should respond with a `CanonicalizeResponse.result.error` indicating that the import is ambiguous. Note that if the extension is explicitly specified, a stylesheet with another extension may exist without error. * If none of the possible paths is valid, the importer should perform the same resolution on the URL followed by `/index`. In the example above, it would look for: * `foo/bar/baz/_index.sass` * `foo/bar/baz/index.sass` * `foo/bar/baz/_index.scss` * `foo/bar/baz/index.scss` As above, if the importer finds a stylesheet at more than one of these URLs, it should respond with a `CanonicalizeResponse.result.error` indicating that the import is ambiguous.Protobuf type
sass.embedded_protocol.OutboundMessage.CanonicalizeRequest| Modifier and Type | Method and Description |
|---|---|
OutboundMessage.CanonicalizeRequest.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
OutboundMessage.CanonicalizeRequest |
build() |
OutboundMessage.CanonicalizeRequest |
buildPartial() |
OutboundMessage.CanonicalizeRequest.Builder |
clear() |
OutboundMessage.CanonicalizeRequest.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
OutboundMessage.CanonicalizeRequest.Builder |
clearFromImport()
/ Whether this request comes from an `@import` rule.
|
OutboundMessage.CanonicalizeRequest.Builder |
clearId()
uint32 id = 1; |
OutboundMessage.CanonicalizeRequest.Builder |
clearImporterId()
The unique ID of the importer being invoked.
|
OutboundMessage.CanonicalizeRequest.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
OutboundMessage.CanonicalizeRequest.Builder |
clearUrl()
The URL of the import to be canonicalized.
|
OutboundMessage.CanonicalizeRequest.Builder |
clone() |
OutboundMessage.CanonicalizeRequest |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
boolean |
getFromImport()
/ Whether this request comes from an `@import` rule.
|
int |
getId()
uint32 id = 1; |
int |
getImporterId()
The unique ID of the importer being invoked.
|
String |
getUrl()
The URL of the import to be canonicalized.
|
com.google.protobuf.ByteString |
getUrlBytes()
The URL of the import to be canonicalized.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
OutboundMessage.CanonicalizeRequest.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
OutboundMessage.CanonicalizeRequest.Builder |
mergeFrom(com.google.protobuf.Message other) |
OutboundMessage.CanonicalizeRequest.Builder |
mergeFrom(OutboundMessage.CanonicalizeRequest other) |
OutboundMessage.CanonicalizeRequest.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
OutboundMessage.CanonicalizeRequest.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
OutboundMessage.CanonicalizeRequest.Builder |
setFromImport(boolean value)
/ Whether this request comes from an `@import` rule.
|
OutboundMessage.CanonicalizeRequest.Builder |
setId(int value)
uint32 id = 1; |
OutboundMessage.CanonicalizeRequest.Builder |
setImporterId(int value)
The unique ID of the importer being invoked.
|
OutboundMessage.CanonicalizeRequest.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
OutboundMessage.CanonicalizeRequest.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
OutboundMessage.CanonicalizeRequest.Builder |
setUrl(String value)
The URL of the import to be canonicalized.
|
OutboundMessage.CanonicalizeRequest.Builder |
setUrlBytes(com.google.protobuf.ByteString value)
The URL of the import to be canonicalized.
|
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic OutboundMessage.CanonicalizeRequest build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic OutboundMessage.CanonicalizeRequest buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic OutboundMessage.CanonicalizeRequest.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder mergeFrom(OutboundMessage.CanonicalizeRequest other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public OutboundMessage.CanonicalizeRequest.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<OutboundMessage.CanonicalizeRequest.Builder>IOExceptionpublic int getId()
uint32 id = 1;getId in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic OutboundMessage.CanonicalizeRequest.Builder setId(int value)
uint32 id = 1;value - The id to set.public OutboundMessage.CanonicalizeRequest.Builder clearId()
uint32 id = 1;public int getImporterId()
The unique ID of the importer being invoked. This must match an importer ID passed to this compilation in `CompileRequest.importers` or `CompileRequest.input.string.importer`.
uint32 importer_id = 3;getImporterId in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic OutboundMessage.CanonicalizeRequest.Builder setImporterId(int value)
The unique ID of the importer being invoked. This must match an importer ID passed to this compilation in `CompileRequest.importers` or `CompileRequest.input.string.importer`.
uint32 importer_id = 3;value - The importerId to set.public OutboundMessage.CanonicalizeRequest.Builder clearImporterId()
The unique ID of the importer being invoked. This must match an importer ID passed to this compilation in `CompileRequest.importers` or `CompileRequest.input.string.importer`.
uint32 importer_id = 3;public String getUrl()
The URL of the import to be canonicalized. This may be either absolute or relative. When loading a URL, the compiler must first try resolving that URL relative to the canonical URL of the current file, and canonicalizing the result using the importer that loaded the current file. If this returns `null`, the compiler must then try canonicalizing the original URL with each importer in order until one returns something other than `null`. That is the result of the import.
string url = 4;getUrl in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic com.google.protobuf.ByteString getUrlBytes()
The URL of the import to be canonicalized. This may be either absolute or relative. When loading a URL, the compiler must first try resolving that URL relative to the canonical URL of the current file, and canonicalizing the result using the importer that loaded the current file. If this returns `null`, the compiler must then try canonicalizing the original URL with each importer in order until one returns something other than `null`. That is the result of the import.
string url = 4;getUrlBytes in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic OutboundMessage.CanonicalizeRequest.Builder setUrl(String value)
The URL of the import to be canonicalized. This may be either absolute or relative. When loading a URL, the compiler must first try resolving that URL relative to the canonical URL of the current file, and canonicalizing the result using the importer that loaded the current file. If this returns `null`, the compiler must then try canonicalizing the original URL with each importer in order until one returns something other than `null`. That is the result of the import.
string url = 4;value - The url to set.public OutboundMessage.CanonicalizeRequest.Builder clearUrl()
The URL of the import to be canonicalized. This may be either absolute or relative. When loading a URL, the compiler must first try resolving that URL relative to the canonical URL of the current file, and canonicalizing the result using the importer that loaded the current file. If this returns `null`, the compiler must then try canonicalizing the original URL with each importer in order until one returns something other than `null`. That is the result of the import.
string url = 4;public OutboundMessage.CanonicalizeRequest.Builder setUrlBytes(com.google.protobuf.ByteString value)
The URL of the import to be canonicalized. This may be either absolute or relative. When loading a URL, the compiler must first try resolving that URL relative to the canonical URL of the current file, and canonicalizing the result using the importer that loaded the current file. If this returns `null`, the compiler must then try canonicalizing the original URL with each importer in order until one returns something other than `null`. That is the result of the import.
string url = 4;value - The bytes for url to set.public boolean getFromImport()
/ Whether this request comes from an `@import` rule. / / When evaluating `@import` rules, URLs should canonicalize to an / [import-only file] if one exists for the URL being canonicalized. / Otherwise, canonicalization should be identical for `@import` and `@use` / rules. / / [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files
bool from_import = 5;getFromImport in interface OutboundMessage.CanonicalizeRequestOrBuilderpublic OutboundMessage.CanonicalizeRequest.Builder setFromImport(boolean value)
/ Whether this request comes from an `@import` rule. / / When evaluating `@import` rules, URLs should canonicalize to an / [import-only file] if one exists for the URL being canonicalized. / Otherwise, canonicalization should be identical for `@import` and `@use` / rules. / / [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files
bool from_import = 5;value - The fromImport to set.public OutboundMessage.CanonicalizeRequest.Builder clearFromImport()
/ Whether this request comes from an `@import` rule. / / When evaluating `@import` rules, URLs should canonicalize to an / [import-only file] if one exists for the URL being canonicalized. / Otherwise, canonicalization should be identical for `@import` and `@use` / rules. / / [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files
bool from_import = 5;public final OutboundMessage.CanonicalizeRequest.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>public final OutboundMessage.CanonicalizeRequest.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<OutboundMessage.CanonicalizeRequest.Builder>