jfilter

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

The MIT License (MIT)
GroupId

GroupId

com.github.jackpanz
ArtifactId

ArtifactId

jfilter
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

jfilter
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Source Code Management

Source Code Management

https://github.com/jackpanz/jfilter

Download jfilter

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jackpanz/jfilter/ -->
<dependency>
    <groupId>com.github.jackpanz</groupId>
    <artifactId>jfilter</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jackpanz/jfilter/
implementation 'com.github.jackpanz:jfilter:1.0.1'
// https://jarcasting.com/artifacts/com.github.jackpanz/jfilter/
implementation ("com.github.jackpanz:jfilter:1.0.1")
'com.github.jackpanz:jfilter:jar:1.0.1'
<dependency org="com.github.jackpanz" name="jfilter" rev="1.0.1">
  <artifact name="jfilter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jackpanz', module='jfilter', version='1.0.1')
)
libraryDependencies += "com.github.jackpanz" % "jfilter" % "1.0.1"
[com.github.jackpanz/jfilter "1.0.1"]

Dependencies

provided (12)

Group / Artifact Type Version
org.springframework : spring-core jar 5.0.12.RELEASE
org.springframework : spring-web jar 5.0.12.RELEASE
org.springframework : spring-oxm jar 5.0.12.RELEASE
org.springframework : spring-tx jar 5.0.12.RELEASE
org.springframework : spring-jdbc jar 5.0.12.RELEASE
org.springframework : spring-webmvc jar 5.0.12.RELEASE
org.springframework : spring-aop jar 5.0.12.RELEASE
org.springframework : spring-context-support jar 5.0.12.RELEASE
org.springframework : spring-test jar 5.0.12.RELEASE
com.fasterxml.jackson.core : jackson-core jar 2.9.8
com.fasterxml.jackson.core : jackson-annotations jar 2.9.8
com.fasterxml.jackson.core : jackson-databind jar 2.9.8

Project Modules

There are no modules declared in this project.

jfilter

Dynamic filter object properties in the controller. Support spring mvc and spring boot. Version requirement.

  • spring 4.2+ 4.3+ .
  • spring 5.0+ .
  • jackson 2.8.0+ .

Download

Gradle:

dependencies {
  implementation 'com.github.jackpanz:jfilter:1.0.1'
}

Maven:

<dependency>
  <groupId>com.github.jackpanz</groupId>
  <artifactId>jfilter</artifactId>
  <version>1.0.1</version>
</dependency>

spring 4.2+ 4.3+

com.github.jackpanz.json.spring4.JFilterHttpMessageConverter

spring 5.0+

com.github.jackpanz.json.spring5.JFilterHttpMessageConverter

spring boot

@ComponentScan({"com.github.jackpanz.json"})
@Order(0)
@Bean
public JFilterHttpMessageConverter jFilterHttpMessageConverter(ObjectMapper objectMapper) {
    JFilterHttpMessageConverter messageConverter = new JFilterHttpMessageConverter(objectMapper);
    return messageConverter;
}

spring mvc

<context:component-scan base-package="com.github.jackpanz.json"/>
<mvc:annotation-driven>
    <mvc:message-converters>
        <bean class="com.github.jackpanz.json.spring4.JFilterHttpMessageConverter">
            <property name="supportedMediaTypes">
                <list>
                    <value>text/html;charset=UTF-8</value>
                    <value>application/json;charset=UTF-8</value>
                </list>
            </property>
        </bean>
    </mvc:message-converters>
</mvc:annotation-driven>

Usage

Only Object

@JFilter(clazz = User.class, property = "id,status")
@ResponseBody
@RequestMapping("users")
public List users() {
    ...
}

Multiple Object

@JFilters({
        @JFilter(clazz = User.class, property = "id,status")
        , @JFilter(clazz = Admin.class, property = "password,create_date")
})
@ResponseBody
@RequestMapping("maps")
public List maps() {
   ...
}

RestController

@JFilter(clazz = User.class, property = "id,status")
@GetMapping("rmaps")
public List maps() {
    ...
}

Versions

Version
1.0.1
1.0.0