{"id":30110273,"url":"https://github.com/rouvoy/jfilter","last_synced_at":"2025-08-10T04:23:22.768Z","repository":{"id":4147990,"uuid":"5261919","full_name":"rouvoy/jfilter","owner":"rouvoy","description":"Library for processing LDAP-like simple filters.","archived":false,"fork":false,"pushed_at":"2017-12-20T20:12:41.000Z","size":517,"stargazers_count":15,"open_issues_count":5,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-06-12T17:32:21.070Z","etag":null,"topics":["java","json","ldap"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rouvoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-01T16:49:33.000Z","updated_at":"2020-11-28T01:16:51.000Z","dependencies_parsed_at":"2022-07-05T11:02:16.633Z","dependency_job_id":null,"html_url":"https://github.com/rouvoy/jfilter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rouvoy/jfilter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rouvoy%2Fjfilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rouvoy%2Fjfilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rouvoy%2Fjfilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rouvoy%2Fjfilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rouvoy","download_url":"https://codeload.github.com/rouvoy/jfilter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rouvoy%2Fjfilter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268926949,"owners_count":24330230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","json","ldap"],"created_at":"2025-08-10T04:23:21.535Z","updated_at":"2025-08-10T04:23:22.752Z","avatar_url":"https://github.com/rouvoy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Filter Library\n\nThis is a Java library to match POJO against LDAP-like or JSON-like filters.\n\n\n## Maven artefact\n\n### Release\nThe latest released version of the JFilter library artefact is available as:\n\n``` xml\n\u003cdependency\u003e\n    \u003cgroupId\u003efr.inria.jfilter\u003c/groupId\u003e\n    \u003cartifactId\u003ejfilter-library\u003c/artifactId\u003e\n    \u003cversion\u003e1.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Snapshot\nThe currently developed version of the JFilter library artefact is available as:\n\n``` xml\n\u003cdependency\u003e\n    \u003cgroupId\u003efr.inria.jfilter\u003c/groupId\u003e\n    \u003cartifactId\u003ejfilter-library\u003c/artifactId\u003e\n    \u003cversion\u003e1.3-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Maven compilation\n\nJFilter is a [Maven](http://maven.apache.org \"Maven\") managed project. All you have to do is to invoke the `install` command from the root directory (`JFILTER_DIR`):\n\n``` bash\ncd $JFILTER_DIR\nmvn install\n```\n\n\n\n## API usage\n\n### LDAP filters\n\nCurrently, the library supports the following LDAP-like filters:\n\n| Operator    | Description       | Supported types | Filter example |\n|:-----------:|:-----------------:|:----------------| :--------------|\n| `=`         | *equals to*       | [String](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html), [Number](http://docs.oracle.com/javase/6/docs/api/java/lang/Number.html), [Object](http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html) | `(firstname = John)` |\n| `~`         | *differs from*    | [String](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html), [Number](http://docs.oracle.com/javase/6/docs/api/java/lang/Number.html), [Object](http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html) | `(name ~ Smith)` |\n| `\u003e`         | *more than*       | [Number](http://docs.oracle.com/javase/6/docs/api/java/lang/Number.html) | `(height \u003e 1.6)` |\n| `\u003e=`        | *more or equals*  | [Number](http://docs.oracle.com/javase/6/docs/api/java/lang/Number.html) | `(height \u003e= 1.6)` |\n| `\u003c`         | *less than*       | [Number](http://docs.oracle.com/javase/6/docs/api/java/lang/Number.html) | `(age \u003c 20)` |\n| `\u003c=`        | *less or equals*  | [Number](http://docs.oracle.com/javase/6/docs/api/java/lang/Number.html) | `(age \u003c= 20)` |\n| `!`         | *not*             | Filter          | `!(age\u003c10)` |\n| `\u0026`         | *and*             | Filters         | `\u0026(name=Doe)(firstname=John)` |\n| `PIPE`      | *or*              | Filters         | `PIPE(age\u003c10)(male=true)` |\n| *wildcards* | *matches all*     | [String](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html) | `\u0026(firstname=J*)(name=Do?)` |\n| *types*     | *conforms to*     | [Object](http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html) |  `(objectClass=Person)` |\n\n\n``` java\npublic class Person {\n    String firstname = \"John\", name = \"Doe\";\n\tint age = 20;\n\tboolean male = true;\n\tdouble height = 1.8 ;\n\tAddress home = new Address(); \n\t\n\tpublic static class Address {\n\t    String street = \"Main street\", city = \"New York\";\n\t    int postcode = 10014;\n\t}\n\n    public static void main(String[] args) {\n        Person x = new Person();\n        Collection\u003cPerson\u003e col = Collections.singleton(x);\n\n        Filter filter1 = FilterParser.instance.parse(\"age \u003e 18\");\n        if (filter1.match(x)) // Checks if x is an adult\n            System.out.println(x.firstname+\" \"+x.name+\" is more than 18 years old.\");\n\n        Filter filter2 = FilterParser.instance.parse(\"(home.city=New York)\");\n        if (filter2.match(x)) // Checks if x matches the LDAP filter\n            System.out.println(x.firstname+\"'s lives in \"+x.home.city);\n\n        Filter filter3 = FilterParser.instance.parse(\"\u0026(firstname=John)(name=D*)\");\n        if (filter3.match(x)) // Checks if x matches the LDAP filter\n            System.out.println(x.firstname+\"'s name starts by \\\"D\\\"\");\n            \n        if (filter3.match(col)) // Checks if col matches the LDAP filter\n            System.out.println(x.firstname+\"'s name starts by \\\"D\\\"\");\n\n        // Filters the content of a collection to keep adults\n        Collection\u003cPerson\u003e adults = filter1.filter(col);\n    }\n}\n```\n\n### JSON filters\nThe library also supports the following JSON-like filters:\n\n| Operator | Description  | Supported types | Filter example |\n|:--------:|:------------:|:----------------| --------------:|\n| `:`      | *equals to*  | [String](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html), [Number](http://docs.oracle.com/javase/6/docs/api/java/lang/Number.html), [Object](http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html) | `{firstname:John}` |\n| `,`      | *and*        | Filters         | `{name:Doe,firstname:John}` |\n| *wildcards* | *matches*  | [String](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html) | `{firstname:J*,name:Do?}` |\n| *types*  | *conforms to* | [Object](http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html) |  `{objectClass:Person}` |\n\n\n``` java\npublic class Person {\n    String firstname = \"John\", name = \"Doe\";\n\tint age = 20;\n\tboolean male = true;\n\tdouble height = 1.8 ;\n\tAddress home = new Address(); \n\t\n\tpublic static class Address {\n\t    String street = \"Main street\", city = \"New York\";\n\t    int postcode = 10014;\n\t}\n\n    public static void main(String[] args) {\n        Person x = new Person();\n        Collection\u003cPerson\u003e col = Collections.singleton(x);\n\n        // Creates a POJO filter from the JSON syntax\n        Filter filter1 = FilterParser.instance.parse(\"{name:Doe}\");\n            \n        if (filter1.match(x)) // Checks if x matches the JSON filter\n            System.out.println(x.firstname+\"'s name is \"+x.name);\n\n        if (filter1.match(col)) // Checks if col matches the JSON filter\n            System.out.println(x.firstname+\"'s name is \"+x.name);\n            \n        // Filters the content of a collection to keep names starting by D\n        Filter filter2 = FilterParser.instance.parse(\"{name:D*}\");            \n        Collection\u003cPerson\u003e named = filter2.filter(col);\n    }\n}\n```\n\n## Licence\n\n    Copyright (C) 2012 University Lille 1, Inria\n\n    This library is free software; you can redistribute it and/or modify\n    it under the terms of the GNU Library General Public License as published\n    by the Free Software Foundation; either version 2 of the License, or (at\n    your option) any later version.\n\n    This library is distributed in the hope that it will be useful, but WITHOUT\n    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public\n    License for more details.\n\n    You should have received a copy of the GNU Library General Public License\n    along with this library; if not, write to the Free Software Foundation,\n    Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frouvoy%2Fjfilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frouvoy%2Fjfilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frouvoy%2Fjfilter/lists"}