H - the type of the JWT headerP - the type of the JWT payload, either a content byte array or a Claims instance.public interface Jwt<H extends Header,P>
| Modifier and Type | Field and Description |
|---|---|
static JwtVisitor<Jwt<Header,Claims>> |
UNSECURED_CLAIMS
Visitor implementation that ensures the visited JWT is an unsecured
Claims JWT (one not
cryptographically signed or encrypted) and rejects all others with an UnsupportedJwtException. |
static JwtVisitor<Jwt<Header,byte[]>> |
UNSECURED_CONTENT
Visitor implementation that ensures the visited JWT is an unsecured content JWT (one not cryptographically
signed or encrypted) and rejects all others with an
UnsupportedJwtException. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
accept(JwtVisitor<T> visitor)
Invokes the specified
visitor's appropriate type-specific visit method based on this JWT's type. |
P |
getBody()
Deprecated.
since 0.12.0 because it has been renamed to
getPayload(). 'Payload' (not
body) is what the JWT specifications call this property, so it has been renamed to reflect the correct JWT
nomenclature/taxonomy. |
H |
getHeader()
Returns the JWT
Header or null if not present. |
P |
getPayload()
Returns the JWT payload, either a
byte[] or a Claims instance. |
static final JwtVisitor<Jwt<Header,byte[]>> UNSECURED_CONTENT
UnsupportedJwtException.SupportedJwtVisitor.onUnsecuredContent(Jwt)static final JwtVisitor<Jwt<Header,Claims>> UNSECURED_CLAIMS
Claims JWT (one not
cryptographically signed or encrypted) and rejects all others with an UnsupportedJwtException.SupportedJwtVisitor.onUnsecuredClaims(Jwt)H getHeader()
Header or null if not present.Header or null if not present.@Deprecated P getBody()
getPayload(). 'Payload' (not
body) is what the JWT specifications call this property, so it has been renamed to reflect the correct JWT
nomenclature/taxonomy.byte[] or a Claims instance. Use
getPayload() instead, as this method will be removed prior to the 1.0 release.byte[] or a Claims instance.P getPayload()
byte[] or a Claims instance. If the payload is a byte
array, and if the JWT creator set the (optional) contentType header
value, the application may inspect the contentType value to determine how to convert the byte array to
the final content type as desired.byte[] or a Claims instance.<T> T accept(JwtVisitor<T> visitor)
visitor's appropriate type-specific visit method based on this JWT's type.T - the value type returned from the visit method.visitor - the visitor to invoke.visit method implementation.Copyright © 2014–2025 jsonwebtoken.io. All rights reserved.