public final class PathPrefix extends Object
ClassPathEntry
and the rest of resource's abstract path. This concept
allows us to specify subsets of path hierarchies orthogonally from path
roots. For example, a path root might be /home/gwt/src/
and an
abstract path prefix might be module/client/
. Importantly,
you can apply the same abstract path prefix to multiple path roots and find
more than one set of resources residing in disjoint locations yet occupying
the same logical hierarchy. Sorry this explanation is so abstract; it's how
we model things like the GWT module's client source path, public path, and
super source path.Modifier and Type | Class and Description |
---|---|
static class |
PathPrefix.Judgement
Represents whether or not a PathPrefix includes a particular file as well
as an indicator of the inclusion/exclusion priority.
|
Modifier and Type | Field and Description |
---|---|
static PathPrefix |
ALL |
Constructor and Description |
---|
PathPrefix(String prefix,
ResourceFilter filter)
Construct a non-rerooting prefix.
|
PathPrefix(String prefix,
ResourceFilter filter,
boolean shouldReroot)
Construct a prefix without global exclusions.
|
PathPrefix(String moduleName,
String prefix,
ResourceFilter filter,
boolean shouldReroot,
String[] excludeList)
Construct a prefix.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Equality is based on prefixes representing the same string.
|
PathPrefix.Judgement |
getJudgement(String path)
Determines the inclusion/exclusion status and priority of a given path.
|
String |
getModuleName() |
String |
getPrefix()
The prefix.
|
String |
getRerootedPath(String path) |
int |
hashCode() |
void |
merge(PathPrefix pathPrefix)
Consolidate a given
PathPrefix with this one, such that resources
excluded by neither prefix and included by either are allowed. |
boolean |
shouldReroot() |
String |
toString() |
public static final PathPrefix ALL
public PathPrefix(String prefix, ResourceFilter filter)
prefix
- a string prefix that (1) is the empty string or (2) begins
with something other than a slash and ends with a slashfilter
- the resource filter to use, or null
for no
filter; note that the filter must always return the same answer
for the same candidate path (doing otherwise will produce
inconsistent behavior in identifying available resources)public PathPrefix(String prefix, ResourceFilter filter, boolean shouldReroot)
prefix
- a string prefix that (1) is the empty string or (2) begins
with something other than a slash and ends with a slashfilter
- the resource filter to use, or null
for no
filter; note that the filter must always return the same answer
for the same candidate path (doing otherwise will produce
inconsistent behavior in identifying available resources)shouldReroot
- if true
, any matching Resource
for this prefix will be rerooted to not include the initial prefix
path; if false
, the prefix will be included in a
matching resource's path.public PathPrefix(String moduleName, String prefix, ResourceFilter filter, boolean shouldReroot, String[] excludeList)
moduleName
- the name of the module that contained the Source or
Public entry that this PathPrefix representsprefix
- a string prefix that (1) is the empty string or (2) begins
with something other than a slash and ends with a slashfilter
- the resource filter to use, or null
for no
filter; note that the filter must always return the same answer
for the same candidate path (doing otherwise will produce
inconsistent behavior in identifying available resources)shouldReroot
- if true
, any matching Resource
for this prefix will be rerooted to not include the initial prefix
path; if false
, the prefix will be included in a
matching resource's path.excludeList
- list of globs that should be removed from any
module's resources.public PathPrefix.Judgement getJudgement(String path)
Determination is made using the prefix path, list of exclusions and list of filters (which are constructed from "includes" and "skips" entries in the xml).
public boolean equals(Object obj)
public String getPrefix()
null
, and
either be the empty string or it will not begin with a slash and
will end with a slash; these guarantees are very useful when
concatenating paths that incorporate prefixespublic void merge(PathPrefix pathPrefix)
PathPrefix
with this one, such that resources
excluded by neither prefix and included by either are allowed.pathPrefix
- public boolean shouldReroot()
public String getModuleName()
Copyright © 2018. All rights reserved.