
package de.ivu.elect.jee.presentation.dynamicform;

import javax.faces.convert.Converter;

import de.ivu.elect.jee.faces.StringEmptyToNullConverter;

public class SeparatorPseudoProperty extends AbstractProperty {

  private final String msgKey;

  private final Object[] params;

  public SeparatorPseudoProperty(String msgKey, Object... params) {
    super();

    this.msgKey = msgKey;
    this.params = params;
  }

  @Override
  public Converter getDefaultConverter() {
    return new StringEmptyToNullConverter();
  }

  @Override
  public PropertyType getDefaultType() {
    return PropertyType.SEPARATOR;
  }

  @Override
  public boolean getDefaultRequired() {
    return false;
  }

  @Override
  protected boolean hasDefaultValue() {
    return false;
  }

  @Override
  public boolean hasValue() {
    return true;
  }

  @Override
  public String getDefaultLabel() {
    return getMessage(msgKey, params);
  }
}
