dnet-core/dnet-information-service/src/main/java/eu/dnetlib/enabling/is/registry/validation/TypeAwareProfileValidator.java

26 lines
636 B
Java

package eu.dnetlib.enabling.is.registry.validation;
import org.springframework.beans.factory.annotation.Required;
import eu.dnetlib.enabling.tools.OpaqueResource;
public abstract class TypeAwareProfileValidator extends AbstractProfileValidator {
private String resourceType;
@Override
public boolean handle(OpaqueResource resource, RegistrationPhase phase) {
return super.handle(resource, phase) && getResourceType().equals(resource.getResourceType());
}
@Required
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
public String getResourceType() {
return resourceType;
}
}