本文整理匯總了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;
}