Example #1
0
 public void clearCachedLevels() {
   cachedLevelNames = null;
   List<Library> libs = module.getAllLibraries();
   if (libs == null) return;
   for (int i = 0; i < libs.size(); i++) {
     Library lib = libs.get(i);
     ((ModuleNameHelper) lib.getNameHelper()).cachedLevelNames = null;
   }
 }
Example #2
0
  /**
   * Finds a level by the given qualified name.
   *
   * @param elementName
   * @return the level if found, otherwise null
   */
  public Level findCachedLevel(String elementName) {
    if (elementName == null) return null;

    String namespace = StringUtil.extractNamespace(elementName);
    String name = StringUtil.extractName(elementName);
    if (namespace == null) return (Level) cachedLevelNames.get(name);
    Library lib = module.getLibraryWithNamespace(namespace);
    return lib == null
        ? null
        : (Level) ((ModuleNameHelper) lib.getNameHelper()).findCachedLevel(name);
  }