code: public void setAttributes (Attributes atts)
      {
      int length = atts.getLength ();
  
      super.setAttributes (atts);
      declared = new boolean [length];
      specified = new boolean [length];
  
      if (atts instanceof Attributes2) {
          Attributes2    a2 = (Attributes2) atts;
          for (int i = 0; i < length; i++) {
          declared [i] = a2.isDeclared (i);
          specified [i] = a2.isSpecified (i);
          }
      } else {
          for (int i = 0; i < length; i++) {
          declared [i] = !"CDATA".equals (atts.getType (i));
          specified [i] = true;
          }
      }
      }
docs: Copy an entire Attributes object.  The "specified" flags are
  assigned as true, and "declared" flags as false (except when
  an attribute's type is not CDATA),
  unless the object is an Attributes2 object.
  In that case those flag values are all copied.
  
  @param atts The attributes to copy.
  
  @see AttributesImpl#setAttributes