public final class SlicedRawTextNode extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SlicedRawTextNode.RawTextSlice
A substring of raw text that is exposed to parse passes.
|
| Constructor and Description |
|---|
SlicedRawTextNode(RawTextNode rawTextNode,
Context startContext) |
| Modifier and Type | Method and Description |
|---|---|
static List<SlicedRawTextNode.RawTextSlice> |
find(Iterable<? extends SlicedRawTextNode> slicedTextNodes,
com.google.common.base.Predicate<? super Context> prevContextPredicate,
com.google.common.base.Predicate<? super Context> sliceContextPredicate,
com.google.common.base.Predicate<? super Context> nextContextPredicate)
The slices that occur in the context described by the given predicates.
|
Context |
getEndContext()
The context in which the text node ends.
|
RawTextNode |
getRawTextNode() |
List<SlicedRawTextNode.RawTextSlice> |
getSlices() |
public SlicedRawTextNode(RawTextNode rawTextNode, Context startContext)
public RawTextNode getRawTextNode()
public List<SlicedRawTextNode.RawTextSlice> getSlices()
public Context getEndContext()
public static List<SlicedRawTextNode.RawTextSlice> find(Iterable<? extends SlicedRawTextNode> slicedTextNodes, @Nullable com.google.common.base.Predicate<? super Context> prevContextPredicate, @Nullable com.google.common.base.Predicate<? super Context> sliceContextPredicate, @Nullable com.google.common.base.Predicate<? super Context> nextContextPredicate)
The order is deterministic but does not necessarily bear any relationship to the order in which slices can appear in the template's output because it is dependent on the ordering of individual templates in the parsed input.
slicedRawTextNodes - The sliced raw text nodes to search.prevContextPredicate - Applied to the context before the slice being tested.sliceContextPredicate - Applied to the context of the slice being tested.nextContextPredicate - Applied to the context after the slice being tested.