Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target/
.settings/
.classpath
*.versionsBackup
16 changes: 16 additions & 0 deletions model/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.nasdanika.models.java.module;singleton:=true
Automatic-Module-Name: org.nasdanika.models.java.module
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: org.nasdanika.models.java.module,
org.nasdanika.models.java.module.impl,
org.nasdanika.models.java.module.util
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport
Bundle-ActivationPolicy: lazy
126 changes: 126 additions & 0 deletions model/model/java-module.ecore
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="java.module" nsURI="ecore://nasdanika.org/models/java/module"
nsPrefix="org.nasdanika.models.java.module">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Ecore model of Java module system concepts - module, requires (transitive), exports, opens, provides, uses."/>
</eAnnotations>
<eClassifiers xsi:type="ecore:EClass" name="Module">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="A Java module declaration as defined in module-info.java."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The module name."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="requires" upperBound="-1"
eType="#//Requires" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Modules required by this module."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="exports" upperBound="-1"
eType="#//Exports" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Packages exported by this module."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="opens" upperBound="-1"
eType="#//Opens" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Packages opened by this module for deep reflection."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="provides" upperBound="-1"
eType="#//Provides" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Service implementations provided by this module."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="uses" upperBound="-1"
eType="#//Uses" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Services used by this module."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Requires">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="A requires directive declaring a dependency on another module. Can be transitive (re-exports the dependency) or static (compile-time only)."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The name of the required module."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="transitive" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="If true, this module's dependents can also read the required module (transitive dependency)."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="static" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="If true, the dependency is required at compile time but optional at runtime."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Exports">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="An exports directive making a package accessible to other modules. Can optionally restrict access to specific modules using the 'to' qualifier."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The name of the exported package."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="modules" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Optional list of module names that this package is exported to. If empty, the package is exported to all modules."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Opens">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="An opens directive making a package open for deep reflection at runtime. Can optionally restrict access to specific modules using the 'to' qualifier."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The name of the opened package."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="modules" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Optional list of module names that this package is opened to. If empty, the package is opened to all modules."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Provides">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="A provides directive declaring that this module provides an implementation of a service interface."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="service" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The fully qualified name of the service interface."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="implementations" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Fully qualified names of the implementation classes providing the service."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Uses">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="A uses directive declaring that this module uses a service defined by a service interface."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="service" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The fully qualified name of the service interface used by this module."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>
40 changes: 40 additions & 0 deletions model/model/java-module.genmodel
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.nasdanika.models.java.module/src/main/java" creationIcons="false"
editorDirectory="" modelPluginID="org.nasdanika.models.java.module" modelName="JavaModule"
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore"
featureDelegation="Dynamic" complianceLevel="17.0" suppressGenModelAnnotations="false"
copyrightFields="false" operationReflection="true" importOrganizing="true">
<foreignModel>java-module.ecore</foreignModel>
<genPackages prefix="JavaModule" basePackage="org.nasdanika.models.java" disposableProviderFactory="true"
ecorePackage="java-module.ecore#/">
<genClasses ecoreClass="java-module.ecore#//Module">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Module/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference java-module.ecore#//Module/requires"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference java-module.ecore#//Module/exports"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference java-module.ecore#//Module/opens"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference java-module.ecore#//Module/provides"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference java-module.ecore#//Module/uses"/>
</genClasses>
<genClasses ecoreClass="java-module.ecore#//Requires">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Requires/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Requires/transitive"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Requires/static"/>
</genClasses>
<genClasses ecoreClass="java-module.ecore#//Exports">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Exports/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Exports/modules"/>
</genClasses>
<genClasses ecoreClass="java-module.ecore#//Opens">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Opens/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Opens/modules"/>
</genClasses>
<genClasses ecoreClass="java-module.ecore#//Provides">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Provides/service"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Provides/implementations"/>
</genClasses>
<genClasses ecoreClass="java-module.ecore#//Uses">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute java-module.ecore#//Uses/service"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
67 changes: 67 additions & 0 deletions model/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.nasdanika.models.java.module</groupId>
<version>2026.3.0</version>
<artifactId>parent</artifactId>
<relativePath>..</relativePath>
</parent>
<artifactId>model</artifactId>
<packaging>jar</packaging>
<name>Ecore Java Module Model</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>model</classifier>
<includes>
<include>model/**</include>
</includes>
<classesDirectory>${project.basedir}</classesDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.41.0</version>
</dependency>
</dependencies>
</project>
57 changes: 57 additions & 0 deletions model/src/main/java/org/nasdanika/models/java/module/Exports.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
*/
package org.nasdanika.models.java.module;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;

/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Exports</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* An exports directive making a package accessible to other modules.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.nasdanika.models.java.module.Exports#getName <em>Name</em>}</li>
* <li>{@link org.nasdanika.models.java.module.Exports#getModules <em>Modules</em>}</li>
* </ul>
*
* @see org.nasdanika.models.java.module.JavaModulePackage#getExports()
* @model
* @generated
*/
public interface Exports extends EObject {
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.nasdanika.models.java.module.JavaModulePackage#getExports_Name()
* @model
* @generated
*/
String getName();

/**
* Sets the value of the '{@link org.nasdanika.models.java.module.Exports#getName <em>Name</em>}' attribute.
* @param value the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
void setName(String value);

/**
* Returns the value of the '<em><b>Modules</b></em>' attribute list.
* @return the value of the '<em>Modules</em>' attribute list.
* @see org.nasdanika.models.java.module.JavaModulePackage#getExports_Modules()
* @model
* @generated
*/
EList<String> getModules();

} // Exports
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
*/
package org.nasdanika.models.java.module;

import org.eclipse.emf.ecore.EFactory;

/**
* <!-- begin-user-doc -->
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
* @see org.nasdanika.models.java.module.JavaModulePackage
* @generated
*/
public interface JavaModuleFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
JavaModuleFactory eINSTANCE = org.nasdanika.models.java.module.impl.JavaModuleFactoryImpl.init();

/**
* Returns a new object of class '<em>Module</em>'.
* @return a new object of class '<em>Module</em>'.
* @generated
*/
Module createModule();

/**
* Returns a new object of class '<em>Requires</em>'.
* @return a new object of class '<em>Requires</em>'.
* @generated
*/
Requires createRequires();

/**
* Returns a new object of class '<em>Exports</em>'.
* @return a new object of class '<em>Exports</em>'.
* @generated
*/
Exports createExports();

/**
* Returns a new object of class '<em>Opens</em>'.
* @return a new object of class '<em>Opens</em>'.
* @generated
*/
Opens createOpens();

/**
* Returns a new object of class '<em>Provides</em>'.
* @return a new object of class '<em>Provides</em>'.
* @generated
*/
Provides createProvides();

/**
* Returns a new object of class '<em>Uses</em>'.
* @return a new object of class '<em>Uses</em>'.
* @generated
*/
Uses createUses();

/**
* Returns the package supported by this factory.
* @return the package supported by this factory.
* @generated
*/
JavaModulePackage getJavaModulePackage();

} //JavaModuleFactory
Loading