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

de.uni.freiburg.iig.telematik.sewol.parser.ParserDateFormat Maven / Gradle / Ivy

Go to download

SEWOL provides support for the handling of workflow traces. Specifically it allows to specify the shape and content of process traces in terms of entries representing the execution of a specific workflow activity. SEWOL also allows to write these traces on disk as a log file with the help of a special file writer for process logs. Currently it supports plain text, Petrify, MXML and XES log file types. In order to specify security-related context information, SEWOL provides access control models such as access control lists (ACL) and role-based access control models (RBAC). All types of models can be conveniently edited with the help of appropriate dialogs.

The newest version!
package de.uni.freiburg.iig.telematik.sewol.parser;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import de.invation.code.toval.validate.ParameterException;
import de.invation.code.toval.validate.Validate;

/**
 * The enumeration contains the different date formats that can occur in MXML
 * and XES files.
 *
 * @author Adrian Lange
 */
public enum ParserDateFormat {

        DEFAULT_MXML, MXML_WITHOUT_MILIS;

        public final static String DEFAULT_MXML_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
        public final static String MXML_WITHOUT_MILIS_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";

        /**
         * Returns the date format string that belongs to the ParserDateFormat.
         *
         * @param pdf
         * @return
         * @see SimpleDateFormat
         */
        public static String getFormatString(ParserDateFormat pdf) {
                Validate.notNull(pdf);
                switch (pdf) {
                        case DEFAULT_MXML:
                                return DEFAULT_MXML_FORMAT;
                        case MXML_WITHOUT_MILIS:
                                return MXML_WITHOUT_MILIS_FORMAT;
                        default:
                                throw new ParameterException("Date format \"" + pdf + "\" is not allowed.");
                }
        }

        /**
         * Returns the {@link DateFormat} that belongs to the ParserDateFormat.
         *
         * @param pdf
         * @return
         */
        public static DateFormat getDateFormat(ParserDateFormat pdf) {
                return new SimpleDateFormat(getFormatString(pdf));
        }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy