code: public Object getAttrVal(String attr) throws NamingException {
      if (attr.equalsIgnoreCase("dn")) {
        return getDn();
      }
  
      Attribute a = findAttr(attr);
  
      if (a == null) {
        return null;
      }
  
      return a.get();
    }
docs: getAttrVal - return first (or only) value for given attribute
  "dn" is treated as an attribute name.
  
  @param   attr   String attribute name
  @return  Object attribute value
  @throws NamingException