// 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/Headline.java
// public class Headline {
// 	private DatatypeDefinitionString def;
// 
// 	Headline() {
// 		def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
// 		def.setIdentifier(IdentifierManager.generateIdentifier());
// 		def.setLongName("T_Headline");
// 	}
// 
// 	public DatatypeDefinitionString getDef() {
// 		return this.def;
// 	}
// 
// }
// 
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java
// public class String32k {
// 	private DatatypeDefinitionString def;
// 
// 	String32k() {
// 		def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
// 		def.setIdentifier(IdentifierManager.generateIdentifier());
// 		def.setLongName("T_String");
// 		def.setMaxLength(new BigInteger("32000"));
// 	}
// 
// 	public DatatypeDefinitionString getDef() {
// 		return this.def;
// 	}
// }


import javax.xml.datatype.DatatypeConfigurationException;
import org.eclipse.rmf.reqif10.AttributeDefinitionString;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
import de.kay_muench.reqif10.reqifcompiler.DateManager;
import de.kay_muench.reqif10.reqifcompiler.IdentifierManager;
import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline;
import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;
/**
 * 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.complex;




public class IdentifierAttribute {
	public static String NAME = "ID";
	private AttributeDefinitionString def;

	IdentifierAttribute(String32k type) throws DatatypeConfigurationException {
		def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString();
		def.setIdentifier(IdentifierManager.generateIdentifier());
		def.setLongName(IdentifierAttribute.NAME);
		def.setType(type.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/Headline.java
// public class Headline {
// 	private DatatypeDefinitionString def;
// 
// 	Headline() {
// 		def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
// 		def.setIdentifier(IdentifierManager.generateIdentifier());
// 		def.setLongName("T_Headline");
// 	}
// 
// 	public DatatypeDefinitionString getDef() {
// 		return this.def;
// 	}
// 
// }
// 
// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/simple/String32k.java
// public class String32k {
// 	private DatatypeDefinitionString def;
// 
// 	String32k() {
// 		def = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
// 		def.setIdentifier(IdentifierManager.generateIdentifier());
// 		def.setLongName("T_String");
// 		def.setMaxLength(new BigInteger("32000"));
// 	}
// 
// 	public DatatypeDefinitionString getDef() {
// 		return this.def;
// 	}
// }


// Path: reqifcompiler/src/main/java/de/kay_muench/reqif10/reqifcompiler/types/complex/IdentifierAttribute.java
import javax.xml.datatype.DatatypeConfigurationException;
import org.eclipse.rmf.reqif10.AttributeDefinitionString;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
import de.kay_muench.reqif10.reqifcompiler.DateManager;
import de.kay_muench.reqif10.reqifcompiler.IdentifierManager;
import de.kay_muench.reqif10.reqifcompiler.types.simple.Headline;
import de.kay_muench.reqif10.reqifcompiler.types.simple.String32k;

/**
 * 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.complex;




public class IdentifierAttribute {
	public static String NAME = "ID";
	private AttributeDefinitionString def;

	IdentifierAttribute(String32k type) throws DatatypeConfigurationException {
		def = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString();
		def.setIdentifier(IdentifierManager.generateIdentifier());
		def.setLongName(IdentifierAttribute.NAME);
		def.setType(type.getDef());
		def.setLastChange(DateManager.getCurrentDate());