protected List<IResolvedOperation> computeDeclaredOperations() { JvmType rawType = getRawType(); if (!(rawType instanceof JvmDeclaredType)) { return Collections.emptyList(); } List<IResolvedOperation> result = Lists.newArrayList(); Iterable<JvmOperation> operations = ((JvmDeclaredType)rawType).getDeclaredOperations(); for(JvmOperation operation: operations) { BottomResolvedOperation resolvedOperation = createResolvedOperation(operation); result.add(resolvedOperation); } return Collections.unmodifiableList(result); }
protected List<IResolvedConstructor> computeDeclaredConstructors() { JvmType rawType = getRawType(); if (!(rawType instanceof JvmGenericType)) { return Collections.emptyList(); } List<IResolvedConstructor> result = Lists.newArrayList(); for(JvmConstructor constructor: ((JvmGenericType)rawType).getDeclaredConstructors()) { result.add(new ResolvedConstructor(constructor, getType())); } return Collections.unmodifiableList(result); }
protected List<IResolvedField> computeDeclaredFields() { JvmType rawType = getRawType(); if (!(rawType instanceof JvmGenericType)) { return Collections.emptyList(); } List<IResolvedField> result = Lists.newArrayList(); for(JvmField field: ((JvmGenericType)rawType).getDeclaredFields()) { result.add(new ResolvedField(field, getType())); } return Collections.unmodifiableList(result); }
protected List<IResolvedOperation> computeAllOperations() { JvmType rawType = getRawType(); if (!(rawType instanceof JvmDeclaredType)) { return Collections.emptyList(); } Multimap<String, AbstractResolvedOperation> processedOperations = LinkedHashMultimap.create(); for (IResolvedOperation resolvedOperation : getDeclaredOperations()) { processedOperations.put(resolvedOperation.getDeclaration().getSimpleName(), (AbstractResolvedOperation) resolvedOperation); } if (targetVersion.isAtLeast(JavaVersion.JAVA8)) { computeAllOperationsFromSortedSuperTypes((JvmDeclaredType) rawType, processedOperations); } else { Set<JvmType> processedTypes = Sets.newHashSet(rawType); computeAllOperationsFromSuperTypes((JvmDeclaredType) rawType, processedOperations, processedTypes); } // make sure the declared operations are the first in the list List<IResolvedOperation> result = new ArrayList<IResolvedOperation>(processedOperations.size()); result.addAll(getDeclaredOperations()); for (AbstractResolvedOperation operation : processedOperations.values()) { if (operation.getDeclaration().getDeclaringType() != rawType) { result.add(operation); } } return Collections.unmodifiableList(result); }