org.eclipse.xtext.xtext.ui.wizard.ecore2xtext
Class Ecore2XtextExtensions

java.lang.Object
  extended by org.eclipse.xtext.xtext.ui.wizard.ecore2xtext.Ecore2XtextExtensions

public class Ecore2XtextExtensions
extends java.lang.Object

Originally written with M2T Xtend. (Ecore2Xtext.ext)
Translated to Tools Xtend mostly 1:1.

Since:
2.3
Author:
Dennis Huebner - Initial contribution and API

Constructor Summary
Ecore2XtextExtensions()
           
 
Method Summary
static java.lang.Iterable<org.eclipse.emf.ecore.EAttribute> allAttributes(org.eclipse.emf.ecore.EClass it)
          allAttributes(EClass this) : inlinedFeatures().typeSelect(EAttribute); allCrossReferences(EClass this) : inlinedFeatures().typeSelect(EReference).select(r|!r.isContainment()); allContainmentReferences(EClass this) : inlinedFeatures().typeSelect(EReference).select(r|r.isContainment());
static java.lang.Iterable<org.eclipse.emf.ecore.EClassifier> allConcreteRuleClassifiers(Ecore2XtextProjectInfo it)
          cached Collection[EClassifier] allConcreteRuleClassifiers(Ecore2XtextProjectInfo this) : rootElementClass == null ? EPackageInfos.EPackage.allReferencedClassifiers(false).flatten().toSet().select(c|c.needsConcreteRule()) : (let c = { rootElementClass } : rootElementClass.allAssignedClassifiers(c) -> c.select(c|c.needsConcreteRule()).toSet());
static java.lang.Iterable<org.eclipse.emf.ecore.EReference> allContainmentReferences(org.eclipse.emf.ecore.EClass it)
           
static java.lang.Iterable<org.eclipse.emf.ecore.EReference> allCrossReferences(org.eclipse.emf.ecore.EClass it)
           
static java.util.Collection<org.eclipse.emf.ecore.EClass> allDispatcherRuleClasses(Ecore2XtextProjectInfo it)
          cached Collection[EClass] allDispatcherRuleClasses(Ecore2XtextProjectInfo this) : rootElementClass == null ? EPackageInfos.EPackage.allReferencedClassifiers(false).flatten().toSet().select(c|c.needsDispatcherRule()) : allConcreteRuleClassifiers().typeSelect(EClass).collect(c|c.EAllReferences.select(r|r.needsAssignment()).EType).flatten().toSet();
static java.util.Set<org.eclipse.emf.ecore.EClassifier> allReferencedClassifiers(org.eclipse.emf.ecore.EPackage ePack, boolean includeCrossRefs)
           
static java.util.Collection<org.eclipse.emf.ecore.EPackage> allReferencedEPackages(Ecore2XtextProjectInfo prjInfo)
          cached Collection[EPackage] allReferencedEPackages(Ecore2XtextProjectInfo this) : EPackageInfos.EPackage.allReferencedEPackages(true).flatten().toSet();
static java.util.Set<org.eclipse.emf.ecore.EPackage> allReferencedEPackages(org.eclipse.emf.ecore.EPackage ePack, boolean includeCrossRefs)
          private cached Collection[EPackage] allReferencedEPackages(EPackage this, boolean includeCrossRefs) : allReferencedClassifiers(includeCrossRefs).EPackage.toSet();
static java.lang.String assignedRuleCall(org.eclipse.emf.ecore.EAttribute it)
          assignedRuleCall(EAttribute this): (isPrefixBooleanFeature()) ? "'"+name+"'" : EType.uniqueName();
static java.lang.String assignmentKeyword(org.eclipse.emf.ecore.EStructuralFeature it)
          assignmentKeyword(EStructuralFeature this) : isPrefixBooleanFeature() ? "" : "'" + name + "' ";
static java.lang.String booleanRuleBody()
           
static java.lang.String concreteRuleName(org.eclipse.emf.ecore.EClass it)
           
static java.lang.String dataTypeRuleBody(org.eclipse.emf.ecore.EDataType it)
           
static java.lang.String decimalRuleBody()
           
static java.lang.String fqn(org.eclipse.emf.ecore.EClassifier it)
           
static org.eclipse.emf.ecore.EAttribute idAttribute(org.eclipse.emf.ecore.EClass it)
           
