Example usage for org.apache.wicket.request IRequestMapper getCompatibilityScore

List of usage examples for org.apache.wicket.request IRequestMapper getCompatibilityScore

Introduction

In this page you can find the example usage for org.apache.wicket.request IRequestMapper getCompatibilityScore.

Prototype

int getCompatibilityScore(Request request);

Source Link

Document

Returns the score representing how compatible this request mapper is to processing the given request.

Usage

From source file:de.alpharogroup.wicket.base.request.mapper.HighScoreRequestMapper.java

License:Apache License

/**
 * {@inheritDoc}/*from  ww  w  . jav  a 2s  . c o m*/
 */
@Override
public int getCompatibilityScore(final Request request) {
    int score = Integer.MIN_VALUE;
    for (final IRequestMapper requestMapper : this.requestMappers) {
        score = Math.max(score, requestMapper.getCompatibilityScore(request));
    }
    return score;
}

From source file:de.alpharogroup.wicket.base.request.mapper.HighScoreRequestMapper.java

License:Apache License

/**
 * Initialize request mappers./* w w w  .j a v a 2s .c  om*/
 *
 * @param request
 *            the request
 * @return the collection
 */
private Collection<RequestMapperBean> initializeRequestMappers(final Request request) {
    final Set<RequestMapperBean> mapperBeans = new TreeSet<>(getComparator());
    for (final IRequestMapper requestMapper : this.requestMappers) {
        mapperBeans.add(new RequestMapperBean(requestMapper, requestMapper.getCompatibilityScore(request)));
    }
    return mapperBeans;
}