public AccessAssertion unmarshal ( final JSONObject encodedAssertion ) { final String className ; try { className = encodedAssertion . getString ( JSON_CLASS_NAME ) ; final Class < ? > assertionClass = Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( className ) ; final AccessAssertion assertion = ( AccessAssertion ) this . applicationContext . getBean ( assertionClass ) ; assertion . unmarshal ( encodedAssertion ) ; return assertion ; } catch ( JSONException | ClassNotFoundException e ) { throw new RuntimeException ( e ) ; } }
Load assertion from the provided json or throw exception if not possible .