// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java
// public class DateManager {
// 	private static boolean predictabilityEnabled = false;
// 
// 	public static void enablePredictableId() {
// 		predictabilityEnabled = true;
// 	}
// 
// 	public static GregorianCalendar getCurrentDate()
// 			throws DatatypeConfigurationException {
// 		GregorianCalendar calendar = new GregorianCalendar();
// 		if (predictabilityEnabled) {
// 			calendar.setTimeInMillis(0);
// 			calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
// 		} else {
// 			calendar.setTime(new Date());
// 		}
// 		return calendar;
// 	}
// 
// 	public static GregorianCalendar toDate(String date)
// 			throws DatatypeConfigurationException {
// 		XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil
// 				.createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date);
// 		return xmlGregoriaCalendar.toGregorianCalendar();
// 	}
// 
// }
// 
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java
// public final class IdentifierManager {
// 	private static boolean predictabilityEnabled = false;
// 	private static long predictableId = 1L;
// 
// 	public static void enablePredictableId() {
// 		predictabilityEnabled = true;
// 	}
// 
// 	public static String generateIdentifier() {
// 		if (predictabilityEnabled) {
// 			predictableId += 1L;
// 			return "" + predictableId;
// 		}
// 		return "requie-tool-" + UUID.randomUUID().toString();
// 	}
// }


import javax.xml.datatype.DatatypeConfigurationException;
import org.eclipse.rmf.reqif10.DatatypeDefinitionDate;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
import de.kay_muench.reqif10.reqifcompiler.DateManager;
import de.kay_muench.reqif10.reqifcompiler.IdentifierManager;
/**
 * Copyright (c) 2014 Kay Erik Münch.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.spdx.org/licenses/EPL-1.0
 * 
 * Contributors:
 *     Kay Erik Münch - initial API and implementation
 * 
 */
package de.kay_muench.reqif10.reqifcompiler.types.simple;




public class DateType {
	private DatatypeDefinitionDate def;

	DateType() throws DatatypeConfigurationException {
		def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate();
		def.setIdentifier(IdentifierManager.generateIdentifier());
		def.setLongName("T_Date");
		def.setLastChange(DateManager.getCurrentDate());
	}

	public DatatypeDefinitionDate getDef() {
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/DateManager.java
// public class DateManager {
// 	private static boolean predictabilityEnabled = false;
// 
// 	public static void enablePredictableId() {
// 		predictabilityEnabled = true;
// 	}
// 
// 	public static GregorianCalendar getCurrentDate()
// 			throws DatatypeConfigurationException {
// 		GregorianCalendar calendar = new GregorianCalendar();
// 		if (predictabilityEnabled) {
// 			calendar.setTimeInMillis(0);
// 			calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
// 		} else {
// 			calendar.setTime(new Date());
// 		}
// 		return calendar;
// 	}
// 
// 	public static GregorianCalendar toDate(String date)
// 			throws DatatypeConfigurationException {
// 		XMLGregorianCalendar xmlGregoriaCalendar = (XMLGregorianCalendar) EcoreUtil
// 				.createFromString(XMLTypePackage.eINSTANCE.getDateTime(), date);
// 		return xmlGregoriaCalendar.toGregorianCalendar();
// 	}
// 
// }
// 
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/IdentifierManager.java
// public final class IdentifierManager {
// 	private static boolean predictabilityEnabled = false;
// 	private static long predictableId = 1L;
// 
// 	public static void enablePredictableId() {
// 		predictabilityEnabled = true;
// 	}
// 
// 	public static String generateIdentifier() {
// 		if (predictabilityEnabled) {
// 			predictableId += 1L;
// 			return "" + predictableId;
// 		}
// 		return "requie-tool-" + UUID.randomUUID().toString();
// 	}
// }


// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/DateType.java
import javax.xml.datatype.DatatypeConfigurationException;
import org.eclipse.rmf.reqif10.DatatypeDefinitionDate;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
import de.kay_muench.reqif10.reqifcompiler.DateManager;
import de.kay_muench.reqif10.reqifcompiler.IdentifierManager;

/**
 * Copyright (c) 2014 Kay Erik Münch.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.spdx.org/licenses/EPL-1.0
 * 
 * Contributors:
 *     Kay Erik Münch - initial API and implementation
 * 
 */
package de.kay_muench.reqif10.reqifcompiler.types.simple;




public class DateType {
	private DatatypeDefinitionDate def;

	DateType() throws DatatypeConfigurationException {
		def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionDate();
		def.setIdentifier(IdentifierManager.generateIdentifier());
		def.setLongName("T_Date");
		def.setLastChange(DateManager.getCurrentDate());
	}

	public DatatypeDefinitionDate getDef() {
		return this.def;