public final class Declarations extends Object
Declaration
s.Modifier and Type | Method and Description |
---|---|
static Iterable<Declaration> |
within(StatementIterable parent)
|
static Iterable<Declaration> |
within(StatementIterable parent,
boolean recurse)
|
public static Iterable<Declaration> within(StatementIterable parent)
Declaration
s within the given StatementIterable
(e.g., a Stylesheet
or AtRuleBlock
).
By default this will recurse into any inner/child StatementIterable
s as well, including their Declaration
s.
If you only want Declaration
s one level deep, call within(StatementIterable, boolean)
with false.
This is optimized to not copy each Declaration
into a new collection, but returns lazy Iterable
instead.
Examples:
for (Declaration declaration : Declarations.within(atRule.block().get())) {
...
}
for (Declaration declaration : Declarations.within(stylesheet)) {
...
}
parent
- Find declarations within this StatementIterable
.Iterable
over each Declaration
.public static Iterable<Declaration> within(StatementIterable parent, boolean recurse)
Declaration
s within the given StatementIterable
(e.g., a Stylesheet
or AtRuleBlock
).
This is optimized to not copy each Declaration
into a new collection, but returns lazy Iterable
instead.
Examples:
for (Declaration declaration : Declarations.within(atRule.block().get(), true)) {
...
}
for (Declaration declaration : Declarations.within(stylesheet, false)) {
...
}
parent
- Find declarations within this StatementIterable
.recurse
- Whether to recursively look include any child/inner StatementIterable
s. Pass false to only iterate over the
Declaration
s one level deep.Iterable
over each Declaration
.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.