org.webpieces.plugins.json.JacksonRoutes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-jackson-plugin Show documentation
Show all versions of json-jackson-plugin Show documentation
Someone forgot to fill this in. See http://stackoverflow.com/questions/38272550/how-to-fail-the-gradle-build-if-subproject-is-missing-a-property
package org.webpieces.plugins.json;
import java.util.regex.Pattern;
import org.webpieces.router.api.routing.AbstractRoutes;
import org.webpieces.router.api.routing.PortType;
public class JacksonRoutes extends AbstractRoutes {
private String filterPattern;
private Class extends JacksonCatchAllFilter> filter;
public JacksonRoutes(String filterPattern,
Class extends JacksonCatchAllFilter> filter) {
this.filterPattern = filterPattern;
this.filter = filter;
}
@Override
protected void configure() {
Pattern pattern = Pattern.compile(filterPattern);
addFilter(filterPattern, filter, new JsonConfig(pattern, false), PortType.ALL_FILTER);
addNotFoundFilter(filter, new JsonConfig(pattern, true), PortType.ALL_FILTER);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy