public static final class Omakase.Request extends Object
This object allows you to add plugins in order to specify the validation, rework, etc... performed on the processed code.
See Plugin
for more information.
Use use(ErrorManager)
to specify a custom error manager. Otherwise DefaultErrorManager
is used by
default.
Modifier and Type | Method and Description |
---|---|
Omakase.Request |
broadcaster(Broadcaster broadcaster)
Specifies a
Broadcaster to wrap around the default one. |
PluginRegistry |
process()
Processes the CSS source code, invoking registered plugins as applicable.
|
Omakase.Request |
use(ErrorManager em)
Specifies a custom error manager to use.
|
Omakase.Request |
use(Iterable<? extends Plugin> plugins)
Registers a plugin to process or utilize the parsed source code.
|
Omakase.Request |
use(Plugin... plugins)
Registers a plugin to process or utilize the parsed source code.
|
public Omakase.Request use(Plugin... plugins)
plugins
- The plugin(s) to add.public Omakase.Request use(Iterable<? extends Plugin> plugins)
plugins
- The plugins to add.public Omakase.Request use(ErrorManager em)
DefaultErrorManager
is used by default.em
- The error manager.public Omakase.Request broadcaster(Broadcaster broadcaster)
Broadcaster
to wrap around the default one. Doing this allows you to decorate the broadcast
functionality with your own behavior or information gathering.broadcaster
- Wrap the default broadcaster inside of this one.public PluginRegistry process()
It's expected that you call this method at most once per instance. To process different source code, or to reprocess
the same source code under different conditions or plugins, start new with Omakase.source(CharSequence)
. It's
perfectly acceptable to reprocess the result of a previous parsing operation (e.g., using the output from a StyleWriter
).
PluginRegistry
containing all registered plugins. This allows you to retrieve plugins if applicable
for further processing or information retrieval.Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.