Update README.md

This commit is contained in:
Les Hazlewood 2014-09-30 09:32:14 -07:00
parent ff88ea83dd
commit c0ff23ae6c
1 changed files with 6 additions and 6 deletions

View File

@ -125,25 +125,25 @@ If you do not know the format of the compact JWT string at the time you try to p
```java ```java
T returnVal = Jwts.parser().setSigningKey(key).parse(compact, new JwtHandler<T>() { T returnVal = Jwts.parser().setSigningKey(key).parse(compact, new JwtHandler<T>() {
@Override @Override
public Object onPlaintextJwt(Jwt<Header, String> jwt) { public T onPlaintextJwt(Jwt<Header, String> jwt) {
//the JWT parsed was an unsigned plaintext JWT //the JWT parsed was an unsigned plaintext JWT
//inspect it, then return an instance of T (see returnVal above) //inspect it, then return an instance of T (see returnVal above)
} }
@Override @Override
public Object onClaimsJwt(Jwt<Header, Claims> jwt) { public T onClaimsJwt(Jwt<Header, Claims> jwt) {
//the JWT parsed was an unsigned Claims JWT //the JWT parsed was an unsigned Claims JWT
//inspect it, then return an instance of T (see returnVal above) //inspect it, then return an instance of T (see returnVal above)
} }
@Override @Override
public Object onPlaintextJws(Jws<String> jws) { public T onPlaintextJws(Jws<String> jws) {
//the JWT parsed was a signed plaintext JWS //the JWT parsed was a signed plaintext JWS
//inspect it, then return an instance of T (see returnVal above) //inspect it, then return an instance of T (see returnVal above)
} }
@Override @Override
public Object onClaimsJws(Jws<Claims> jws) { public T onClaimsJws(Jws<Claims> jws) {
//the JWT parsed was a signed Claims JWS //the JWT parsed was a signed Claims JWS
//inspect it, then return an instance of T (see returnVal above) //inspect it, then return an instance of T (see returnVal above)
} }
@ -155,13 +155,13 @@ Of course, if you know you'll only have to parse a subset of the above, you can
```java ```java
T returnVal = Jwts.parser().setSigningKey(key).parse(plaintextJwt, new JwtHandlerAdapter<Jwt<Header, T>>() { T returnVal = Jwts.parser().setSigningKey(key).parse(plaintextJwt, new JwtHandlerAdapter<Jwt<Header, T>>() {
@Override @Override
public Object onPlaintextJws(Jws<String> jws) { public T onPlaintextJws(Jws<String> jws) {
//the JWT parsed was a signed plaintext JWS //the JWT parsed was a signed plaintext JWS
//inspect it, then return an instance of T (see returnVal above) //inspect it, then return an instance of T (see returnVal above)
} }
@Override @Override
public Object onClaimsJws(Jws<Claims> jws) { public T onClaimsJws(Jws<Claims> jws) {
//the JWT parsed was a signed Claims JWS //the JWT parsed was a signed Claims JWS
//inspect it, then return an instance of T (see returnVal above) //inspect it, then return an instance of T (see returnVal above)
} }