System.out.println("\t" + reference.getName() + "(" + reference.getEReferenceType().getName() + "): "); if (object.eGet(reference) instanceof EObjectResolvingEList) { EObjectResolvingEList<EObject> referencedObjectList = (EObjectResolvingEList<EObject>)object.eGet(reference); if (referencedObjectList != null && referencedObjectList.size() > 0) { if (reference.getEReferenceType().getEStructuralFeature("wrappedValue") != null) { for (Object obj : referencedObjectList) { Object wrappedValue = ((EObject)obj).eGet(reference.getEReferenceType().getEStructuralFeature("wrappedValue")); System.out.println(wrappedValue.toString()); if (referencedObjectList.get(referencedObjectList.size()-1) != obj) { System.out.println(); System.out.println("\t" + reference.getName() + "(" + reference.getEReferenceType().getName() + "): "); } else if (reference.getEReferenceType().getEStructuralFeature("wrappedValue") != null) {
@Override protected EClass getProxyType(EObject obj, EReference eRef) { EClass referenceType = eRef.getEReferenceType(); if (referenceType == TypesPackage.Literals.JVM_TYPE || referenceType == TypesPackage.Literals.JVM_IDENTIFIABLE_ELEMENT) return TypesPackage.Literals.JVM_VOID; if (referenceType == TypesPackage.Literals.JVM_DECLARED_TYPE) return TypesPackage.Literals.JVM_GENERIC_TYPE; return referenceType; } }
EList values = new BasicEList(); while (jp.nextToken() != JsonToken.END_ARRAY) { values.add(from(jp, eRef.getEReferenceType())); result.eSet(feature, from(jp, eRef.getEReferenceType()));
processRef(model, waitingList, object, eStructuralFeature, index, list, refOid); } else if(eStructuralFeature.getEAnnotation("twodimensionalarray")!=null) { IdEObjectImpl listObject = model.create(((EReference) eStructuralFeature).getEReferenceType()); addToList(eStructuralFeature, index, list, listObject); EStructuralFeature listFeature = listObject.eClass().getEStructuralFeature("List");
public EClassifier featureTargetType(EStructuralFeature typeObject) { if (typeObject instanceof EAttribute) { EAttribute attribute = (EAttribute) typeObject; return attribute.getEAttributeType(); } else if (typeObject instanceof EReference) { EReference reference = (EReference) typeObject; return reference.getEReferenceType(); } else throw new IllegalArgumentException("typeObject has invalid type " + typeObject.getClass().getName()); } public EReference featureOpposite(EStructuralFeature typeObject) {
@Override public Collection<?> getChoiceOfValues(Object object) { EReference eReference = (EReference)object; List<Object> result = new ArrayList<Object>(); if (eReference.getEType() instanceof EClass) { result.addAll(eReference.getEReferenceType().getEAllAttributes()); } return result; } });
protected Iterable<AbstractElement> findValidAssignmentsForCrossRef(EObject semanticObj, Iterable<AbstractElement> assignedElements, EObject value, INode node) { List<AbstractElement> result = Lists.newArrayList(); for (AbstractElement ass : assignedElements) { CrossReference crossref = GrammarUtil.containingCrossReference(ass); EReference eref = GrammarUtil.getReference(crossref, semanticObj.eClass()); if (EcoreUtil2.isAssignableFrom(eref.getEReferenceType(), value.eClass()) && crossRefSerializer.isValid(semanticObj, crossref, value, node, null)) result.add(ass); } return result; }
public EClass getReferenceType(EReference reference, EClass context) { EGenericType genericType = reference.getEGenericType(); if (genericType == null) { return reference.getEReferenceType(); } EGenericType boundGenericType = getBoundGenericType(genericType, context); if (boundGenericType.getEClassifier() == null) { throw new IllegalStateException("Either typeParameter or eRawType must be set in EGenericType " + genericType); } return (EClass) boundGenericType.getEClassifier(); }
public EClass getReferenceType(EReference reference, EClass context) { EGenericType genericType = reference.getEGenericType(); if (genericType == null) { return reference.getEReferenceType(); } EGenericType boundGenericType = getBoundGenericType(genericType, context); if (boundGenericType.getEClassifier() == null) { throw new IllegalStateException("Either typeParameter or eRawType must be set in EGenericType " + genericType); } return (EClass) boundGenericType.getEClassifier(); }
@SuppressWarnings("unchecked") protected S createNewRow() { EStructuralFeature feature = eClass().getEStructuralFeature("row"); if (feature == null || !(feature instanceof EReference)) { return null; } EClass rowType = ((EReference) feature).getEReferenceType(); return (S) rowType.getEPackage().getEFactoryInstance().create(rowType); }
@Override public void serialize(EObject bean, JsonGenerator jg, SerializerProvider provider) throws IOException { if (!OPTION_SERIALIZE_TYPE.enabledIn(features)) { return; } EClass objectType = bean.eClass(); EReference containment = bean.eContainmentFeature(); if (isRoot(bean) || shouldSaveType(objectType, containment.getEReferenceType(), containment)) { String value = valueWriter.writeValue(bean.eClass(), provider); jg.writeFieldName(getFieldName()); serializer.serialize(value, jg, provider); } }
protected IScope getResourceScope(IScope globalScope, @SuppressWarnings("unused") Resource res, EReference reference) { IScope result = globalScope; ISelectable globalScopeSelectable = new ScopeBasedSelectable(result); // implicit imports (i.e. java.lang.*) List<ImportNormalizer> normalizers = getImplicitImports(isIgnoreCase(reference)); if (!normalizers.isEmpty()) { result = createImportScope(result, normalizers, globalScopeSelectable, reference.getEReferenceType(), isIgnoreCase(reference)); } return result; }
protected IScope getResourceScope(IScope globalScope, @SuppressWarnings("unused") Resource res, EReference reference) { IScope result = globalScope; ISelectable globalScopeSelectable = new ScopeBasedSelectable(result); // implicit imports (i.e. java.lang.*) List<ImportNormalizer> normalizers = getImplicitImports(isIgnoreCase(reference)); if (!normalizers.isEmpty()) { result = createImportScope(result, normalizers, globalScopeSelectable, reference.getEReferenceType(), isIgnoreCase(reference)); } return result; }
public DiagnosticMessage getUnresolvedProxyMessage(ILinkingDiagnosticContext context) { EClass referenceType = context.getReference().getEReferenceType(); String linkText = ""; try { linkText = context.getLinkText(); } catch (IllegalNodeException e){ linkText = e.getNode().getText(); } String msg = "Couldn't resolve reference to " + referenceType.getName() + " '" + linkText + "'."; return new DiagnosticMessage(msg, Severity.ERROR, Diagnostic.LINKING_DIAGNOSTIC); }
@Override protected IScope getGlobalScope(final Resource context, final EReference reference) { IScope globalScope = super.getGlobalScope(context, reference, null); return SelectableBasedScope.createScope(globalScope, getAllDescriptions(context), reference.getEReferenceType(), isIgnoreCase(reference)); }
@Override protected IScope getGlobalScope(final Resource context, final EReference reference) { IScope globalScope = super.getGlobalScope(context, reference, null); return SelectableBasedScope.createScope(globalScope, getAllDescriptions(context), reference.getEReferenceType(), isIgnoreCase(reference)); }
protected IScope getResourceScope(Resource res, EReference reference) { EObject context = res.getContents().get(0); IScope globalScope = getGlobalScope(res, reference); List<ImportNormalizer> normalizers = getImplicitImports(isIgnoreCase(reference)); if (!normalizers.isEmpty()) { globalScope = createImportScope(globalScope, normalizers, null, reference.getEReferenceType(), isIgnoreCase(reference)); } return getResourceScope(globalScope, context, reference); }
private IInputKey extractColumnDescriptor(final EStructuralFeature feature, int columnIndex) { if (0 == columnIndex) { return new EClassTransitiveInstancesKey(feature.getEContainingClass()); } else { if (feature instanceof EReference) { return new EClassTransitiveInstancesKey(((EReference) feature).getEReferenceType()); } else { return new EDataTypeInSlotsKey(((EAttribute) feature).getEAttributeType()); } } }
protected IScope getResourceScope(final IScope parent, final EObject context, final EReference reference) { // TODO: SZ - context may not be a proxy, may it? if (context.eResource() == null) return parent; ISelectable allDescriptions = getAllDescriptions(context.eResource()); return SelectableBasedScope.createScope(parent, allDescriptions, reference.getEReferenceType(), isIgnoreCase(reference)); }
public IScope getScope(final EObject context, final EReference reference) { ISelectable resourceContent = cache.get(Tuples.pair(SimpleLocalScopeProvider.class.getName(), reference), context.eResource(), new Provider<ISelectable>() { public ISelectable get() { return getAllDescriptions(context.eResource()); } }); IScope globalScope = getGlobalScope(context.eResource(), reference); return createScope(globalScope, resourceContent, reference.getEReferenceType(), isIgnoreCase(reference)); }