code: public Registration writeClass (Output output, Class type) {
  		if (output == null) throw new IllegalArgumentException("output cannot be null.");
  		try {
  			return classResolver.writeClass(output, type);
  		} finally {
  			if (depth == 0 && autoReset) reset();
  		}
  	}
docs: Writes a class and returns its registration.
  @param type May be null.
  @return Will be null if type is null.
  @see ClassResolver#writeClass(Output, Class)