public final class Parsing
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static @NotNull java.util.regex.Matcher |
matcher(@NotNull Tree tree,
@NotNull java.util.regex.Pattern pattern)
Construct a new matcher over the current content of the document of the given
tree with the range of the reference of the given tree as the
region of it. |
static @Nullable java.util.List<Reference> |
parse(@NotNull Tree tree,
@NotNull java.util.regex.Pattern pattern)
Parse the whole given
tree with the given pattern and return the
references of the groups in the given pattern . |
static @NotNull java.util.Set<Reference> |
parseAll(@NotNull Tree tree,
@NotNull java.util.regex.Pattern pattern,
int zIndex)
Parse all the ranges matching the given
pattern in the given tree . |
static @NotNull java.util.Set<java.util.List<Reference>> |
parseAll(@NotNull Tree tree,
@NotNull java.util.regex.Pattern startPattern,
@NotNull java.util.regex.Pattern endPattern,
int zIndex)
Parse all the ranges starting with the given
startPattern and ending with
the given endPattern in the given tree . |
static @Nullable Reference |
parseFirst(@NotNull Tree tree,
@NotNull java.util.regex.Pattern pattern,
int zIndex)
Parse the first range matching the given
pattern in the given tree . |
static @NotNull java.util.List<Reference> |
parseFirst(@NotNull Tree tree,
@NotNull java.util.regex.Pattern startPattern,
@NotNull java.util.regex.Pattern endPattern,
int zIndex)
Parse all the ranges starting with the given
startPattern and ending with
the given endPattern in the given tree . |
@NotNull @Contract(value="_,_->new", pure=true) public static @NotNull java.util.regex.Matcher matcher(@NotNull @NotNull Tree tree, @NotNull @NotNull java.util.regex.Pattern pattern)
tree
with the range of the reference of the given tree
as the
region of it.tree
- the tree to get a matcher over its current content.pattern
- the pattern of the returned matcher.pattern
over the current content of the
given tree
.java.lang.NullPointerException
- if the given tree
or pattern
is
null.java.lang.IllegalStateException
- if the reference of the given tree
is out of
the bounds of its document.java.io.IOError
- if an I/O exception occurred while trying to read the
document of the given tree
.DocumentNotFoundError
- if the document of the given tree
is not
available for reading.@Nullable @Contract(pure=true) public static @Nullable java.util.List<Reference> parse(@NotNull @NotNull Tree tree, @NotNull @NotNull java.util.regex.Pattern pattern)
tree
with the given pattern
and return the
references of the groups in the given pattern
.tree
- the tree to be parsed.pattern
- the pattern to look for.null
if the given tree
does not match the given pattern
.java.lang.NullPointerException
- if the given tree
or pattern
is null.@NotNull @Contract(value="_,_,_->new", pure=true) public static @NotNull java.util.Set<Reference> parseAll(@NotNull @NotNull Tree tree, @NotNull @NotNull java.util.regex.Pattern pattern, int zIndex)
pattern
in the given tree
.
NONE
between them and the children of the given tree
and will all have a
dominance of NONE
between another.
tree
- the tree to parse in.pattern
- the pattern to look for.zIndex
- the z-index to accept.pattern
in the given
tree
.java.lang.NullPointerException
- if the given tree
or pattern
is
null.java.lang.IllegalStateException
- if the reference of the given tree
is out of
the bounds of its document.java.io.IOError
- if an I/O exception occurred while trying to read the
document of the given tree
.DocumentNotFoundError
- if the document of the given tree
is not
available for reading.@NotNull @Contract(value="_,_,_,_->new", pure=true) public static @NotNull java.util.Set<java.util.List<Reference>> parseAll(@NotNull @NotNull Tree tree, @NotNull @NotNull java.util.regex.Pattern startPattern, @NotNull @NotNull java.util.regex.Pattern endPattern, int zIndex)
startPattern
and ending with
the given endPattern
in the given tree
.
Dominance.NONE
between
them and the children of the given tree
and will have a dominance of NONE
between each set of ranges.
tree
- the tree to parse in.startPattern
- the pattern matching the start of the ranges to look for.endPattern
- the pattern matching the end of the ranges to look for.zIndex
- the z-index to accept.pattern
in the given
tree
.java.lang.NullPointerException
- if the given tree
or startPattern
or
endPattern
is null.java.lang.IllegalStateException
- if the reference of the given tree
is out of
the bounds of its document.java.io.IOError
- if an I/O exception occurred while trying to read the
document of the given tree
.DocumentNotFoundError
- if the document of the given tree
is not
available for reading.@Nullable @Contract(value="_,_,_->new", pure=true) public static @Nullable Reference parseFirst(@NotNull @NotNull Tree tree, @NotNull @NotNull java.util.regex.Pattern pattern, int zIndex)
pattern
in the given tree
.
NONE
between
it and the children of the given tree
.tree
- the tree to parse in.pattern
- the pattern to look for.zIndex
- the z-index to accept.pattern
in the given tree
. Or null
if no match was found.java.lang.NullPointerException
- if the given tree
or pattern
is
null.java.lang.IllegalStateException
- if the reference of the given tree
is out of
the bounds of its document.java.io.IOError
- if an I/O exception occurred while trying to read the
document of the given tree
.DocumentNotFoundError
- if the document of the given tree
is not
available for reading.@NotNull @Contract(value="_,_,_,_->new", pure=true) public static @NotNull java.util.List<Reference> parseFirst(@NotNull @NotNull Tree tree, @NotNull @NotNull java.util.regex.Pattern startPattern, @NotNull @NotNull java.util.regex.Pattern endPattern, int zIndex)
startPattern
and ending with
the given endPattern
in the given tree
.
Dominance.NONE
between
them and the children of the given tree
.
tree
- the tree to parse in.startPattern
- the pattern matching the start of the range to look for.endPattern
- the pattern matching the end of the range to look for.zIndex
- the z-index to accept.pattern
in the given
tree
.java.lang.NullPointerException
- if the given tree
or startPattern
or
endPattern
is null.java.lang.IllegalStateException
- if the reference of the given tree
is out of
the bounds of its document.java.io.IOError
- if an I/O exception occurred while trying to read the
document of the given tree
.DocumentNotFoundError
- if the document of the given tree
is not
available for reading.