class ExternExportsPass.Export {
/**
* Computes a list of the path prefixes constructed from the components
* of the path.
* <pre>
* E.g., if the path is:
* "a.b.c"
* then then path prefixes will be
* ["a","a.b","a.b.c"]:
* </pre>
*/
private List<String> computePathPrefixes(String path) {
List<String> pieces = Lists.newArrayList(path.split("\\."));
List<String> pathPrefixes = Lists.newArrayList();
for (int i = 0; i < pieces.size(); i++) {
pathPrefixes.add(Joiner.on(".").join(Iterables.limit(pieces, i + 1)));
}
return pathPrefixes;
}
}