class ExternExportsPass.PropertyExport {
@Override
String getExportedPath() {
// Find the longest path that has been mapped (if any).
List<String> pieces = Lists.newArrayList(exportPath.split("\\."));
for (int i = pieces.size(); i > 0; i--) {
// Find the path of the current length.
String cPath = Joiner.on(".").join(Iterables.limit(pieces, i));
// If this path is mapped, return the mapped path plus any remaining
// pieces.
if (mappedPaths.containsKey(cPath)) {
String newPath = mappedPaths.get(cPath);
if (i < pieces.size()) {
newPath += "." + Joiner.on(".").join(Iterables.skip(pieces, i));
}
return newPath + "." + symbolName;
}
}
return exportPath + "." + symbolName;
}
}