super(adapters);
}
@Override
public EnumConstant adapt(EnumConstantContext context) {
EnumConstant enumConstant = createNode(context);
List<Annotation> annotations =
transform(context, AnnotationContext.class, new Function<AnnotationContext, Annotation>() {
@Override
public Annotation apply(AnnotationContext context) {
return getAdapter(AnnotationAdapter.class).adapt(context);
}
});
enumConstant.setAnnotations(annotations);
TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
if (identifierNode != null) {
enumConstant.setName(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
}
ArgumentsContext argumentsContext = getChild(context, ArgumentsContext.class);
if (argumentsContext != null) {
enumConstant.setArguments(getAdapter(ArgumentsAdapter.class).adapt(argumentsContext));
}
ClassBodyContext classBodyContext = getChild(context, ClassBodyContext.class);
if (classBodyContext != null) {
enumConstant.setMemberDeclarations(
getAdapter(ClassBodyAdapter.class).adapt(classBodyContext));
}
return enumConstant;
}