How to use the ElasticSearch Java API to build an Aggregation from JSON

Because the aggregations in our system are dynamic and I don't want to parse them.