use of spoon.support.visitor.java.internal.TypeReferenceRuntimeBuilderContext in project spoon by INRIA.
the class JavaReflectionTreeBuilder method visitTypeParameterReference.
@Override
public <T extends GenericDeclaration> void visitTypeParameterReference(TypeVariable<T> parameter) {
final CtTypeParameterReference typeParameterReference = factory.Core().createTypeParameterReference();
typeParameterReference.setSimpleName(parameter.getName());
enter(new TypeReferenceRuntimeBuilderContext(typeParameterReference));
super.visitTypeParameterReference(parameter);
exit();
contexts.peek().addTypeName(typeParameterReference);
}
use of spoon.support.visitor.java.internal.TypeReferenceRuntimeBuilderContext in project spoon by INRIA.
the class JavaReflectionTreeBuilder method visitArrayReference.
@Override
public <T> void visitArrayReference(final Class<T> typeArray) {
final CtArrayTypeReference<?> arrayTypeReference = factory.Core().createArrayTypeReference();
enter(new TypeReferenceRuntimeBuilderContext(arrayTypeReference) {
@Override
public void addClassReference(CtTypeReference<?> typeReference) {
if (typeArray.getSimpleName().equals(typeReference.getSimpleName())) {
arrayTypeReference.setComponentType(typeReference);
} else {
arrayTypeReference.setDeclaringType(typeReference);
}
}
@Override
public void addArrayReference(CtArrayTypeReference<?> typeReference) {
arrayTypeReference.setComponentType(typeReference);
}
});
super.visitArrayReference(typeArray);
exit();
contexts.peek().addArrayReference(arrayTypeReference);
}
Aggregations