org.sonatype.guice.bean.locators
Class DefaultRankingFunction
java.lang.Object
org.sonatype.guice.bean.locators.DefaultRankingFunction
- All Implemented Interfaces:
- RankingFunction
public final class DefaultRankingFunction
- extends Object
- implements RankingFunction
Simple RankingFunction
that partitions qualified bindings into two main groups.
Default bindings are given zero or positive ranks; the rest are given negative ranks.
Method Summary |
int |
maxRank()
Estimates the maximum possible rank for this function; used to arrange injectors in order of ranking probability. |
|
rank(com.google.inject.Binding<T> binding)
Assigns a numeric rank to the given binding. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultRankingFunction
public DefaultRankingFunction(int primaryRank)
DefaultRankingFunction
@Inject
public DefaultRankingFunction()
maxRank
public int maxRank()
- Description copied from interface:
RankingFunction
- Estimates the maximum possible rank for this function; used to arrange injectors in order of ranking probability.
- Specified by:
maxRank
in interface RankingFunction
- Returns:
- Maximum rank
rank
public <T> int rank(com.google.inject.Binding<T> binding)
- Description copied from interface:
RankingFunction
- Assigns a numeric rank to the given binding.
- Specified by:
rank
in interface RankingFunction
- Parameters:
binding
- The binding
- Returns:
- Assigned rank
Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.