public final class Roles extends Object
Modifier and Type | Method and Description |
---|---|
static String |
camelizeName(String name)
Removes any dashes from the name and converts it to camelCase.
|
static String |
canonicalRoleHint(org.codehaus.plexus.component.annotations.Component component)
Returns the canonical role-hint for the given Plexus component.
|
static String |
canonicalRoleHint(String role,
String hint)
Returns the canonical form of the given Plexus role-hint.
|
static <T> com.google.inject.Key<T> |
componentKey(Class<T> role,
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,
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,
String hint)
Throws a
ProvisionException detailing the missing Plexus component. |
public static String canonicalRoleHint(String role, String hint)
role
- The Plexus rolehint
- The Plexus hintpublic static 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(Class<T> role, 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, 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, String hint)
ProvisionException
detailing the missing Plexus component.role
- The Plexus rolehint
- The Plexus hintCopyright © 2023. All rights reserved.