fullTypeParameters.addAll(typeParameterNames);
final List<TypeParameter> params = constructorDeclaration
.getTypeParameters();
if (params != null) {
for (final TypeParameter candidate : params) {
final JavaSymbolName currentTypeParam = new JavaSymbolName(
candidate.getName());
fullTypeParameters.add(currentTypeParam);
}
}
// Get the body
body = constructorDeclaration.getBlock().toString();
body = StringUtils.replace(body, "{", "", 1);
body = body.substring(0, body.lastIndexOf("}"));
// Lookup the parameters and their names
if (constructorDeclaration.getParameters() != null) {
for (final Parameter p : constructorDeclaration.getParameters()) {
final Type pt = p.getType();
final JavaType parameterType = JavaParserUtils.getJavaType(
compilationUnitServices, pt, fullTypeParameters);
final List<AnnotationExpr> annotationsList = p.getAnnotations();
final List<AnnotationMetadata> annotations = new ArrayList<AnnotationMetadata>();
if (annotationsList != null) {
for (final AnnotationExpr candidate : annotationsList) {
final JavaParserAnnotationMetadataBuilder md = JavaParserAnnotationMetadataBuilder
.getInstance(candidate, compilationUnitServices);
annotations.add(md.build());
}
}
parameterTypes.add(new AnnotatedJavaType(parameterType,
annotations));
parameterNames.add(new JavaSymbolName(p.getId().getName()));
}
}
if (constructorDeclaration.getAnnotations() != null) {
for (final AnnotationExpr annotation : constructorDeclaration