@Test public void testGetQualifiedName() { JavaParserInterfaceDeclaration nodeWithAnnotations = (JavaParserInterfaceDeclaration) typeSolver.solveType("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations"); assertEquals("com.github.javaparser.ast.nodeTypes.NodeWithAnnotations", nodeWithAnnotations.getQualifiedName()); }
@Override public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other) { // TODO consider generic types if (this.getQualifiedName().equals(other.getQualifiedName())) { return true; } if (this.wrappedNode.getExtendedTypes() != null) { for (ClassOrInterfaceType type : wrappedNode.getExtendedTypes()) { ResolvedReferenceTypeDeclaration ancestor = (ResolvedReferenceTypeDeclaration) new SymbolSolver(typeSolver).solveType(type); if (ancestor.canBeAssignedTo(other)) { return true; } } } if (this.wrappedNode.getImplementedTypes() != null) { for (ClassOrInterfaceType type : wrappedNode.getImplementedTypes()) { ResolvedReferenceTypeDeclaration ancestor = (ResolvedReferenceTypeDeclaration) new SymbolSolver(typeSolver).solveType(type); if (ancestor.canBeAssignedTo(other)) { return true; } } } return false; }
@Override public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other) { // TODO consider generic types if (this.getQualifiedName().equals(other.getQualifiedName())) { return true; } if (this.wrappedNode.getExtendedTypes() != null) { for (ClassOrInterfaceType type : wrappedNode.getExtendedTypes()) { ResolvedReferenceTypeDeclaration ancestor = (ResolvedReferenceTypeDeclaration) new SymbolSolver(typeSolver).solveType(type); if (ancestor.canBeAssignedTo(other)) { return true; } } } if (this.wrappedNode.getImplementedTypes() != null) { for (ClassOrInterfaceType type : wrappedNode.getImplementedTypes()) { ResolvedReferenceTypeDeclaration ancestor = (ResolvedReferenceTypeDeclaration) new SymbolSolver(typeSolver).solveType(type); if (ancestor.canBeAssignedTo(other)) { return true; } } } return false; }
@Override public boolean canBeAssignedTo(ResolvedReferenceTypeDeclaration other) { // TODO consider generic types if (this.getQualifiedName().equals(other.getQualifiedName())) { return true; } if (this.wrappedNode.getExtendedTypes() != null) { for (ClassOrInterfaceType type : wrappedNode.getExtendedTypes()) { ResolvedReferenceTypeDeclaration ancestor = (ResolvedReferenceTypeDeclaration) new SymbolSolver(typeSolver).solveType(type); if (ancestor.canBeAssignedTo(other)) { return true; } } } if (this.wrappedNode.getImplementedTypes() != null) { for (ClassOrInterfaceType type : wrappedNode.getImplementedTypes()) { ResolvedReferenceTypeDeclaration ancestor = (ResolvedReferenceTypeDeclaration) new SymbolSolver(typeSolver).solveType(type); if (ancestor.canBeAssignedTo(other)) { return true; } } } return false; }