protected List<JvmType> getRawTypesFromConstraints(List<JvmTypeConstraint> constraints, Resource resource) { if (!constraints.isEmpty()) { List<JvmType> result = Lists.newArrayList(); for(JvmTypeConstraint constraint: constraints) { if (constraint instanceof JvmUpperBound) { result.addAll(visit(constraint.getTypeReference(), resource)); } } if (!result.isEmpty()) return result; } return createObjectReference(resource); }
@Override public List<JvmType> doVisitParameterizedTypeReference(JvmParameterizedTypeReference reference, Resource resource) { JvmType type = reference.getType(); if (type != null && !type.eIsProxy()) { if (type instanceof JvmTypeParameter) { return getRawTypesFromConstraints(((JvmTypeParameter) type).getConstraints(), resource); } return Collections.singletonList(type); } return Collections.emptyList(); }
@Override public List<JvmType> doVisitGenericArrayTypeReference(JvmGenericArrayTypeReference reference, Resource resource) { JvmTypeReference componentType = reference.getComponentType(); List<JvmType> rawComponentTypes = visit(componentType, resource); List<JvmType> result = Lists.newArrayListWithCapacity(rawComponentTypes.size()); for (JvmType rawComponentType : rawComponentTypes) { if (!rawComponentType.eIsProxy() && rawComponentType instanceof JvmComponentType) { JvmArrayType arrayType = ((JvmComponentType) rawComponentType).getArrayType(); result.add(arrayType); } } return result; }
public List<JvmType> getAllRawTypes(JvmTypeReference reference, Resource resource) { List<JvmType> result = typeImplementation.getAllRawTypes(reference, resource); return result; }
@Override public List<JvmType> doVisitWildcardTypeReference(JvmWildcardTypeReference reference, Resource resource) { return getRawTypesFromConstraints(reference.getConstraints(), resource); }
public List<JvmType> getAllRawTypes(JvmTypeReference reference, Resource resource) { List<JvmType> result = visit(reference, resource); return result; }
@Override public List<JvmType> doVisitCompoundTypeReference(JvmCompoundTypeReference reference, Resource resource) { List<JvmTypeReference> references = reference.getReferences(); if (references.isEmpty()) return Collections.emptyList(); List<JvmType> result = Lists.newArrayList(); for (JvmTypeReference contained : references) { result.addAll(visit(contained, resource)); } return result; }
@Override public List<JvmType> getAllRawTypes(JvmTypeReference reference, Resource resource) { List<JvmType> result = typeImplementation.getAllRawTypes(reference, resource); return result; }
public List<JvmType> getAllRawTypes(JvmTypeReference reference, Resource resource) { List<JvmType> result = visit(reference, resource); return result; }
@Override public List<JvmType> doVisitWildcardTypeReference(JvmWildcardTypeReference reference, Resource resource) { return getRawTypesFromConstraints(reference.getConstraints(), resource); }
@Override public List<JvmType> doVisitCompoundTypeReference(JvmCompoundTypeReference reference, Resource resource) { List<JvmTypeReference> references = reference.getReferences(); if (references.isEmpty()) return Collections.emptyList(); List<JvmType> result = Lists.newArrayList(); for(JvmTypeReference contained: references) { result.addAll(visit(contained, resource)); } return result; }
protected List<JvmType> getRawTypesFromConstraints(List<JvmTypeConstraint> constraints, Resource resource) { if (!constraints.isEmpty()) { List<JvmType> result = Lists.newArrayList(); for (JvmTypeConstraint constraint : constraints) { if (constraint instanceof JvmUpperBound) { result.addAll(visit(constraint.getTypeReference(), resource)); } } if (!result.isEmpty()) return result; } return createObjectReference(resource); }
@Override public List<JvmType> doVisitParameterizedTypeReference(JvmParameterizedTypeReference reference, Resource resource) { JvmType type = reference.getType(); if (type != null && !type.eIsProxy()) { if (type instanceof JvmTypeParameter) { return getRawTypesFromConstraints(((JvmTypeParameter) type).getConstraints(), resource); } return Collections.singletonList(type); } return Collections.emptyList(); }
@Override public List<JvmType> doVisitGenericArrayTypeReference(JvmGenericArrayTypeReference reference, Resource resource) { JvmTypeReference componentType = reference.getComponentType(); List<JvmType> rawComponentTypes = visit(componentType, resource); List<JvmType> result = Lists.newArrayListWithCapacity(rawComponentTypes.size()); for(JvmType rawComponentType: rawComponentTypes) { if (!rawComponentType.eIsProxy() && rawComponentType instanceof JvmComponentType) { JvmArrayType arrayType = ((JvmComponentType) rawComponentType).getArrayType(); result.add(arrayType); } } return result; }