/** * Returns <code>true</code> if it is discouraged to define the given name. * @param name the name that is to-be-defined. * @return <code>true</code> if the name may not be used. */ public boolean isDiscouragedName(QualifiedName name) { return SELF.equals(name); }
@Override public boolean equals(Object obj) { if (this==obj) return true; if (obj==null) return false; if (obj instanceof ImportNormalizer) { ImportNormalizer other = (ImportNormalizer)obj; if (other.hasWildCard!=hasWildCard || other.ignoreCase!=ignoreCase) return false; if (ignoreCase) { return other.importedNamespacePrefix.equalsIgnoreCase(importedNamespacePrefix); } return other.importedNamespacePrefix.equals(importedNamespacePrefix); } return false; }
/** * Returns <code>true</code> if it is legal to shadow a * local with the given name. * @param name the name that is-to-be-defined. * @return <code>true</code> if shadowing is legal. */ public boolean isShadowingAllowed(QualifiedName name) { return IT.equals(name); }
@Override public String toString() { StringBuilder result = new StringBuilder(); result.append(IEObjectDescription.class.getSimpleName() + " " + qualifiedName); if (simpleName != null && !simpleName.equals(qualifiedName)) { result.append(" name:" + simpleName); } if (userData != null && !userData.isEmpty()) { List<String> items = Lists.newArrayList(); for (Entry<String, String> e : userData.entrySet()) { items.add(e.getKey() + ": " + e.getValue()); } result.append(" userData=[" + Joiner.on(", ").join(items) + "]"); } return result.toString(); }
@Override @Pure public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; TypeResourceDescription.ClassDescription other = (TypeResourceDescription.ClassDescription) obj; if (this.qualifiedName == null) { if (other.qualifiedName != null) return false; } else if (!this.qualifiedName.equals(other.qualifiedName)) return false; return true; }
@Override protected List<IEObjectDescription> getLocalElementsByName(QualifiedName name) { if (THIS.equals(name) || SUPER.equals(name)) { IEObjectDescription description = getSession().getLocalElement(name); if (description != null) { EObject objectOrProxy = description.getEObjectOrProxy(); if (objectOrProxy instanceof JvmGenericType && !objectOrProxy.eIsProxy()) { return createConstructorDescriptions(name, (JvmGenericType) objectOrProxy, SUPER.equals(name)); } } } return Collections.emptyList(); }
protected boolean isQualifiedNameEqual(IEObjectDescription desc1, IEObjectDescription desc2) { return desc1.getQualifiedName().equals(desc2.getQualifiedName()); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BuilderStatePackage.EOBJECT_DESCRIPTION__ECLASS: return eClass != null; case BuilderStatePackage.EOBJECT_DESCRIPTION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case BuilderStatePackage.EOBJECT_DESCRIPTION__FRAGMENT: return FRAGMENT_EDEFAULT == null ? fragment != null : !FRAGMENT_EDEFAULT.equals(fragment); case BuilderStatePackage.EOBJECT_DESCRIPTION__USER_DATA: return isSetUserData(); } return super.eIsSet(featureID); }
protected boolean isSimpleNameAndUserdataEqual(IEObjectDescription oldDesc, IEObjectDescription newDesc) { if (!oldDesc.getName().equals(newDesc.getName())) { return false; } if (!isUserDataEqual(oldDesc, newDesc)) { return false; } return true; }
protected boolean matches(Set<EClass> eclasses, IEObjectDescription desc) { boolean valid = eclasses.isEmpty(); for (Iterator<EClass> iterator = eclasses.iterator(); !valid && iterator.hasNext();) { EClass eClass = iterator.next(); valid = valid || EcorePackage.Literals.EOBJECT == eClass || eClass.isSuperTypeOf(desc.getEClass()); } if (name != null) { if (Strings.isEmpty(namespaceDelimiter)) { return valid && name.equals(desc.getName().toString()); } else { QualifiedName qualifiedName = QualifiedName.create(name.split(Pattern.quote(getNamespaceDelimiter()))); return valid && (qualifiedName == null || qualifiedName.equals(desc.getName())); } } return valid; }
public boolean apply(IEObjectDescription input) { return name.equals(input.getName()) && EcoreUtil2.isAssignableFrom(type, input.getEClass()); } };
private boolean isInvalidThisReference(IIdentifiableElementDescription desc) { EObject object = desc.getEObjectOrProxy(); return object instanceof JvmGenericType && ((JvmGenericType) object).isInterface() && IFeatureNames.THIS.equals(desc.getName()); }
public boolean apply(IEObjectDescription input) { return name.equals(input.getName()) && EcoreUtil2.isAssignableFrom(type, input.getEClass()); } };
protected IScope createDynamicExtensionsScope(QualifiedName implicitFirstArgumentName, IEObjectDescription firstArgumentDescription, EObject featureCall, IFeatureScopeSession captureLayer, IFeatureScopeSession session, IResolvedTypes resolvedTypes, IScope parent) { JvmIdentifiableElement feature = (JvmIdentifiableElement) firstArgumentDescription.getEObjectOrProxy(); if (feature instanceof JvmType && THIS.equals(implicitFirstArgumentName) && !session.isInstanceContext()) { return parent; } LightweightTypeReference type = resolvedTypes.getActualType(feature); if (type != null && !type.isUnknown()) { XFeatureCall implicitArgument = xbaseFactory.createXFeatureCall(); implicitArgument.setFeature(feature); return createDynamicExtensionsScope(featureCall, implicitArgument, type, true, parent, captureLayer); } return parent; }
protected IScope createImplicitFeatureCallScope(QualifiedName implicitName, EObject featureCall, IFeatureScopeSession session, IResolvedTypes resolvedTypes, IScope parent) { IEObjectDescription thisDescription = session.getLocalElement(implicitName); if (thisDescription != null) { JvmIdentifiableElement thisElement = (JvmIdentifiableElement) thisDescription.getEObjectOrProxy(); boolean validStaticScope = true; if (thisElement instanceof JvmType && THIS.equals(implicitName) && !session.isInstanceContext()) { validStaticScope = false; } LightweightTypeReference type = resolvedTypes.getActualType(thisElement); if (type !=null && !type.isUnknown()) { XFeatureCall implicitReceiver = xbaseFactory.createXFeatureCall(); implicitReceiver.setFeature(thisElement); return createFeatureScopeForTypeRef(implicitReceiver, type, true, featureCall, session, thisElement, parent, validStaticScope); } } return parent; }