public final class Roles
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
MISSING_COMPONENT_ERROR |
private static java.lang.String |
MISSING_COMPONENT_WITH_HINT_ERROR |
| Modifier | Constructor and Description |
|---|---|
private |
Roles() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
camelizeName(java.lang.String name)
Removes any dashes from the name and converts it to camelCase.
|
static java.lang.String |
canonicalRoleHint(org.codehaus.plexus.component.annotations.Component component)
Returns the canonical role-hint for the given Plexus component.
|
static java.lang.String |
canonicalRoleHint(java.lang.String role,
java.lang.String hint)
Returns the canonical form of the given Plexus role-hint.
|
static <T> com.google.inject.Key<T> |
componentKey(java.lang.Class<T> role,
java.lang.String hint)
Returns the component binding
Key for the given Plexus role-hint. |
static com.google.inject.Key<?> |
componentKey(org.codehaus.plexus.component.annotations.Component component)
Returns the component binding
Key for the given Plexus component. |
static <T> com.google.inject.Key<T> |
componentKey(com.google.inject.TypeLiteral<T> role,
java.lang.String hint)
Returns the component binding
Key for the given Plexus role-hint. |
static com.google.inject.TypeLiteral<?> |
roleType(org.codehaus.plexus.component.annotations.Requirement requirement,
com.google.inject.TypeLiteral<?> asType)
Deduces the role type based on the given @
Requirement and expected type. |
static <T> T |
throwMissingComponentException(com.google.inject.TypeLiteral<T> role,
java.lang.String hint)
Throws a
ProvisionException detailing the missing Plexus component. |
private static final java.lang.String MISSING_COMPONENT_ERROR
private static final java.lang.String MISSING_COMPONENT_WITH_HINT_ERROR
public static java.lang.String canonicalRoleHint(java.lang.String role,
java.lang.String hint)
role - The Plexus rolehint - The Plexus hintpublic static java.lang.String canonicalRoleHint(org.codehaus.plexus.component.annotations.Component component)
component - The Plexus componentpublic static com.google.inject.TypeLiteral<?> roleType(org.codehaus.plexus.component.annotations.Requirement requirement,
com.google.inject.TypeLiteral<?> asType)
Requirement and expected type.requirement - The Plexus requirementasType - The expected typepublic static com.google.inject.Key<?> componentKey(org.codehaus.plexus.component.annotations.Component component)
Key for the given Plexus component.component - The Plexus componentpublic static <T> com.google.inject.Key<T> componentKey(java.lang.Class<T> role,
java.lang.String hint)
Key for the given Plexus role-hint.role - The Plexus rolehint - The Plexus hintpublic static <T> com.google.inject.Key<T> componentKey(com.google.inject.TypeLiteral<T> role,
java.lang.String hint)
Key for the given Plexus role-hint.role - The Plexus rolehint - The Plexus hintpublic static <T> T throwMissingComponentException(com.google.inject.TypeLiteral<T> role,
java.lang.String hint)
ProvisionException detailing the missing Plexus component.role - The Plexus rolehint - The Plexus hintpublic static java.lang.String camelizeName(java.lang.String name)
name - The element name