/** * Find the packages we depend on, where we implement an interface that is a * Provider Type. These packages, when we import them, must use the provider * policy. * * @throws Exception */ Set<PackageRef> findProvidedPackages() throws Exception { Set<PackageRef> providers = Create.set(); Set<TypeRef> cached = Create.set(); for (Clazz c : classspace.values()) { TypeRef[] interfaces = c.getInterfaces(); if (interfaces != null) for (TypeRef t : interfaces) if (cached.contains(t) || isProvider(t)) { cached.add(t); providers.add(t.getPackageRef()); } } return providers; }
/** * Find the packages we depend on, where we implement an interface that is a * Provider Type. These packages, when we import them, must use the provider * policy. * * @throws Exception */ Set<PackageRef> findProvidedPackages() throws Exception { Set<PackageRef> providers = Create.set(); Set<TypeRef> cached = Create.set(); for (Clazz c : classspace.values()) { TypeRef[] interfaces = c.getInterfaces(); if (interfaces != null) for (TypeRef t : interfaces) if (cached.contains(t) || isProvider(t)) { cached.add(t); providers.add(t.getPackageRef()); } } return providers; }
private void handleInheritedClasses(Clazz child) throws Exception { TypeRef[] ifaces = child.getInterfaces(); if (ifaces != null) { for (TypeRef ref : ifaces) { parseAndMergeInheritedMetadata(ref, child); } } TypeRef superClazz = child.getSuper(); if (superClazz != null) { parseAndMergeInheritedMetadata(superClazz, child); } }
/** * Find the packages we depend on, where we implement an interface that is a * Provider Type. These packages, when we import them, must use the provider * policy. * * @throws Exception */ Set<PackageRef> findProvidedPackages() throws Exception { Set<PackageRef> providers = Create.set(); Set<TypeRef> cached = Create.set(); for (Clazz c : classspace.values()) { TypeRef[] interfaces = c.getInterfaces(); if (interfaces != null) for (TypeRef t : interfaces) if (cached.contains(t) || isProvider(t)) { cached.add(t); providers.add(t.getPackageRef()); } } return providers; }
private void handleInheritedClasses(Clazz child) throws Exception { TypeRef[] ifaces = child.getInterfaces(); if (ifaces != null) { for (TypeRef ref : ifaces) { parseAndMergeInheritedMetadata(ref, child); } } TypeRef superClazz = child.getSuper(); if (superClazz != null) { parseAndMergeInheritedMetadata(superClazz, child); } }
private void handleInheritedClasses(Clazz child) throws Exception { TypeRef[] ifaces = child.getInterfaces(); if (ifaces != null) { for (TypeRef ref : ifaces) { parseAndMergeInheritedMetadata(ref, child); } } TypeRef superClazz = child.getSuper(); if (superClazz != null) { parseAndMergeInheritedMetadata(superClazz, child); } }
private void handleInheritedClasses(Clazz child) throws Exception { TypeRef[] ifaces = child.getInterfaces(); if (ifaces != null) { for (TypeRef ref : ifaces) { parseAndMergeInheritedMetadata(ref, child); } } TypeRef superClazz = child.getSuper(); if (superClazz != null) { parseAndMergeInheritedMetadata(superClazz, child); } }
private boolean identifiableCollection(TypeRef type, boolean intface, boolean topLevel) { try { Clazz clazz = analyzer.findClass(type); if (clazz != null && (!topLevel || !clazz.isAbstract()) && ((intface && clazz.isInterface()) ^ clazz.hasPublicNoArgsConstructor())) { TypeRef[] intfs = clazz.getInterfaces(); if (intfs != null) { for (TypeRef intf : intfs) { if (COLLECTION.matcher(intf.getFQN()) .matches() || identifiableCollection(intf, true, false)) { return true; } } } TypeRef ext = clazz.getSuper(); return ext != null && identifiableCollection(ext, false, false); } } catch (Exception e) { return false; } return false; }
private boolean identifiableCollection(TypeRef type, boolean intface, boolean topLevel) { try { Clazz clazz = analyzer.findClass(type); if (clazz != null && (!topLevel || !clazz.isAbstract()) && ((intface && clazz.isInterface()) ^ clazz.hasPublicNoArgsConstructor())) { TypeRef[] intfs = clazz.getInterfaces(); if (intfs != null) { for (TypeRef intf : intfs) { if (COLLECTION.matcher(intf.getFQN()) .matches() || identifiableCollection(intf, true, false)) { return true; } } } TypeRef ext = clazz.getSuper(); return ext != null && identifiableCollection(ext, false, false); } } catch (Exception e) { return false; } return false; }
getCovariantReturns(set, clazz.getSuper()); TypeRef[] interfaces = clazz.getInterfaces(); if (interfaces != null) for (TypeRef intf : interfaces) {
TypeRef[] intfs = annoServiceClazz.getInterfaces(); if (intfs != null) { for (TypeRef intf : intfs) {
private void parseExtends(Clazz clazz) { TypeRef[] inherits = clazz.getInterfaces(); if (inherits != null) { for (TypeRef typeRef : inherits) { if (!typeRef.isJava() && analyzed.add(typeRef)) { try { Clazz inherit = analyzer.findClass(typeRef); if (inherit != null) { inherit.parseClassFileWithCollector(new OCDDataCollector(ocd)); parseExtends(inherit); } else { analyzer.error("Could not obtain super class %s of class %s", typeRef.getFQN(), clazz.getClassName() .getFQN()); } } catch (Exception e) { analyzer.exception(e, "Could not obtain super class %s of class %s; exception %s", typeRef.getFQN(), clazz.getClassName() .getFQN(), e); } } } } }
TypeRef[] intfs = annoServiceClazz.getInterfaces(); if (intfs != null) { for (TypeRef intf : intfs) {
private void parseExtends(Clazz clazz) { TypeRef[] inherits = clazz.getInterfaces(); if (inherits != null) { for (TypeRef typeRef : inherits) { if (!typeRef.isJava() && analyzed.add(typeRef)) { try { Clazz inherit = analyzer.findClass(typeRef); if (inherit != null) { inherit.parseClassFileWithCollector(new OCDDataCollector(ocd)); parseExtends(inherit); } else { analyzer.error("Could not obtain super class %s of class %s", typeRef.getFQN(), clazz.getClassName() .getFQN()); } } catch (Exception e) { analyzer.exception(e, "Could not obtain super class %s of class %s; exception %s", typeRef.getFQN(), clazz.getClassName() .getFQN(), e); } } } } }