public final class

Roles

extends Object
java.lang.Object
   ↳ org.eclipse.sisu.plexus.config.Roles

Class Overview

Utility methods for dealing with Plexus roles.

Summary

Public Methods
static String camelizeName(String name)
Removes any non-Java identifiers from the name and converts it to camelCase.
static String canonicalRoleHint(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 Key<?> componentKey(Component component)
Returns the component binding Key for the given Plexus component.
static <T> Key<T> componentKey(Class<T> role, String hint)
Returns the component binding Key for the given Plexus role-hint.
static <T> Key<T> componentKey(TypeLiteral<T> role, String hint)
Returns the component binding Key for the given Plexus role-hint.
static TypeLiteral<?> roleType(Requirement requirement, TypeLiteral<?> asType)
Deduces the role type based on the given @Requirement and expected type.
static <T> T throwMissingComponentException(TypeLiteral<T> role, String hint)
Throws a ProvisionException detailing the missing Plexus component.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String camelizeName (String name)

Removes any non-Java identifiers from the name and converts it to camelCase.

Parameters
name The element name
Returns
  • CamelCased name with no dashes

public static String canonicalRoleHint (Component component)

Returns the canonical role-hint for the given Plexus component.

Parameters
component The Plexus component
Returns
  • Canonical role-hint denoting the given component

public static String canonicalRoleHint (String role, String hint)

Returns the canonical form of the given Plexus role-hint.

Parameters
role The Plexus role
hint The Plexus hint
Returns
  • Canonical role-hint denoting the same component as the given role-hint

public static Key<?> componentKey (Component component)

Returns the component binding Key for the given Plexus component.

Parameters
component The Plexus component
Returns
  • Component binding key denoting the given component

public static Key<T> componentKey (Class<T> role, String hint)

Returns the component binding Key for the given Plexus role-hint.

Parameters
role The Plexus role
hint The Plexus hint
Returns
  • Component binding key denoting the given role-hint

public static Key<T> componentKey (TypeLiteral<T> role, String hint)

Returns the component binding Key for the given Plexus role-hint.

Parameters
role The Plexus role
hint The Plexus hint
Returns
  • Component binding key denoting the given role-hint

public static TypeLiteral<?> roleType (Requirement requirement, TypeLiteral<?> asType)

Deduces the role type based on the given @Requirement and expected type.

Parameters
requirement The Plexus requirement
asType The expected type
Returns
  • "Best-fit" role type

public static T throwMissingComponentException (TypeLiteral<T> role, String hint)

Throws a ProvisionException detailing the missing Plexus component.

Parameters
role The Plexus role
hint The Plexus hint