/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.web.server.push.analytics.formatting;

import com.opengamma.engine.value.ValueSpecification;

/**
 * Formats null values for display in the client.
 */
/* package */ class NullFormatter extends AbstractFormatter<Object> {

  /* package */ NullFormatter() {
    super(Object.class);
    addFormatter(new Formatter<Object>(Format.HISTORY) {
      @Override
      Object format(Object value, ValueSpecification valueSpec) {
        return null;
      }
    });
    addFormatter(new Formatter<Object>(Format.EXPANDED) {
      @Override
      Object format(Object value, ValueSpecification valueSpec) {
        return null;
      }
    });
  }

  @Override
  public Object formatCell(Object value, ValueSpecification valueSpec) {
    return "";
  }

  @Override
  public DataType getDataType() {
    return DataType.PRIMITIVE;
  }
}

@@ -758,36 +758,34 @@
 %0A        return 
-null
+%22%22
 ;%0A      %7D%0A    %7D)

Format expanded null as empty string