super(adapters);
}
@Override
public ConstructorDeclaration adapt(ConstructorDeclarationContext context) {
ConstructorDeclaration constructorDeclaration = createNode(context);
TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
if (identifierNode != null) {
constructorDeclaration.setName(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
}
FormalParametersContext formalParametersContext =
getChild(context, FormalParametersContext.class);
if (formalParametersContext != null) {
constructorDeclaration.setFormalParameters(
getAdapter(FormalParametersAdapter.class).adapt(formalParametersContext));
}
QualifiedNameListContext qualifiedNameListContext =
getChild(context, QualifiedNameListContext.class);
if (qualifiedNameListContext != null) {
constructorDeclaration.setThrowsExceptions(
getAdapter(QualifiedNamesAdapter.class).adapt(qualifiedNameListContext));
}
ConstructorBodyContext constructorBodyContext = getChild(context, ConstructorBodyContext.class);
if (constructorBodyContext != null) {
BlockContext blockContext = getChild(constructorBodyContext, BlockContext.class);
if (blockContext != null) {
constructorDeclaration.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
}
}
return constructorDeclaration;
}