Пример #1
0
  /**
   * Compile a single hashCode for the tree of codes linked in a navigation.
   *
   * @param navigation the navigation
   * @param extension the extension of the codes
   * @param excludes exludes codes to exclude
   * @return the hash
   */
  public static int getHashes(CMNavigation navigation, String extension, List excludes) {
    List<CMAbstractCode> codes = new ArrayList<>();

    if (CSS_EXTENSION.equals(extension)) {
      codes = getCodeListForHash(navigation.getCss(), excludes, codes);
    } else if (JAVASCRIPT_EXTENSION.equals(extension)) {
      codes = getCodeListForHash(navigation.getJavaScript(), excludes, codes);
    }

    int hash = 0;

    for (CMAbstractCode code : codes) {

      if (code.getCode() != null) {
        hash += code.getCode().hashCode();
      }
    }

    return hash;
  }
Пример #2
0
 /** Return only CSS linked to the given navigation that has a data url, excluding IE exclusives */
 public static List<CMAbstractCode> getCSSExternalLinks(CMNavigation cmNavigation, List excludes) {
   return getFilteredCodeList(
       cmNavigation.getCss(), excludes, new ArrayList<CMAbstractCode>(), false, true);
 }