super(adapters);
}
@Override
public TypeParameter adapt(TypeParameterContext context) {
TypeParameter typeParameter = createNode(context);
TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
if (identifierNode != null) {
typeParameter.setName(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
}
TypeBoundContext typeBoundContext = getChild(context, TypeBoundContext.class);
if (typeBoundContext != null) {
List<Type> extendsTypes =
transform(typeBoundContext, TypeContext.class, new Function<TypeContext, Type>() {
@Override
public Type apply(TypeContext context) {
return getAdapter(TypeAdapter.class).adapt(context);
}
});
typeParameter.setExtendsTypes(extendsTypes);
}
return typeParameter;
}