private static void getProperties(Class<?> klazz, String path, Deque<Field> fieldChain) {
        for (Field f : klazz.getDeclaredFields()) {
            f.setAccessible(true);
            JsonProperty jsonProperty = f.getAnnotation(JsonProperty.class);
            if (jsonProperty != null) {
                fieldChain.push(f);
                // If the inspected type has nested @JsonProperty annotations, we need to inspect it
                if (!terminalType(f) && hasJsonPropertyAnnotation(f)) {
                    getProperties(f.getType(), f.getName() + ".", fieldChain); // Add "." when traversing into new object.
                } else {
                    // Otherwise, just assume it's simple as the best we can do is #toString
                    List<Field> fieldList = new ArrayList<>(fieldChain);
                    Collections.reverse(fieldList);
                    STANDARD_CLAIMS_FIELD_MAP.put(path + jsonProperty.value(), fieldList);
                    fieldChain.pop(); // Pop, as we have now reached end of this chain.
                }
            }
        }
    }
Get a claim by name.

@param token token to retrieve claim from
@param claim the claim (field key)
@return string representation of claim
plugins/keycloak-oauth-policy/src/main/java/io/apiman/plugins/keycloak_oauth_policy/ClaimLookup.java