Java Code Examples for org.eclipse.xtext.xbase.XbasePackage#eINSTANCE()
The following examples show how to use
org.eclipse.xtext.xbase.XbasePackage#eINSTANCE() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XAnnotationsPackageImpl.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. * * <p>This method is used to initialize {@link XAnnotationsPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static XAnnotationsPackage init() { if (isInited) return (XAnnotationsPackage)EPackage.Registry.INSTANCE.getEPackage(XAnnotationsPackage.eNS_URI); // Obtain or create and register package Object registeredXAnnotationsPackage = EPackage.Registry.INSTANCE.get(eNS_URI); XAnnotationsPackageImpl theXAnnotationsPackage = registeredXAnnotationsPackage instanceof XAnnotationsPackageImpl ? (XAnnotationsPackageImpl)registeredXAnnotationsPackage : new XAnnotationsPackageImpl(); isInited = true; // Initialize simple dependencies TypesPackage.eINSTANCE.eClass(); // Obtain or create and register interdependencies Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(XtypePackage.eNS_URI); XtypePackageImpl theXtypePackage = (XtypePackageImpl)(registeredPackage instanceof XtypePackageImpl ? registeredPackage : XtypePackage.eINSTANCE); registeredPackage = EPackage.Registry.INSTANCE.getEPackage(XbasePackage.eNS_URI); XbasePackageImpl theXbasePackage = (XbasePackageImpl)(registeredPackage instanceof XbasePackageImpl ? registeredPackage : XbasePackage.eINSTANCE); // Create package meta-data objects theXAnnotationsPackage.createPackageContents(); theXtypePackage.createPackageContents(); theXbasePackage.createPackageContents(); // Initialize created meta-data theXAnnotationsPackage.initializePackageContents(); theXtypePackage.initializePackageContents(); theXbasePackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theXAnnotationsPackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(XAnnotationsPackage.eNS_URI, theXAnnotationsPackage); return theXAnnotationsPackage; }
Example 2
Source File: XtypePackageImpl.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. * * <p>This method is used to initialize {@link XtypePackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() * @generated */ public static XtypePackage init() { if (isInited) return (XtypePackage)EPackage.Registry.INSTANCE.getEPackage(XtypePackage.eNS_URI); // Obtain or create and register package Object registeredXtypePackage = EPackage.Registry.INSTANCE.get(eNS_URI); XtypePackageImpl theXtypePackage = registeredXtypePackage instanceof XtypePackageImpl ? (XtypePackageImpl)registeredXtypePackage : new XtypePackageImpl(); isInited = true; // Initialize simple dependencies TypesPackage.eINSTANCE.eClass(); // Obtain or create and register interdependencies Object registeredPackage = EPackage.Registry.INSTANCE.getEPackage(XAnnotationsPackage.eNS_URI); XAnnotationsPackageImpl theXAnnotationsPackage = (XAnnotationsPackageImpl)(registeredPackage instanceof XAnnotationsPackageImpl ? registeredPackage : XAnnotationsPackage.eINSTANCE); registeredPackage = EPackage.Registry.INSTANCE.getEPackage(XbasePackage.eNS_URI); XbasePackageImpl theXbasePackage = (XbasePackageImpl)(registeredPackage instanceof XbasePackageImpl ? registeredPackage : XbasePackage.eINSTANCE); // Create package meta-data objects theXtypePackage.createPackageContents(); theXAnnotationsPackage.createPackageContents(); theXbasePackage.createPackageContents(); // Initialize created meta-data theXtypePackage.initializePackageContents(); theXAnnotationsPackage.initializePackageContents(); theXbasePackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theXtypePackage.freeze(); // Update the registry and return the package EPackage.Registry.INSTANCE.put(XtypePackage.eNS_URI, theXtypePackage); return theXtypePackage; }