本文整理汇总了Java中org.eclipse.emf.ecore.EClass.getEAllReferences方法的典型用法代码示例。如果您正苦于以下问题:Java EClass.getEAllReferences方法的具体用法?Java EClass.getEAllReferences怎么用?Java EClass.getEAllReferences使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.ecore.EClass
的用法示例。
在下文中一共展示了EClass.getEAllReferences方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initOppositeInfo
import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
private void initOppositeInfo() {
for (EClassifier eClassifier : ePackage.getEClassifiers()) {
if (eClassifier instanceof EClass) {
EClass eClass = (EClass)eClassifier;
boolean hasOpposites = false;
boolean hasManyOpposites = false;
for (EReference eReference : eClass.getEAllReferences()) {
if (eReference.getEOpposite() != null) {
hasOpposites = true;
if (eReference.isMany()) {
hasManyOpposites = true;
}
}
}
oppositeInfos.put(eClass, new OppositeInfo(hasOpposites, hasManyOpposites));
}
}
}
示例2: findContainers
import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
public Set<String> findContainers(Collection<EClass> collection, String selectedType) {
Set<String> result = new HashSet<String>();
SigTrace typeTrace;
try {
typeTrace = getSigTraceByType(selectedType);
} catch (TraceException e1) {
return result;
}
EList<EClass> superTypes = typeTrace.getEClass().getEAllSuperTypes();
for (EClass eClass : collection) {
for (EReference eReference : eClass.getEAllReferences()) {
if (eReference.isContainment()) {
try {
if (superTypes.stream()
.anyMatch(s -> s.getName().equals(eReference.getEReferenceType().getName()))) {
result.add(getSigTraceByClassName(eClass.getName()).getSigType());
}
} catch (TraceException e) {
// no need to handle
}
}
}
}
return result;
}
示例3: getAllInverseReferences
import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
public Set<EReference> getAllInverseReferences(EClass eClass) {
// TODO cache
Set<EReference> result = new HashSet<>();
for (EReference eReference : eClass.getEAllReferences()) {
if (isInverse(eReference)) {
result.add(eReference);
}
}
return result;
}
示例4: getAllHasInverseReferences
import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
public Set<EReference> getAllHasInverseReferences(EClass eClass) {
// TODO cache
Set<EReference> result = new HashSet<>();
for (EReference eReference : eClass.getEAllReferences()) {
if (hasInverse(eReference)) {
result.add(eReference);
}
}
return result;
}
示例5: hasInverses
import org.eclipse.emf.ecore.EClass; //导入方法依赖的package包/类
public boolean hasInverses(EClass eClass) {
for (EReference eReference : eClass.getEAllReferences()) {
if (hasInverse(eReference)) {
return true;
}
}
return false;
}