code: private boolean isValidManifestAttribute(ManifestAttribute attr)
      {
          String name = attr.name();
          String value = attr.value();
          boolean isValid = true;
  
          /*
          Note, the null-check for "name" is necessary when the annotation processor is hosted inside
          of an IDE where the name attribute of the ManifestAttribute metadata can be null
          temporarily.  In order to "keep going", just report a warning and proceed.
          */
          if (name == null || name.length() == 0)
          {
              _ap.printError( _intfDecl, "manifestattribute.illegal.name.1" );
              isValid = false;
          }
          else
          {
              if (alphaNum.indexOf(name.charAt(0)) < 0)
              {
                  _ap.printError( _intfDecl, "manifestattribute.illegal.name.2" );
                  isValid = false;
              }
              for (int i = 1; i < name.length(); i++)
              {
                  if (headerChar.indexOf(name.charAt(i)) < 0)
                  {
                      _ap.printError( _intfDecl, "manifestattribute.illegal.name.3", name.charAt(i) );
                      isValid = false;
                      break;
                  }
              }
          }
  
          /*
          Note, the null-check for "value" is necessary when the annotation processor is hosted inside
          of an IDE where the value attribute of the ManifestAttribute metadata can be null
          temporarily.  In order to "keep going", just report a warning and proceed.
          */
          if (value == null || value.length() == 0)
          {
              _ap.printError( _intfDecl, "manifestattribute.illegal.name.4" );
              isValid = false;
          }
          else
          {
              // TODO: validate string contents are valid UTF-8?
          }
  
          return isValid;
      }
docs: Validates a manifest attribute.  If the attribute is invalid, it will generate
  appropriate APT messager entries and return false, else return true.