org.nasdanika.models.java.CompilationUnit Maven / Gradle / Ivy
/**
*/
package org.nasdanika.models.java;
import org.eclipse.emf.common.util.EList;
/**
*
* A representation of the model object 'Compilation Unit'.
*
*
*
* The following features are supported:
*
*
* - {@link org.nasdanika.models.java.CompilationUnit#getTypes Types}
* - {@link org.nasdanika.models.java.CompilationUnit#getPackageName Package Name}
* - {@link org.nasdanika.models.java.CompilationUnit#getImports Imports}
*
*
* @see org.nasdanika.models.java.JavaPackage#getCompilationUnit()
* @model
* @generated
*/
public interface CompilationUnit extends NamedElement {
String JAVA_EXTENSION = "java";
/**
* Returns the value of the 'Types' containment reference list.
* The list contents are of type {@link org.nasdanika.models.java.Type}.
*
*
* @return the value of the 'Types' containment reference list.
* @see org.nasdanika.models.java.JavaPackage#getCompilationUnit_Types()
* @model containment="true"
* @generated
*/
EList getTypes();
/**
* Returns the value of the 'Package Name' attribute.
*
*
* @return the value of the 'Package Name' attribute.
* @see #setPackageName(String)
* @see org.nasdanika.models.java.JavaPackage#getCompilationUnit_PackageName()
* @model
* @generated
*/
String getPackageName();
/**
* Sets the value of the '{@link org.nasdanika.models.java.CompilationUnit#getPackageName Package Name}' attribute.
*
*
* @param value the new value of the 'Package Name' attribute.
* @see #getPackageName()
* @generated
*/
void setPackageName(String value);
/**
* Returns the value of the 'Imports' attribute list.
* The list contents are of type {@link java.lang.String}.
*
*
* @return the value of the 'Imports' attribute list.
* @see org.nasdanika.models.java.JavaPackage#getCompilationUnit_Imports()
* @model
* @generated
*/
EList getImports();
static CompilationUnit create(String name, String packageName, String... imports) {
CompilationUnit cu = JavaFactory.eINSTANCE.createCompilationUnit();
cu.setName(name);
cu.setPackageName(packageName);
for (String i: imports) {
cu.getImports().add(i);
}
return cu;
}
default String generate() {
return generate(null, 0);
}
} // CompilationUnit