super(adapters);
}
@Override
public InterfaceDeclaration adapt(InterfaceDeclarationContext context) {
InterfaceDeclaration interfaceDeclaration = createNode(context);
TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
if (identifierNode != null) {
interfaceDeclaration.setName(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
}
TypeParametersContext typeParametersContext = getChild(context, TypeParametersContext.class);
if (typeParametersContext != null) {
interfaceDeclaration.setTypeParameters(
getAdapter(TypeParametersAdapter.class).adapt(typeParametersContext));
}
TypeListContext typeListContext = getChild(context, TypeListContext.class);
if (typeListContext != null) {
interfaceDeclaration.setExtendsTypes(
getAdapter(TypeListAdapter.class).adapt(typeListContext));
}
InterfaceBodyContext interfaceBodyContext = getChild(context, InterfaceBodyContext.class);
if (interfaceBodyContext != null) {
List<InterfaceMemberDeclaration> memberDeclarations =
transform(interfaceBodyContext, InterfaceBodyDeclarationContext.class,
new Function<InterfaceBodyDeclarationContext, InterfaceMemberDeclaration>() {
@Override
public InterfaceMemberDeclaration apply(InterfaceBodyDeclarationContext context) {
return getAdapter(InterfaceBodyDeclarationAdapter.class).adapt(context);
}
});
interfaceDeclaration.setMemberDeclarations(memberDeclarations);
}
return interfaceDeclaration;
}