/*
 * JPA entity Metadaten
 *
 */
package de.ivu.elect.business.customdata.entity;

import javax.inject.Inject;
import javax.inject.Named;

import de.ivu.elect.business.customdata.entity.CustomDataStorageConstants;
import de.ivu.elect.jee.faces.Messages;

@Named(CustomDataStorageMeta.COMPONENT_NAME)
@javax.enterprise.context.ApplicationScoped // ELECT-7845
public class CustomDataStorageMeta implements de.ivu.elect.jee.entity.Meta
{

  private static final long serialVersionUID = 1L;

  public static final String COMPONENT_NAME = "customDataStorageMeta";

  @Inject
  private transient Messages messages;

  public CustomDataStorageMeta() {
      super();
  }

  protected String getMessage(String msgKey, Object... params) {
    return messages.getMessageForMessageKey(msgKey, params);
  }

  @Override
  public String getEinzahlMessageKey(){
    return CustomDataStorageConstants.MESSAGE_KEY_ENTITY_EINZAHL;
  }

  @Override
  public  String getMehrzahlMessageKey(){
    return CustomDataStorageConstants.MESSAGE_KEY_ENTITY_MEHRZAHL;
  }


  @Override
  public String getEinzahlMessage() {
    return getMessage(getEinzahlMessageKey());
  }

  @Override
  public String getMehrzahlMessage(){
    return getMessage(getMehrzahlMessageKey());
  }



  public String getCustomDataXmlEinzahlMessageKey(){
    return CustomDataStorageConstants.MESSAGE_KEY_CUSTOM_DATA_XML_EINZAHL;
  }

  public String getCustomDataXmlMehrzahlMessageKey(){
    return CustomDataStorageConstants.MESSAGE_KEY_CUSTOM_DATA_XML_MEHRZAHL;
  }


  public String getCustomDataXmlEinzahlMessage(){
    return getMessage(getCustomDataXmlEinzahlMessageKey());
  }

  public String getCustomDataXmlMehrzahlMessage(){
    return getMessage(getCustomDataXmlMehrzahlMessageKey());
  }



  public boolean isCustomDataXmlRequired() {
    return !CustomDataStorageConstants.CUSTOM_DATA_XML_NULLABLE;
  }

  public java.lang.String getCustomDataXmlDefaultValue() {
    return CustomDataStorageConstants.CUSTOM_DATA_XML_DEFAULT_VALUE;
  }

  public int getCustomDataXmlMaxLength() {
    return CustomDataStorageConstants.CUSTOM_DATA_XML_MAX_LENGTH;
  }

}