Package sass.embedded_protocol
Class EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderType>
-
- com.google.protobuf.GeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
- sass.embedded_protocol.EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder
-
- All Implemented Interfaces:
Message.Builder
,MessageLite.Builder
,MessageLiteOrBuilder
,MessageOrBuilder
,Cloneable
,EmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
- Enclosing class:
- EmbeddedSass.OutboundMessage.CanonicalizeRequest
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 typesass.embedded_protocol.OutboundMessage.CanonicalizeRequest
-
-
Method Summary
-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
-
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
-
-
-
Method Detail
-
getDescriptor
public static final Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
-
clear
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clear()
- Specified by:
clear
in interfaceMessage.Builder
- Specified by:
clear
in interfaceMessageLite.Builder
- Overrides:
clear
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
getDescriptorForType
public Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfaceMessage.Builder
- Specified by:
getDescriptorForType
in interfaceMessageOrBuilder
- Overrides:
getDescriptorForType
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
getDefaultInstanceForType
public EmbeddedSass.OutboundMessage.CanonicalizeRequest getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfaceMessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfaceMessageOrBuilder
-
build
public EmbeddedSass.OutboundMessage.CanonicalizeRequest build()
- Specified by:
build
in interfaceMessage.Builder
- Specified by:
build
in interfaceMessageLite.Builder
-
buildPartial
public EmbeddedSass.OutboundMessage.CanonicalizeRequest buildPartial()
- Specified by:
buildPartial
in interfaceMessage.Builder
- Specified by:
buildPartial
in interfaceMessageLite.Builder
-
clone
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clone()
- Specified by:
clone
in interfaceMessage.Builder
- Specified by:
clone
in interfaceMessageLite.Builder
- Overrides:
clone
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
setField
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
- Specified by:
setField
in interfaceMessage.Builder
- Overrides:
setField
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
clearField
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearField(Descriptors.FieldDescriptor field)
- Specified by:
clearField
in interfaceMessage.Builder
- Overrides:
clearField
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
clearOneof
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneof
in interfaceMessage.Builder
- Overrides:
clearOneof
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
setRepeatedField
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedField
in interfaceMessage.Builder
- Overrides:
setRepeatedField
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
addRepeatedField
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedField
in interfaceMessage.Builder
- Overrides:
addRepeatedField
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
mergeFrom
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeFrom(Message other)
- Specified by:
mergeFrom
in interfaceMessage.Builder
- Overrides:
mergeFrom
in classAbstractMessage.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
mergeFrom
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeFrom(EmbeddedSass.OutboundMessage.CanonicalizeRequest other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfaceMessageLiteOrBuilder
- Overrides:
isInitialized
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
mergeFrom
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
- Specified by:
mergeFrom
in interfaceMessage.Builder
- Specified by:
mergeFrom
in interfaceMessageLite.Builder
- Overrides:
mergeFrom
in classAbstractMessage.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
- Throws:
IOException
-
getId
public int getId()
uint32 id = 1;
- Specified by:
getId
in interfaceEmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
- Returns:
- The id.
-
setId
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setId(int value)
uint32 id = 1;
- Parameters:
value
- The id to set.- Returns:
- This builder for chaining.
-
clearId
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearId()
uint32 id = 1;
- Returns:
- This builder for chaining.
-
getCompilationId
public int getCompilationId()
The request id for the compilation that triggered the message. Mandatory.
uint32 compilation_id = 2;
- Specified by:
getCompilationId
in interfaceEmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
- Returns:
- The compilationId.
-
setCompilationId
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setCompilationId(int value)
The request id for the compilation that triggered the message. Mandatory.
uint32 compilation_id = 2;
- Parameters:
value
- The compilationId to set.- Returns:
- This builder for chaining.
-
clearCompilationId
public EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder clearCompilationId()
The request id for the compilation that triggered the message. Mandatory.
uint32 compilation_id = 2;
- Returns:
- This builder for chaining.
-
getImporterId
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;
- Specified by:
getImporterId
in interfaceEmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
- Returns:
- The importerId.
-
setImporterId
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;
- Parameters:
value
- The importerId to set.- Returns:
- This builder for chaining.
-
clearImporterId
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;
- Returns:
- This builder for chaining.
-
getUrl
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;
- Specified by:
getUrl
in interfaceEmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
- Returns:
- The url.
-
getUrlBytes
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;
- Specified by:
getUrlBytes
in interfaceEmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
- Returns:
- The bytes for url.
-
setUrl
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;
- Parameters:
value
- The url to set.- Returns:
- This builder for chaining.
-
clearUrl
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;
- Returns:
- This builder for chaining.
-
setUrlBytes
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;
- Parameters:
value
- The bytes for url to set.- Returns:
- This builder for chaining.
-
getFromImport
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;
- Specified by:
getFromImport
in interfaceEmbeddedSass.OutboundMessage.CanonicalizeRequestOrBuilder
- Returns:
- The fromImport.
-
setFromImport
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;
- Parameters:
value
- The fromImport to set.- Returns:
- This builder for chaining.
-
clearFromImport
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;
- Returns:
- This builder for chaining.
-
setUnknownFields
public final EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
- Specified by:
setUnknownFields
in interfaceMessage.Builder
- Overrides:
setUnknownFields
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
mergeUnknownFields
public final EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFields
in interfaceMessage.Builder
- Overrides:
mergeUnknownFields
in classGeneratedMessageV3.Builder<EmbeddedSass.OutboundMessage.CanonicalizeRequest.Builder>
-
-