io.github.yamlpath.processor.WildcardPartPathProcessor Maven / Gradle / Ivy
package io.github.yamlpath.processor;
import static io.github.yamlpath.utils.PathUtils.INDEX_CLOSE;
import static io.github.yamlpath.utils.PathUtils.INDEX_OPEN;
import static io.github.yamlpath.utils.PathUtils.WILDCARD;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import io.github.yamlpath.WorkUnit;
import io.github.yamlpath.setters.ListAtPositionSetter;
import io.github.yamlpath.setters.ListSetter;
import io.github.yamlpath.setters.MapAtKeySetter;
import io.github.yamlpath.setters.MapSetter;
import io.github.yamlpath.setters.MultipleSetter;
public class WildcardPartPathProcessor implements PathProcessor {
@Override
public boolean canHandle(WorkUnit.Path path) {
return path.getPart().startsWith(WILDCARD);
}
@Override
public Object handle(WorkUnit workUnit, WorkUnit.Path path) {
MultipleSetter setter = new MultipleSetter();
// if we found a wildcard means that we will find the current part at any position
WorkUnit.Path effectivePath = workUnit.nextPath();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy