@Override public Iterable<ObjectType> getCtorImplementedInterfaces() { return getConstructor().getImplementedInterfaces(); }
@Override public Iterable<ObjectType> getCtorImplementedInterfaces() { return getConstructor().getImplementedInterfaces(); }
/** * Returns all interfaces implemented by a class or its superclass and any * superclasses for any of those interfaces. If this is called before all * types are resolved, it may return an incomplete set. */ public Iterable<ObjectType> getAllImplementedInterfaces() { // Store them in a linked hash set, so that the compile job is // deterministic. Set<ObjectType> interfaces = new LinkedHashSet<ObjectType>(); for (ObjectType type : getImplementedInterfaces()) { addRelatedInterfaces(type, interfaces); } return interfaces; }
/** * Returns all interfaces implemented by a class or its superclass and any superclasses for any of * those interfaces. If this is called before all types are resolved, it may return an incomplete * set. */ public final Iterable<ObjectType> getAllImplementedInterfaces() { // Store them in a linked hash set, so that the compile job is // deterministic. Set<ObjectType> interfaces = new LinkedHashSet<>(); for (ObjectType type : getImplementedInterfaces()) { addRelatedInterfaces(type, interfaces); } return interfaces; }
public final Collection<ObjectType> getAncestorInterfaces() { Set<ObjectType> result = new HashSet<>(); if (isConstructor()) { result.addAll((Collection<? extends ObjectType>) getImplementedInterfaces()); } else { result.addAll((Collection<? extends ObjectType>) getExtendedInterfaces()); } return result; }
@Override public Iterable<ObjectType> getCtorImplementedInterfaces() { return isFunctionPrototypeType() ? getOwnerFunction().getImplementedInterfaces() : ImmutableList.<ObjectType>of(); }
@Override public Iterable<ObjectType> getCtorImplementedInterfaces() { return isFunctionPrototypeType() ? getOwnerFunction().getImplementedInterfaces() : ImmutableList.<ObjectType>of(); }
/** * Records that this property could be referenced from any interface that * this type, or any type in its superclass chain, implements. * * If the property p is defined only on a subtype of constructor, then this * method has no effect. But we tried modifying getTypeWithProperty to tell us * when the returned type is a subtype, and then skip those calls to * recordInterface, and there was no speed-up. * And it made the code harder to understand, so we don't do it. */ private void recordInterfaces(FunctionType constructor, JSType relatedType, DisambiguateProperties.Property p) { Preconditions.checkArgument(constructor.isConstructor()); Iterable<ObjectType> interfaces = implementedInterfaces.get(constructor); if (interfaces == null) { interfaces = constructor.getImplementedInterfaces(); implementedInterfaces.put(constructor, interfaces); } for (ObjectType itype : interfaces) { JSType top = getTypeWithProperty(p.name, itype); if (top != null) { p.addType(itype, relatedType); } // If this interface invalidated this property, return now. if (p.skipRenaming) { return; } } }
/** * When a class has a stub for a property, and the property exists on a super interface, * use that type. */ private JSType getInheritedInterfacePropertyType(ObjectType obj, String propName) { if (obj != null && obj.isFunctionPrototypeType()) { FunctionType f = obj.getOwnerFunction(); for (ObjectType i : f.getImplementedInterfaces()) { if (i.hasProperty(propName)) { return i.getPropertyType(propName); } } } return null; }
for (ObjectType interfaze : funType.getImplementedInterfaces()) { interfaces.add(interfaze.toAnnotationString());
/** * @param constructor A constructor function defined by a call, which may be a mixin application. * The constructor implements at least one interface. If the constructor is missing some * properties of the inherited interfaces, this method declares these properties. */ private static void addMissingInterfaceProperties(JSType constructor) { if (constructor != null && constructor.isConstructor()) { FunctionType f = constructor.toMaybeFunctionType(); ObjectType proto = f.getPrototype(); for (ObjectType interf : f.getImplementedInterfaces()) { for (String pname : interf.getPropertyNames()) { if (!proto.hasProperty(pname)) { proto.defineDeclaredProperty(pname, interf.getPropertyType(pname), null); } } } } }
} else { for (JSType baseInterface : functionType.getImplementedInterfaces()) { boolean badImplementedType = false; ObjectType baseInterfaceObj = ObjectType.cast(baseInterface);
for (JSType baseInterface : functionType.getImplementedInterfaces()) { boolean badImplementedType = false; ObjectType baseInterfaceObj = ObjectType.cast(baseInterface);