public static final class EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder> implements EmbeddedSass.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
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, 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.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.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.GeneratedMessageV3.Builder<EmbeddedSass.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.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clone()
clone
in interface com.google.protobuf.Message.Builder
clone
in interface com.google.protobuf.MessageLite.Builder
clone
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField
in interface com.google.protobuf.Message.Builder
setField
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField
in interface com.google.protobuf.Message.Builder
clearField
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof
in interface com.google.protobuf.Message.Builder
clearOneof
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField
in interface com.google.protobuf.Message.Builder
setRepeatedField
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField
in interface com.google.protobuf.Message.Builder
addRepeatedField
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.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<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeFrom(EmbeddedSass.OutboundMessage.CanonicalizeRequest other)
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.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<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
IOException
public int getId()
uint32 id = 1;
getId
in interface EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setId(int value)
uint32 id = 1;
value
- The id to set.public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearId()
uint32 id = 1;
public int getCompilationId()
The request id for the compilation that triggered the message. Mandatory.
uint32 compilation_id = 2;
getCompilationId
in interface EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setCompilationId(int value)
The request id for the compilation that triggered the message. Mandatory.
uint32 compilation_id = 2;
value
- The compilationId to set.public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearCompilationId()
The request id for the compilation that triggered the message. Mandatory.
uint32 compilation_id = 2;
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`. Mandatory.
uint32 importer_id = 3;
getImporterId
in interface EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
public EmbeddedSass.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`. Mandatory.
uint32 importer_id = 3;
value
- The importerId to set.public EmbeddedSass.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`. Mandatory.
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 EmbeddedSass.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 EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
public EmbeddedSass.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 EmbeddedSass.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 EmbeddedSass.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 EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
public EmbeddedSass.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 EmbeddedSass.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 EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields
in interface com.google.protobuf.Message.Builder
setUnknownFields
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public final EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields
in interface com.google.protobuf.Message.Builder
mergeUnknownFields
in class com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>