Ejemplo n.º 1
0
 public int getLevel() {
   if (level == null) {
     final Element settingElement = PwmSettingXml.readCategoryXml(this);
     final Attribute levelAttribute = settingElement.getAttribute("level");
     level = levelAttribute != null ? Integer.parseInt(levelAttribute.getValue()) : 0;
   }
   return level;
 }
Ejemplo n.º 2
0
  private PwmSetting readProfileSettingFromXml() {
    final Element categoryElement = PwmSettingXml.readCategoryXml(this);
    final Element profileElement = categoryElement.getChild("profile");
    if (profileElement != null) {
      final String settingKey = profileElement.getAttributeValue("setting");
      if (settingKey != null) {
        return PwmSetting.forKey(settingKey);
      }
    }

    return null;
  }
Ejemplo n.º 3
0
 public boolean isHidden() {
   if (hidden == null) {
     final Element settingElement = PwmSettingXml.readCategoryXml(this);
     final Attribute hiddenElement = settingElement.getAttribute("hidden");
     if (hiddenElement != null && "true".equalsIgnoreCase(hiddenElement.getValue())) {
       hidden = true;
     } else {
       for (final PwmSettingCategory parentCategory : getParents()) {
         if (parentCategory.isHidden()) {
           hidden = true;
         }
       }
     }
     if (hidden == null) {
       hidden = false;
     }
   }
   return hidden;
 }