@Override public boolean contains(Object o) { if (o instanceof IEObjectDescription) { return super.contains(((IEObjectDescription) o).getName()); } return super.contains(o); } };
public String getName(final IEObjectDescription description) { QualifiedName _name = null; if (description!=null) { _name=description.getName(); } return this.getName(_name); }
@Override protected boolean isShadowed(IEObjectDescription fromParent) { if (fromParent.getName() == null) return true; return super.isShadowed(fromParent); }
public void setExportedObjects(Iterable<IEObjectDescription> allDescriptions) { this.allDescriptions = Lists.newArrayList(); this.nameToObjects = LinkedHashMultimap.create(); for(IEObjectDescription description: allDescriptions) { this.allDescriptions.add(description); nameToObjects.put(description.getName().toLowerCase(), description); } }
protected void putIntoMap(Map<QualifiedName, List<IEObjectDescription>> nameToObjects, IEObjectDescription description) { QualifiedName indexKey = description.getName().toLowerCase(); List<IEObjectDescription> values = nameToObjects.get(indexKey); if (values == null) { values = Lists.newArrayListWithExpectedSize(2); nameToObjects.put(indexKey, values); } values.add(description); }
@Override protected ConstructorDescription createConstructorDescription(IEObjectDescription typeDescription, JvmConstructor constructor, boolean visible) { return createAnonmousClassConstructorDescription(typeDescription.getName(), constructor, visible); } };
/** * @since 2.3 */ public static IScope createScope(IScope parent, Collection<IEObjectDescription> descriptions) { if (descriptions.size() == 1) { IEObjectDescription description = Iterables.getOnlyElement(descriptions); return new MapBasedScope(parent, Collections.singletonMap(description.getName(), description), false); } else if (descriptions.isEmpty()) { return parent; } return createScope(parent, descriptions, false); }
@Override protected boolean isShadowed(IEObjectDescription fromParent) { QualifiedName name = fromParent.getName(); if (isIgnoreCase()) { name = name.toLowerCase(); } boolean result = elements.containsKey(name); return result; }
protected void addExportedNames(Set<QualifiedName> names, IResourceDescription resourceDescriptor) { if (resourceDescriptor==null) return; Iterable<IEObjectDescription> iterable = resourceDescriptor.getExportedObjects(); for (IEObjectDescription ieObjectDescription : iterable) { names.add(ieObjectDescription.getName().toLowerCase()); } }
protected boolean isAffected(Collection<QualifiedName> importedNames, IResourceDescription description) { if (description != null) { for (IEObjectDescription desc : description.getExportedObjects()) if (importedNames.contains(desc.getName().toLowerCase())) return true; } return false; }
protected String getShadowingKey(IEObjectDescription description) { if (description instanceof BucketedEObjectDescription) { return ((BucketedEObjectDescription) description).getShadowingKey(); } return description.getName().toString(); }
protected String getSignature(IEObjectDescription desc) { if (desc instanceof IIdentifiableElementDescription) { return getSignature((IIdentifiableElementDescription) desc); } return desc.getName().toString(); }
protected String getShadowingKey(IEObjectDescription description) { if (description instanceof BucketedEObjectDescription) { return ((BucketedEObjectDescription) description).getShadowingKey(); } return description.getName().toString(); }
protected String getUnconvertedLinkText(EObject object, EReference reference, EObject context) { IScope scope = scopeProvider.getScope(context, reference); if (scope == null) return null; IEObjectDescription eObjectDescription = scope.getSingleElement(object); if (eObjectDescription != null) { return qualifiedNameConverter.toString(eObjectDescription.getName()); } return null; }
public Map<String, JvmIdentifiableElement> collectMandatoryFeatures(Component component) { Map<String, JvmIdentifiableElement> result = Maps.newHashMap(); IScope scope = scopeProvider.createComponentFeaturesScope(component); for(IEObjectDescription description: scope.getAllElements()) { JvmIdentifiableElement jvmFeature = (JvmIdentifiableElement) description.getEObjectOrProxy(); if (isMandatory(jvmFeature)) { result.put(qualifiedNameConverter.toString(description.getName()), jvmFeature); } } return result; }
public String getJavaFileName(IEObjectDescription description) { if (!isJvmDeclaredType(description)) { return null; } QualifiedName typeName = description.getName(); return Strings.concat("/", typeName.getSegments()) + ".java"; }
public boolean apply(IEObjectDescription input) { IEObjectDescription description = getSingleLocalElementByName(input.getName()); if (description==null) return false; if (description.getEObjectOrProxy()==input.getEObjectOrProxy()) return true; if (input.getEObjectURI().equals(description.getEObjectURI())) return true; return false; } });