![JAR search and dependency download from the Maven repository](/logo.png)
org.elasticsearch.script.mustache.CustomReflectionObjectHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lang-mustache-client Show documentation
Show all versions of lang-mustache-client Show documentation
Mustache scripting integration for Elasticsearch
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
package org.elasticsearch.script.mustache;
import com.github.mustachejava.reflect.ReflectionObjectHandler;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.iterable.Iterables;
import java.lang.reflect.Array;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
final class CustomReflectionObjectHandler extends ReflectionObjectHandler {
@Override
public Object coerce(Object object) {
if (object == null) {
return null;
}
if (object.getClass().isArray()) {
return new ArrayMap(object);
} else if (object instanceof Collection) {
@SuppressWarnings("unchecked")
Collection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy