當前位置: 首頁>>代碼示例>>Java>>正文


Java EReference.getName方法代碼示例

本文整理匯總了Java中org.eclipse.emf.ecore.EReference.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java EReference.getName方法的具體用法?Java EReference.getName怎麽用?Java EReference.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.emf.ecore.EReference的用法示例。


在下文中一共展示了EReference.getName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getConnectedEdgesForEObjectManyCase

import org.eclipse.emf.ecore.EReference; //導入方法依賴的package包/類
private void getConnectedEdgesForEObjectManyCase(Node node, final List<Node> allNodes, final List<Edge> result,
		EReference currRef, final Object targets) {

	final List<Node> targetNodes = new ArrayList<>();
	final List<String> targetNodesExternal = new ArrayList<>();
	for (Object currTarget : (Collection<?>) targets) {
		final Node currTargetNode = GraphUtils.getNodeForElement(currTarget, allNodes);

		if (currTargetNode != null)
			targetNodes.add(currTargetNode);
		else if (currTarget instanceof EObject && ((EObject) currTarget).eIsProxy())
			targetNodesExternal.add(EcoreUtil.getURI((EObject) currTarget).toString());
	}
	if (!targetNodes.isEmpty() || !targetNodesExternal.isEmpty()) {
		Edge edge = new Edge(
				currRef.getName(),
				!currRef.isContainment(),
				node,
				targetNodes,
				targetNodesExternal);

		result.add(edge);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:25,代碼來源:ASTGraphProvider.java

示例2: getConnectedEdgesForEObjectSingleCase

import org.eclipse.emf.ecore.EReference; //導入方法依賴的package包/類
private void getConnectedEdgesForEObjectSingleCase(Node node, final List<Node> allNodes, final List<Edge> result,
		EReference currRef, final Object target) {

	final Node targetNode = GraphUtils.getNodeForElement(target, allNodes);
	final String targetNodeExternal;

	if (targetNode == null && ((EObject) target).eIsProxy())
		targetNodeExternal = EcoreUtil.getURI((EObject) target).toString();
	else
		targetNodeExternal = null;

	if (targetNode != null || targetNodeExternal != null) {
		Edge edge = new Edge(
				currRef.getName(),
				!currRef.isContainment(),
				node,
				asCollection(targetNode),
				asCollection(targetNodeExternal));

		result.add(edge);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:23,代碼來源:ASTGraphProvider.java

示例3: configureDiffEngine

import org.eclipse.emf.ecore.EReference; //導入方法依賴的package包/類
private void configureDiffEngine() {
	IDiffProcessor diffProcessor = new DiffBuilder();
	diffEngine = new DefaultDiffEngine(diffProcessor) {
		@Override
		protected FeatureFilter createFeatureFilter() {
			return new FeatureFilter() {
				@Override
				protected boolean isIgnoredReference(Match match, EReference reference) {
					final String name = reference.getName();
					return name.equals("parent") || name.equals("states") || name.equals("statesNoOpposite");
				}
			};
		}
	};
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:16,代碼來源:GenericTraceExtractor.java

示例4: getErrorInfoForDanglingEObject

import org.eclipse.emf.ecore.EReference; //導入方法依賴的package包/類
private static final String getErrorInfoForDanglingEObject(EObject base, EReference ref) {
	return "in " + base.eClass().getName() + " at " + EcoreUtil.getURI(base) + " via reference " + ref.getName();
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:N4JSValidationTestHelper.java

示例5: appendSig

import org.eclipse.emf.ecore.EReference; //導入方法依賴的package包/類
private void appendSig(String alias, EClass eClass) {
  if (eClass.getName().equals(containerClassName) && ignoreContainer)
    return;

  // append sig trace
  builder.append("-- [email protected]" + alias + "." + eClass.getName() + "\n");

  EReference containerRef = getRefToContainer(eClass);
  if (containerRef != null) {
    String mul = getMultiplicity(containerRef);
    if ("set ".equals(mul))
      mul = "";
    builder.append(mul);
  }

  // append sig
  if (eClass.isAbstract()) {
    builder.append("abstract sig " + eClass.getName());
  } else {
    builder.append("sig " + eClass.getName());
  }

  // extends parts
  if (!eClass.getESuperTypes().isEmpty()) {
    builder.append(" extends ");
  }
  for (Iterator<EClass> it = eClass.getESuperTypes().iterator(); it.hasNext();) {
    EClass superClass = it.next();
    builder.append(superClass.getName());
    if (it.hasNext())
      builder.append(", ");
  }
  builder.append(" {\n");

  // relations
  for (Iterator<EReference> iterator = eClass.getEReferences().iterator(); iterator.hasNext();) {
    EReference eReference = iterator.next();

    String sig = eReference.getEType().getName();
    if (eReference.isContainment()) {
      if (containmentFacts.get(sig) == null)
        containmentFacts.put(sig, new ContainmentFact(sig));
      containmentFacts.get(sig).addConRel(eClass.getName(), eReference.getName());
    }

    String multiplicity = getMultiplicity(eReference);
    if (multiplicity.isEmpty()) {
      multiplicity = "set ";
      char c = eClass.getName().toLowerCase().charAt(0);
      String fact = "all " + c + ":" + eClass.getName() + " | ";
      if (eReference.getLowerBound() != -1)
        fact += "#" + c + "." + eReference.getName() + " >= " + eReference.getLowerBound();
      if (eReference.getUpperBound() != -1) {
        fact += " and #" + c + "." + eReference.getName() + " <= " + eReference.getUpperBound();
      }
      facts.add(fact);
      updateInt(Math.max(eReference.getLowerBound(), eReference.getUpperBound()));
    }

    // append trace
    builder.append(
        "\t-- [email protected]" + alias + "." + eClass.getName() + "." + eReference.getName() + "\n");

    // append relation
    builder.append(
        "\t" + eReference.getName() + ": " + multiplicity + eReference.getEType().getName());
    if (iterator.hasNext())
      builder.append(",");
    builder.append("\n");
  }
  builder.append("}\n\n");
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:73,代碼來源:EMFToAlloy.java


注:本文中的org.eclipse.emf.ecore.EReference.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。