Spin-J nucleon-pair approximation with a J-pairing interaction for a single-j shell