All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netgrif.application.engine.importer.service.DataValidator Maven / Gradle / Ivy

Go to download

System provides workflow management functions including user, role and data management.

There is a newer version: 6.3.3
Show newest version
package com.netgrif.application.engine.importer.service;

import com.netgrif.application.engine.importer.model.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class DataValidator implements IDataValidator {

    @Override
    public void checkDeprecatedAttributes(Data data) {
        validateAttribute(data.getView(), "view", data.getId());
        validateAttribute(data.getValid() != null && !data.getValid().isEmpty() ? data.getValid() : null, "valid", data.getId());
        validateAttribute(data.getFormat(), "format", data.getId());
        validateAttribute(data.getValues() != null && !data.getValues().isEmpty() ? data.getValues() : null, "values", data.getId());
    }

    protected void validateAttribute(Object attr, String attrName, String fieldName) {
        if (attr != null) {
            log.warn("Data attribute [" + attrName + "] on field [" + fieldName + "] is deprecated.");
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy