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

org.omg.dd.dc.impl.DcPackageImpl Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2012 - 2024 Data In Motion and others.
 * All rights reserved. 
 * 
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 * 
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *      Mark Hoffmann - initial API and implementation
 */
package org.omg.dd.dc.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EValidator;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import org.omg.bpmn.bpmn2.Bpmn2Package;

import org.omg.bpmn.bpmn2.impl.Bpmn2PackageImpl;

import org.omg.bpmn.di.BpmnDiPackage;

import org.omg.bpmn.di.impl.BpmnDiPackageImpl;

import org.omg.dd.dc.Bounds;
import org.omg.dd.dc.DCRoot;
import org.omg.dd.dc.DcFactory;
import org.omg.dd.dc.DcPackage;
import org.omg.dd.dc.Font;
import org.omg.dd.dc.Point;

import org.omg.dd.dc.util.DcValidator;

import org.omg.dd.di.DiPackage;

import org.omg.dd.di.impl.DiPackageImpl;

/**
 * 
 * An implementation of the model Package.
 * 
 * @generated
 */
public class DcPackageImpl extends EPackageImpl implements DcPackage {
	/**
	 * 
	 * 
	 * @generated
	 */
	private EClass dcRootEClass = null;

	/**
	 * 
	 * 
	 * @generated
	 */
	private EClass boundsEClass = null;

	/**
	 * 
	 * 
	 * @generated
	 */
	private EClass fontEClass = null;

	/**
	 * 
	 * 
	 * @generated
	 */
	private EClass pointEClass = null;

	/**
	 * Creates an instance of the model Package, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * 

Note: the correct way to create the package is via the static * factory method {@link #init init()}, which also performs * initialization of the package, or returns the registered package, * if one already exists. * * * @see org.eclipse.emf.ecore.EPackage.Registry * @see org.omg.dd.dc.DcPackage#eNS_URI * @see #init() * @generated */ private DcPackageImpl() { super(eNS_URI, DcFactory.eINSTANCE); } /** * * * @generated */ private static boolean isInited = false; /** * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. * *

This method is used to initialize {@link DcPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * * * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static DcPackage init() { if (isInited) return (DcPackage)EPackage.Registry.INSTANCE.getEPackage(DcPackage.eNS_URI); // Obtain or create and register package Object registeredDcPackage = EPackage.Registry.INSTANCE.get(eNS_URI); DcPackageImpl theDcPackage = registeredDcPackage instanceof DcPackageImpl ? (DcPackageImpl)registeredDcPackage : new DcPackageImpl(); isInited = true; // Obtain or create and register interdependencies Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(Bpmn2Package.eNS_URI); Bpmn2PackageImpl theBpmn2Package = (Bpmn2PackageImpl)(registeredPackage instanceof Bpmn2PackageImpl ? registeredPackage : Bpmn2Package.eINSTANCE); registeredPackage = EPackage.Registry.INSTANCE.getEPackage(BpmnDiPackage.eNS_URI); BpmnDiPackageImpl theBpmnDiPackage = (BpmnDiPackageImpl)(registeredPackage instanceof BpmnDiPackageImpl ? registeredPackage : BpmnDiPackage.eINSTANCE); registeredPackage = EPackage.Registry.INSTANCE.getEPackage(DiPackage.eNS_URI); DiPackageImpl theDiPackage = (DiPackageImpl)(registeredPackage instanceof DiPackageImpl ? registeredPackage : DiPackage.eINSTANCE); // Load packages theBpmn2Package.loadPackage(); // Create package meta-data objects theDcPackage.createPackageContents(); theBpmnDiPackage.createPackageContents(); theDiPackage.createPackageContents(); // Initialize created meta-data theDcPackage.initializePackageContents(); theBpmnDiPackage.initializePackageContents(); theDiPackage.initializePackageContents(); // Fix loaded packages theBpmn2Package.fixPackageContents(); // Register package validator EValidator.Registry.INSTANCE.put (theDcPackage, new EValidator.Descriptor() { @Override public EValidator getEValidator() { return DcValidator.INSTANCE; } }); // Mark meta-data to indicate it can't be changed theDcPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(DcPackage.eNS_URI, theDcPackage); return theDcPackage; } /** * * * @generated */ @Override public EClass getDCRoot() { return dcRootEClass; } /** * * * @generated */ @Override public EAttribute getDCRoot_Mixed() { return (EAttribute)dcRootEClass.getEStructuralFeatures().get(0); } /** * * * @generated */ @Override public EReference getDCRoot_XMLNSPrefixMap() { return (EReference)dcRootEClass.getEStructuralFeatures().get(1); } /** * * * @generated */ @Override public EReference getDCRoot_XSISchemaLocation() { return (EReference)dcRootEClass.getEStructuralFeatures().get(2); } /** * * * @generated */ @Override public EReference getDCRoot_Bounds() { return (EReference)dcRootEClass.getEStructuralFeatures().get(3); } /** * * * @generated */ @Override public EReference getDCRoot_Font() { return (EReference)dcRootEClass.getEStructuralFeatures().get(4); } /** * * * @generated */ @Override public EReference getDCRoot_Point() { return (EReference)dcRootEClass.getEStructuralFeatures().get(5); } /** * * * @generated */ @Override public EClass getBounds() { return boundsEClass; } /** * * * @generated */ @Override public EAttribute getBounds_Height() { return (EAttribute)boundsEClass.getEStructuralFeatures().get(0); } /** * * * @generated */ @Override public EAttribute getBounds_Width() { return (EAttribute)boundsEClass.getEStructuralFeatures().get(1); } /** * * * @generated */ @Override public EAttribute getBounds_X() { return (EAttribute)boundsEClass.getEStructuralFeatures().get(2); } /** * * * @generated */ @Override public EAttribute getBounds_Y() { return (EAttribute)boundsEClass.getEStructuralFeatures().get(3); } /** * * * @generated */ @Override public EClass getFont() { return fontEClass; } /** * * * @generated */ @Override public EAttribute getFont_IsBold() { return (EAttribute)fontEClass.getEStructuralFeatures().get(0); } /** * * * @generated */ @Override public EAttribute getFont_IsItalic() { return (EAttribute)fontEClass.getEStructuralFeatures().get(1); } /** * * * @generated */ @Override public EAttribute getFont_IsStrikeThrough() { return (EAttribute)fontEClass.getEStructuralFeatures().get(2); } /** * * * @generated */ @Override public EAttribute getFont_IsUnderline() { return (EAttribute)fontEClass.getEStructuralFeatures().get(3); } /** * * * @generated */ @Override public EAttribute getFont_Name() { return (EAttribute)fontEClass.getEStructuralFeatures().get(4); } /** * * * @generated */ @Override public EAttribute getFont_Size() { return (EAttribute)fontEClass.getEStructuralFeatures().get(5); } /** * * * @generated */ @Override public EOperation getFont__Non_negative_size__DiagnosticChain_Map() { return fontEClass.getEOperations().get(0); } /** * * * @generated */ @Override public EClass getPoint() { return pointEClass; } /** * * * @generated */ @Override public EAttribute getPoint_X() { return (EAttribute)pointEClass.getEStructuralFeatures().get(0); } /** * * * @generated */ @Override public EAttribute getPoint_Y() { return (EAttribute)pointEClass.getEStructuralFeatures().get(1); } /** * * * @generated */ @Override public DcFactory getDcFactory() { return (DcFactory)getEFactoryInstance(); } /** * * * @generated */ private boolean isCreated = false; /** * Creates the meta-model objects for the package. This method is * guarded to have no affect on any invocation but its first. * * * @generated */ public void createPackageContents() { if (isCreated) return; isCreated = true; // Create classes and their features dcRootEClass = createEClass(DC_ROOT); createEAttribute(dcRootEClass, DC_ROOT__MIXED); createEReference(dcRootEClass, DC_ROOT__XMLNS_PREFIX_MAP); createEReference(dcRootEClass, DC_ROOT__XSI_SCHEMA_LOCATION); createEReference(dcRootEClass, DC_ROOT__BOUNDS); createEReference(dcRootEClass, DC_ROOT__FONT); createEReference(dcRootEClass, DC_ROOT__POINT); boundsEClass = createEClass(BOUNDS); createEAttribute(boundsEClass, BOUNDS__HEIGHT); createEAttribute(boundsEClass, BOUNDS__WIDTH); createEAttribute(boundsEClass, BOUNDS__X); createEAttribute(boundsEClass, BOUNDS__Y); fontEClass = createEClass(FONT); createEAttribute(fontEClass, FONT__IS_BOLD); createEAttribute(fontEClass, FONT__IS_ITALIC); createEAttribute(fontEClass, FONT__IS_STRIKE_THROUGH); createEAttribute(fontEClass, FONT__IS_UNDERLINE); createEAttribute(fontEClass, FONT__NAME); createEAttribute(fontEClass, FONT__SIZE); createEOperation(fontEClass, FONT___NON_NEGATIVE_SIZE__DIAGNOSTICCHAIN_MAP); pointEClass = createEClass(POINT); createEAttribute(pointEClass, POINT__X); createEAttribute(pointEClass, POINT__Y); } /** * * * @generated */ private boolean isInitialized = false; /** * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. * * * @generated */ public void initializePackageContents() { if (isInitialized) return; isInitialized = true; // Initialize package setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes // Initialize classes, features, and operations; add parameters initEClass(dcRootEClass, DCRoot.class, "DCRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getDCRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getDCRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getDCRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getDCRoot_Bounds(), this.getBounds(), null, "bounds", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEReference(getDCRoot_Font(), this.getFont(), null, "font", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEReference(getDCRoot_Point(), this.getPoint(), null, "point", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEClass(boundsEClass, Bounds.class, "Bounds", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getBounds_Height(), ecorePackage.getEFloat(), "height", null, 1, 1, Bounds.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getBounds_Width(), ecorePackage.getEFloat(), "width", null, 1, 1, Bounds.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getBounds_X(), ecorePackage.getEFloat(), "x", "0", 1, 1, Bounds.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getBounds_Y(), ecorePackage.getEFloat(), "y", "0", 1, 1, Bounds.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEClass(fontEClass, Font.class, "Font", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getFont_IsBold(), ecorePackage.getEBoolean(), "isBold", null, 0, 1, Font.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getFont_IsItalic(), ecorePackage.getEBoolean(), "isItalic", null, 0, 1, Font.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getFont_IsStrikeThrough(), ecorePackage.getEBoolean(), "isStrikeThrough", null, 0, 1, Font.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getFont_IsUnderline(), ecorePackage.getEBoolean(), "isUnderline", null, 0, 1, Font.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getFont_Name(), ecorePackage.getEString(), "name", null, 0, 1, Font.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getFont_Size(), ecorePackage.getEFloat(), "size", null, 0, 1, Font.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); EOperation op = initEOperation(getFont__Non_negative_size__DiagnosticChain_Map(), ecorePackage.getEBoolean(), "non_negative_size", 0, 1, IS_UNIQUE, IS_ORDERED); addEParameter(op, ecorePackage.getEDiagnosticChain(), "diagnostics", 0, 1, IS_UNIQUE, IS_ORDERED); EGenericType g1 = createEGenericType(ecorePackage.getEMap()); EGenericType g2 = createEGenericType(ecorePackage.getEJavaObject()); g1.getETypeArguments().add(g2); g2 = createEGenericType(ecorePackage.getEJavaObject()); g1.getETypeArguments().add(g2); addEParameter(op, g1, "context", 0, 1, IS_UNIQUE, IS_ORDERED); initEClass(pointEClass, Point.class, "Point", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getPoint_X(), ecorePackage.getEFloat(), "x", "0", 1, 1, Point.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getPoint_Y(), ecorePackage.getEFloat(), "y", "0", 1, 1, Point.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); // Create resource createResource(eNS_URI); // Create annotations // http:///org/eclipse/emf/ecore/util/ExtendedMetaData createExtendedMetaDataAnnotations(); } /** * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. * * * @generated */ protected void createExtendedMetaDataAnnotations() { String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; addAnnotation (dcRootEClass, source, new String[] { "name", "", "kind", "mixed" }); addAnnotation (getDCRoot_Mixed(), source, new String[] { "kind", "elementWildcard", "name", ":mixed" }); addAnnotation (getDCRoot_XMLNSPrefixMap(), source, new String[] { "kind", "attribute", "name", "xmlns:prefix" }); addAnnotation (getDCRoot_XSISchemaLocation(), source, new String[] { "kind", "attribute", "name", "xsi:schemaLocation" }); addAnnotation (getDCRoot_Bounds(), source, new String[] { "kind", "element", "name", "Bounds", "namespace", "http://www.omg.org/spec/DD/20100524/DC" }); addAnnotation (getDCRoot_Font(), source, new String[] { "kind", "element", "name", "Font", "namespace", "http://www.omg.org/spec/DD/20100524/DC" }); addAnnotation (getDCRoot_Point(), source, new String[] { "kind", "element", "name", "Point", "namespace", "http://www.omg.org/spec/DD/20100524/DC" }); addAnnotation (boundsEClass, source, new String[] { "name", "Bounds", "kind", "empty" }); addAnnotation (getBounds_Height(), source, new String[] { "kind", "attribute", "name", "height" }); addAnnotation (getBounds_Width(), source, new String[] { "kind", "attribute", "name", "width" }); addAnnotation (getBounds_X(), source, new String[] { "kind", "attribute", "name", "x" }); addAnnotation (getBounds_Y(), source, new String[] { "kind", "attribute", "name", "y" }); addAnnotation (fontEClass, source, new String[] { "name", "Font", "kind", "empty" }); addAnnotation (getFont_IsBold(), source, new String[] { "kind", "attribute", "name", "isBold" }); addAnnotation (getFont_IsItalic(), source, new String[] { "kind", "attribute", "name", "isItalic" }); addAnnotation (getFont_IsStrikeThrough(), source, new String[] { "kind", "attribute", "name", "isStrikeThrough" }); addAnnotation (getFont_IsUnderline(), source, new String[] { "kind", "attribute", "name", "isUnderline" }); addAnnotation (getFont_Name(), source, new String[] { "kind", "attribute", "name", "name" }); addAnnotation (getFont_Size(), source, new String[] { "kind", "attribute", "name", "size" }); addAnnotation (pointEClass, source, new String[] { "name", "Point", "kind", "empty" }); addAnnotation (getPoint_X(), source, new String[] { "kind", "attribute", "name", "x" }); addAnnotation (getPoint_Y(), source, new String[] { "kind", "attribute", "name", "y" }); } } //DcPackageImpl





© 2015 - 2024 Weber Informatics LLC | Privacy Policy