public static T getAsObject()

in tiles-request-freemarker/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerUtil.java [49:63]


    public static <T> T getAsObject(TemplateModel model, Class<T> type, T defaultValue) {
        try {
            T retValue = defaultValue;
            if (model != null) {
                @SuppressWarnings("unchecked")
                T value = (T) DeepUnwrap.unwrap(model);
                if (value != null) {
                    retValue = value;
                }
            }
            return retValue;
        } catch (TemplateModelException e) {
            throw new FreemarkerAutotagException("Cannot unwrap a model", e);
        }
    }