super(adapters);
}
@Override
public VariableDeclaration adapt(VariableDeclaratorContext context) {
VariableDeclaration variableDeclarator = createNode(context);
VariableDeclaratorIdContext variableDeclaratorIdContext =
getChild(context, VariableDeclaratorIdContext.class);
if (variableDeclaratorIdContext != null) {
TerminalNode identifierNode =
getTerminalNode(variableDeclaratorIdContext, JavaParser.Identifier);
if (identifierNode != null) {
variableDeclarator.setName(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
}
variableDeclarator.setDimensions(
getAdapter(ArrayDimensionsAdapter.class).adapt(variableDeclaratorIdContext));
}
VariableInitializerContext variableInitializerContext =
getChild(context, VariableInitializerContext.class);
if (variableInitializerContext != null) {
variableDeclarator.setInitializer(
getAdapter(VariableInitializerAdapter.class).adapt(variableInitializerContext));
}
return variableDeclarator;
}