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

org.protege.editor.owl.model.annotation.DateAnnotationValueProvider Maven / Gradle / Ivy

package org.protege.editor.owl.model.annotation;

import org.protege.editor.owl.model.util.DateFormatter;
import org.semanticweb.owlapi.model.OWLAnnotationValue;
import org.semanticweb.owlapi.model.OWLDataFactory;

import java.util.Date;
import java.util.Optional;

/**
 * Matthew Horridge
 * Stanford Center for Biomedical Informatics Research
 * 29/01/16
 */
public class DateAnnotationValueProvider implements AnnotationValueProvider {

    private final DateFormatter dateFormatter;

    public DateAnnotationValueProvider(DateFormatter dateFormatter) {
        this.dateFormatter = dateFormatter;
    }

    @Override
    public Optional getAnnotationValue(OWLDataFactory dataFactory) {
        return Optional.of(dateFormatter.formatDate(new Date(), dataFactory));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy