super(adapters);
}
@Override
public PackageDeclaration adapt(PackageDeclarationContext context) {
PackageDeclaration packageDeclaration = 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);
}
});
packageDeclaration.setAnnotations(annotations);
QualifiedNameContext qualifiedNameContext = getChild(context, QualifiedNameContext.class);
if (qualifiedNameContext != null) {
packageDeclaration.setQualifiedName(
getAdapter(QualifiedNameAdapter.class).adapt(qualifiedNameContext));
}
return packageDeclaration;
}