All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webpieces.plugins.json.JacksonRoutes Maven / Gradle / Ivy

Go to download

Someone forgot to fill this in. See http://stackoverflow.com/questions/38272550/how-to-fail-the-gradle-build-if-subproject-is-missing-a-property

There is a newer version: 1.9.95
Show newest version
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 filter;

	public JacksonRoutes(String filterPattern, 
			Class 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