code: protected Object readResolve() throws InvalidObjectException {
          if (this.getClass() != TextAttribute.class) {
              throw new InvalidObjectException(
                  "subclass didn't correctly implement readResolve");
          }
  
          TextAttribute instance = (TextAttribute) instanceMap.get(getName());
          if (instance != null) {
              return instance;
          } else {
              throw new InvalidObjectException("unknown attribute name");
          }
      }
docs: Resolves instances being deserialized to the predefined constants.