本文整理匯總了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);
}
}
示例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);
}
}
示例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");
}
};
}
};
}
示例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();
}
示例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");
}