public static final class EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder extends 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, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeFrom(EmbeddedSass.OutboundMessage.CanonicalizeRequest other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class 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 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(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(UnknownFieldSet unknownFields)
setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
public final EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>