public static final class OutboundMessage.CanonicalizeRequest.Builder extends com.google.protobuf.GeneratedMessage.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 |
build() |
OutboundMessage.CanonicalizeRequest |
buildPartial() |
OutboundMessage.CanonicalizeRequest.Builder |
clear() |
OutboundMessage.CanonicalizeRequest.Builder |
clearContainingUrl()
The canonical URL of the [current source file] that contained the load
to be canonicalized.
|
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 |
clearUrl()
The URL of the import to be canonicalized.
|
String |
getContainingUrl()
The canonical URL of the [current source file] that contained the load
to be canonicalized.
|
com.google.protobuf.ByteString |
getContainingUrlBytes()
The canonical URL of the [current source file] that contained the load
to be canonicalized.
|
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.
|
boolean |
hasContainingUrl()
The canonical URL of the [current source file] that contained the load
to be canonicalized.
|
protected com.google.protobuf.GeneratedMessage.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 |
setContainingUrl(String value)
The canonical URL of the [current source file] that contained the load
to be canonicalized.
|
OutboundMessage.CanonicalizeRequest.Builder |
setContainingUrlBytes(com.google.protobuf.ByteString value)
The canonical URL of the [current source file] that contained the load
to be canonicalized.
|
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 |
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.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessage.Builder<OutboundMessage.CanonicalizeRequest.Builder>
public OutboundMessage.CanonicalizeRequest.Builder clear()
clear
in interface com.google.protobuf.Message.Builder
clear
in interface com.google.protobuf.MessageLite.Builder
clear
in class com.google.protobuf.GeneratedMessage.Builder<OutboundMessage.CanonicalizeRequest.Builder>
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface com.google.protobuf.Message.Builder
getDescriptorForType
in interface com.google.protobuf.MessageOrBuilder
getDescriptorForType
in class com.google.protobuf.GeneratedMessage.Builder<OutboundMessage.CanonicalizeRequest.Builder>
public OutboundMessage.CanonicalizeRequest getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public OutboundMessage.CanonicalizeRequest build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public OutboundMessage.CanonicalizeRequest buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public OutboundMessage.CanonicalizeRequest.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
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.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessage.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.Builder
mergeFrom
in interface com.google.protobuf.MessageLite.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<OutboundMessage.CanonicalizeRequest.Builder>
IOException
public int getId()
uint32 id = 1;
getId
in interface OutboundMessage.CanonicalizeRequestOrBuilder
public 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.CanonicalizeRequestOrBuilder
public 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.CanonicalizeRequestOrBuilder
public 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.CanonicalizeRequestOrBuilder
public 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.CanonicalizeRequestOrBuilder
public 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 boolean hasContainingUrl()
The canonical URL of the [current source file] that contained the load to be canonicalized. [current source file]: ../spec.md#current-source-file The compiler must set this if and only if `url` is relative or its scheme is an `Importer.non_canonical_scheme` for the importer being invoked, unless the current source file has no canonical URL. [non-canonical-proto]: #non_canonical_scheme
optional string containing_url = 6;
hasContainingUrl
in interface OutboundMessage.CanonicalizeRequestOrBuilder
public String getContainingUrl()
The canonical URL of the [current source file] that contained the load to be canonicalized. [current source file]: ../spec.md#current-source-file The compiler must set this if and only if `url` is relative or its scheme is an `Importer.non_canonical_scheme` for the importer being invoked, unless the current source file has no canonical URL. [non-canonical-proto]: #non_canonical_scheme
optional string containing_url = 6;
getContainingUrl
in interface OutboundMessage.CanonicalizeRequestOrBuilder
public com.google.protobuf.ByteString getContainingUrlBytes()
The canonical URL of the [current source file] that contained the load to be canonicalized. [current source file]: ../spec.md#current-source-file The compiler must set this if and only if `url` is relative or its scheme is an `Importer.non_canonical_scheme` for the importer being invoked, unless the current source file has no canonical URL. [non-canonical-proto]: #non_canonical_scheme
optional string containing_url = 6;
getContainingUrlBytes
in interface OutboundMessage.CanonicalizeRequestOrBuilder
public OutboundMessage.CanonicalizeRequest.Builder setContainingUrl(String value)
The canonical URL of the [current source file] that contained the load to be canonicalized. [current source file]: ../spec.md#current-source-file The compiler must set this if and only if `url` is relative or its scheme is an `Importer.non_canonical_scheme` for the importer being invoked, unless the current source file has no canonical URL. [non-canonical-proto]: #non_canonical_scheme
optional string containing_url = 6;
value
- The containingUrl to set.public OutboundMessage.CanonicalizeRequest.Builder clearContainingUrl()
The canonical URL of the [current source file] that contained the load to be canonicalized. [current source file]: ../spec.md#current-source-file The compiler must set this if and only if `url` is relative or its scheme is an `Importer.non_canonical_scheme` for the importer being invoked, unless the current source file has no canonical URL. [non-canonical-proto]: #non_canonical_scheme
optional string containing_url = 6;
public OutboundMessage.CanonicalizeRequest.Builder setContainingUrlBytes(com.google.protobuf.ByteString value)
The canonical URL of the [current source file] that contained the load to be canonicalized. [current source file]: ../spec.md#current-source-file The compiler must set this if and only if `url` is relative or its scheme is an `Importer.non_canonical_scheme` for the importer being invoked, unless the current source file has no canonical URL. [non-canonical-proto]: #non_canonical_scheme
optional string containing_url = 6;
value
- The bytes for containingUrl to set.