Example usage for org.apache.wicket WicketRuntimeException WicketRuntimeException

List of usage examples for org.apache.wicket WicketRuntimeException WicketRuntimeException

Introduction

In this page you can find the example usage for org.apache.wicket WicketRuntimeException WicketRuntimeException.

Prototype

public WicketRuntimeException() 

Source Link

Usage

From source file:com.github.javawithmarcus.wicket.cdi.CdiConfiguration.java

License:Apache License

protected ConfigurationParameters getApplicationParameters() {
    ConfigurationParameters params = parameters.get(Application.get().getApplicationKey());
    if (params == null) {
        try {//w  w w.  ja v  a  2s. c  o m
            Application app = Application.get();
            if (app.getApplicationKey() == null) {
                throw new WicketRuntimeException();
            }
            params = new ConfigurationParameters();
            parameters.put(app.getApplicationKey(), params);
        } catch (WicketRuntimeException wre) {
            throw new IllegalStateException("Application is not ready.");
        }
    }
    return params;
}

From source file:dk.teachus.frontend.components.form.ElementModifier.java

License:Apache License

private ValidationProducer getValidationProducer(Component component) {
    if (validationProducer != null) {
        return validationProducer;
    } else {//from ww w .  j a v a  2  s  .c o m
        if (component instanceof ValidationProducer == false) {
            throw new WicketRuntimeException();
        }

        return (ValidationProducer) component;
    }
}

From source file:org.wicketstuff.lazymodel.reflect.Generics.java

License:Apache License

/**
 * Get the {@link Class} for a generic type.
 * /*from  ww  w . ja v  a  2  s .c o m*/
 * @param type
 *            type
 * @return class
 */
public static Class<?> getClass(Type type) {
    Class<?> clazz;

    if (type instanceof Class) {
        clazz = ((Class<?>) type);
    } else if (type instanceof ParameterizedType) {
        clazz = (Class<?>) ((ParameterizedType) type).getRawType();
    } else {
        throw new WicketRuntimeException();
    }

    return clazz;
}