static java.lang.Iterable<org.eclipse.emf.ecore.EStructuralFeature> inlinedFeatures(org.eclipse.emf.ecore.EClass it)
          cached inlinedFeatures(EClass this) : EAllStructuralFeatures.select(f|f.needsAssignment()).remove(idAttribute()).removeAll(prefixFeatures());
static java.lang.String intRuleBody()
           
static boolean isBoolean(org.eclipse.emf.ecore.EClassifier it)
           
static boolean isContainment(org.eclipse.emf.ecore.EStructuralFeature eStrFeat)
          isContainment(EStructuralFeature this) : false; isContainment(EAttribute this) : true; isContainment(EReference this) : containment;
static boolean isEcoreType(org.eclipse.emf.ecore.EClassifier it)
           
static boolean isID(org.eclipse.emf.ecore.EStructuralFeature it)
           
static boolean isPrefixBooleanFeature(org.eclipse.emf.ecore.EStructuralFeature it)
           
static boolean isString(org.eclipse.emf.ecore.EClassifier it)
           
static boolean isXtextKeyword(java.lang.String str)
           
static boolean needsAssignment(org.eclipse.emf.ecore.EStructuralFeature it)
           
static boolean needsConcreteRule(org.eclipse.emf.ecore.EClassifier eClassifier)
          boolean needsConcreteRule(EClass this) : !abstract && !interface;
static boolean needsDispatcherRule(org.eclipse.emf.ecore.EClassifier eClassifier)
           
static boolean onlyOptionalFeatures(org.eclipse.emf.ecore.EClass it)
           
static java.lang.Iterable<org.eclipse.emf.ecore.EStructuralFeature> prefixFeatures(org.eclipse.emf.ecore.EClass it)
           
static java.lang.String quoteIfNeccesary(java.lang.String str)
          quoteIfNeccesary(String this) : isXtextKeyword() ? '^' + this : this;
static java.lang.Iterable<org.eclipse.emf.ecore.EClass> subClasses(org.eclipse.emf.ecore.EClass it)
          cached subClasses(EClass this): EPackage.EClassifiers.typeSelect(EClass).select(c|c.EAllSuperTypes.contains(this));
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ecore2XtextExtensions

public Ecore2XtextExtensions()
Method Detail

allConcreteRuleClassifiers

public static java.lang.Iterable<org.eclipse.emf.ecore.EClassifier> allConcreteRuleClassifiers(Ecore2XtextProjectInfo it)
cached Collection[EClassifier] allConcreteRuleClassifiers(Ecore2XtextProjectInfo this) : rootElementClass == null ? EPackageInfos.EPackage.allReferencedClassifiers(false).flatten().toSet().select(c|c.needsConcreteRule()) : (let c = { rootElementClass } : rootElementClass.allAssignedClassifiers(c) -> c.select(c|c.needsConcreteRule()).toSet());


allDispatcherRuleClasses

public static java.util.Collection<org.eclipse.emf.ecore.EClass> allDispatcherRuleClasses(Ecore2XtextProjectInfo it)
cached Collection[EClass] allDispatcherRuleClasses(Ecore2XtextProjectInfo this) : rootElementClass == null ? EPackageInfos.EPackage.allReferencedClassifiers(false).flatten().toSet().select(c|c.needsDispatcherRule()) : allConcreteRuleClassifiers().typeSelect(EClass).collect(c|c.EAllReferences.select(r|r.needsAssignment()).EType).flatten().toSet();


allReferencedEPackages

public static java.util.Collection<org.eclipse.emf.ecore.EPackage> allReferencedEPackages(Ecore2XtextProjectInfo prjInfo)
cached Collection[EPackage] allReferencedEPackages(Ecore2XtextProjectInfo this) : EPackageInfos.EPackage.allReferencedEPackages(true).flatten().toSet();


allReferencedEPackages

public static java.util.Set<org.eclipse.emf.ecore.EPackage> allReferencedEPackages(org.eclipse.emf.ecore.EPackage ePack,
                                                                                   boolean includeCrossRefs)
private cached Collection[EPackage] allReferencedEPackages(EPackage this, boolean includeCrossRefs) : allReferencedClassifiers(includeCrossRefs).EPackage.toSet();


allReferencedClassifiers

public static java.util.Set<org.eclipse.emf.ecore.EClassifier> allReferencedClassifiers(org.eclipse.emf.ecore.EPackage ePack,
                                                                                        boolean includeCrossRefs)

