package de.ivu.elect.business.customdata.entity;

import de.ivu.elect.jee.presentation.dynamicform.Property;

@javax.enterprise.inject.Vetoed
public class CustomDataStorageProperties
{

private final CustomDataStorage entity;


    
    private
                de.ivu.elect.jee.presentation.dynamicform.LambdaStringProperty
                  customDataXmlProperty;

        
    private de.ivu.elect.jee.entity.customdata.CustomDataProperties customDataProperties;


public CustomDataStorageProperties(CustomDataStorage entity) {
this.entity = entity;

}

private static CustomDataStorageMeta getMetaData() {
return de.ivu.elect.jee.cdi.BeanManagerUtil.getBeanByClass( CustomDataStorageMeta.class);
}

public de.ivu.elect.jee.entity.customdata.CustomDataProperties getCustomDataProperties() {
if (customDataProperties==null){
customDataProperties = (entity.getCustomData() == null) ? null : entity.getCustomData().getProperties();
}
return customDataProperties;
}

public <T extends de.ivu.elect.jee.entity.customdata.CustomDataProperties> T getCustomDataProperties(Class<T> clazz) {
    return (T) getCustomDataProperties();
    }

    

        public
                    de.ivu.elect.jee.presentation.dynamicform.AbstractStringProperty
                getCustomDataXmlProperty() {
        if (customDataXmlProperty == null) {
        customDataXmlProperty = new


                    de.ivu.elect.jee.presentation.dynamicform.LambdaStringProperty
        
        (
        getMetaData().getCustomDataXmlEinzahlMessage(),
        getMetaData().getCustomDataXmlDefaultValue(),
        getMetaData().isCustomDataXmlRequired(),
                entity::setCustomDataXml,
        entity::getCustomDataXml

                    ,  1 ,
            de.ivu.elect.business.customdata.entity.CustomDataStorageConstants.CUSTOM_DATA_XML_MAX_LENGTH
                );

        }


        return customDataXmlProperty;
        }





        
        }