Partial Response: Parent

Parent pom for the partial-response project

License

License

GroupId

GroupId

com.pressassociation.partial-response
ArtifactId

ArtifactId

partial-response
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

pom
Description

Description

Partial Response: Parent
Parent pom for the partial-response project
Project URL

Project URL

https://github.com/PressAssociation/partial-response
Source Code Management

Source Code Management

https://github.com/PressAssociation/partial-response

Download partial-response

Filename Size
partial-response-1.0.pom 5 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.pressassociation.partial-response/partial-response/ -->
<dependency>
    <groupId>com.pressassociation.partial-response</groupId>
    <artifactId>partial-response</artifactId>
    <version>1.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.pressassociation.partial-response/partial-response/
implementation 'com.pressassociation.partial-response:partial-response:1.0'
// https://jarcasting.com/artifacts/com.pressassociation.partial-response/partial-response/
implementation ("com.pressassociation.partial-response:partial-response:1.0")
'com.pressassociation.partial-response:partial-response:pom:1.0'
<dependency org="com.pressassociation.partial-response" name="partial-response" rev="1.0">
  <artifact name="partial-response" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.pressassociation.partial-response', module='partial-response', version='1.0')
)
libraryDependencies += "com.pressassociation.partial-response" % "partial-response" % "1.0"
[com.pressassociation.partial-response/partial-response "1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • filter-json-jackson
  • filter-json-jackson-jaxrs
  • matcher

Partial Response

Build Status

This project provides a library to help with the processing and implementation of partial response in an API.

The core library consists of parsers, AST, visitors and matcher for working with a partial response value. Higher level functionality may be added over time including http filters for xml and json to post process your responses for inclusion in the partial response.

Usage

To use this in your Maven project simply include the dependency

<dependency>
  <groupId>com.pressassociation.partial-response</groupId>
  <artifactId>matcher</artifactId>
  <version>1.0</version>
</dependency>

This will give you the Matcher class which is the core concept for partial response. The Matcher gives you a way to parse and match against a partial response pattern.

Matcher matcher = Matcher.of("name,address,spouse(name,address),children/*");

// matches all of these Leafs
assertTrue(matcher.matches("/name"));
assertTrue(matcher.matches("/address"));
assertTrue(matcher.matches("/address/houseNumber"));
assertTrue(matcher.matches("/spouse/name"));
assertTrue(matcher.matches("/spouse/address"));
assertTrue(matcher.matches("/children"));
assertTrue(matcher.matches("/children/any/path"));

// doesn't match any of these
assertFalse(matcher.matches("/unknown"));
assertFalse(matcher.matches("/spouse/children"));
// Note: spouse as a leaf is not included, only certain sub properties are
assertFalse(matcher.matches("/spouse"));

Out of the box

This project consists of a number of sub-projects to cover different use cases for partial-response.

  • Matcher - contains the core pattern parsers and Matcher class. This is the low level functionality behind all partial response support
  • Jackson JSON Filter - Partial response filter for Jackson JSON serialisation.
  • JAX-RS Jackson JSON Filter - JAX-RS response filter for applying partial-response to JAX-RS based REST API responses.
com.pressassociation.partial-response

PA Media Group (formerly Press Association)

We have rebranded, please visit: https://github.com/pa-media-group

Versions

Version
1.0