fqn

public static java.lang.String fqn(org.eclipse.emf.ecore.EClassifier it)

prefixFeatures

public static java.lang.Iterable<org.eclipse.emf.ecore.EStructuralFeature> prefixFeatures(org.eclipse.emf.ecore.EClass it)

inlinedFeatures

public static java.lang.Iterable<org.eclipse.emf.ecore.EStructuralFeature> inlinedFeatures(org.eclipse.emf.ecore.EClass it)
cached inlinedFeatures(EClass this) : EAllStructuralFeatures.select(f|f.needsAssignment()).remove(idAttribute()).removeAll(prefixFeatures());


onlyOptionalFeatures

public static boolean onlyOptionalFeatures(org.eclipse.emf.ecore.EClass it)

assignedRuleCall

public static java.lang.String assignedRuleCall(org.eclipse.emf.ecore.EAttribute it)
assignedRuleCall(EAttribute this): (isPrefixBooleanFeature()) ? "'"+name+"'" : EType.uniqueName();


concreteRuleName

public static java.lang.String concreteRuleName(org.eclipse.emf.ecore.EClass it)

dataTypeRuleBody

public static java.lang.String dataTypeRuleBody(org.eclipse.emf.ecore.EDataType it)

intRuleBody

public static java.lang.String intRuleBody()

decimalRuleBody

public static java.lang.String decimalRuleBody()

booleanRuleBody

public static java.lang.String booleanRuleBody()

assignmentKeyword

public static java.lang.String assignmentKeyword(org.eclipse.emf.ecore.EStructuralFeature it)
assignmentKeyword(EStructuralFeature this) : isPrefixBooleanFeature() ? "" : "'" + name + "' ";


quoteIfNeccesary

public static java.lang.String quoteIfNeccesary(java.lang.String str)
quoteIfNeccesary(String this) : isXtextKeyword() ? '^' + this : this;


isXtextKeyword

public static boolean isXtextKeyword(java.lang.String str)

idAttribute

public static org.eclipse.emf.ecore.EAttribute idAttribute(org.eclipse.emf.ecore.EClass it)

isBoolean

public static boolean isBoolean(org.eclipse.emf.ecore.EClassifier it)

isPrefixBooleanFeature

public static boolean isPrefixBooleanFeature(org.eclipse.emf.ecore.EStructuralFeature it)

isString

public static boolean isString(org.eclipse.emf.ecore.EClassifier it)

isEcoreType

public static boolean isEcoreType(org.eclipse.emf.ecore.EClassifier it)

isID

public static boolean isID(org.eclipse.emf.ecore.EStructuralFeature it)

needsAssignment

public static boolean needsAssignment(org.eclipse.emf.ecore.EStructuralFeature it)

needsConcreteRule

public static boolean needsConcreteRule(org.eclipse.emf.ecore.EClassifier eClassifier)
boolean needsConcreteRule(EClass this) : !abstract && !interface;


needsDispatcherRule

public static boolean needsDispatcherRule(org.eclipse.emf.ecore.EClassifier eClassifier)

isContainment

public static boolean isContainment(org.eclipse.emf.ecore.EStructuralFeature eStrFeat)
isContainment(EStructuralFeature this) : false; isContainment(EAttribute this) : true; isContainment(EReference this) : containment;


subClasses

public static java.lang.Iterable<org.eclipse.emf.ecore.EClass> subClasses(org.eclipse.emf.ecore.EClass it)
cached subClasses(EClass this): EPackage.EClassifiers.typeSelect(EClass).select(c|c.EAllSuperTypes.contains(this));


allAttributes

public static java.lang.Iterable<org.eclipse.emf.ecore.EAttribute> allAttributes(org.eclipse.emf.ecore.EClass it)
allAttributes(EClass this) : inlinedFeatures().typeSelect(EAttribute); allCrossReferences(EClass this) : inlinedFeatures().typeSelect(EReference).select(r|!r.isContainment()); allContainmentReferences(EClass this) : inlinedFeatures().typeSelect(EReference).select(r|r.isContainment());


allCrossReferences

public static java.lang.Iterable<org.eclipse.emf.ecore.EReference> allCrossReferences(org.eclipse.emf.ecore.EClass it)

allContainmentReferences

public static java.lang.Iterable<org.eclipse.emf.ecore.EReference> allContainmentReferences(org.eclipse.emf.ecore.EClass it)