@ SuppressWarnings ( "unchecked" ) public < T > T getItem ( String itemName , Class < T > clazz ) throws ContextException { String item = getItem ( itemName ) ; if ( item == null || item . isEmpty ( ) ) { return null ; } ISerializer < ? > contextSerializer = ContextSerializerRegistry . getInstance ( ) . get ( clazz ) ; if ( contextSerializer == null ) { throw new ContextException ( "No serializer found for type " + clazz . getName ( ) ) ; } return ( T ) contextSerializer . deserialize ( item ) ; }
Returns an object of the specified class . The class must have an associated context serializer registered .