Class ComponentRequirement
- java.lang.Object
-
- org.codehaus.plexus.component.repository.ComponentRequirement
-
- Direct Known Subclasses:
ComponentRequirementList
public class ComponentRequirement extends java.lang.ObjectThis represents a component this is required by another component.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringfieldMappingTypeprivate java.lang.StringfieldNameprivate booleanoptionalprivate java.lang.Stringroleprivate java.lang.StringroleHint
-
Constructor Summary
Constructors Constructor Description ComponentRequirement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)java.lang.StringgetFieldMappingType()Returns the type of the field this component requirement will inject.java.lang.StringgetFieldName()Returns the field name that this component requirement will inject.java.lang.StringgetHumanReadableKey()Returns a human-friendly key, suitable for display.java.lang.StringgetRole()Returns the role of the required component.java.lang.StringgetRoleHint()Returns the role-hint of the required component.inthashCode()booleanisOptional()Whether this component requirement is optional and needs not be satisfiedvoidsetFieldMappingType(java.lang.String fieldType)Sets the type of the field that will be populated by the required component.voidsetFieldName(java.lang.String fieldName)Sets the name of the field that will be populated by the required component.voidsetOptional(boolean optional)Controls whether a failure to satisfy this requirement can be tolerated by host component or whether construction of the host component should also fail.voidsetRole(java.lang.String role)Sets the role of the require component.voidsetRoleHint(java.lang.String roleHint)Sets the role-hint of the require component.java.lang.StringtoString()
-
-
-
Method Detail
-
getFieldName
public java.lang.String getFieldName()
Returns the field name that this component requirement will inject.- Returns:
- the field name that this component requirement will inject
-
setFieldName
public void setFieldName(java.lang.String fieldName)
Sets the name of the field that will be populated by the required component.- Parameters:
fieldName- the name of the field to be populated
-
getRole
public java.lang.String getRole()
Returns the role of the required component.- Returns:
- the role of the required component
-
setRole
public void setRole(java.lang.String role)
Sets the role of the require component.- Parameters:
role- the required component's role
-
getRoleHint
public java.lang.String getRoleHint()
Returns the role-hint of the required component.- Returns:
- the role-hint of the required component
-
setRoleHint
public void setRoleHint(java.lang.String roleHint)
Sets the role-hint of the require component. Passing null or an empty string will match any available implementation.- Parameters:
roleHint- the required component's role-hint
-
getFieldMappingType
public java.lang.String getFieldMappingType()
Returns the type of the field this component requirement will inject.- Returns:
- the type of the field this component requirement will inject
-
setFieldMappingType
public void setFieldMappingType(java.lang.String fieldType)
Sets the type of the field that will be populated by the required component.- Parameters:
fieldType- the type of the field to be populated
-
isOptional
public boolean isOptional()
Whether this component requirement is optional and needs not be satisfied- Returns:
trueif the requested component may be missing,falseif the component is mandatory.- Since:
- 1.3.0
-
setOptional
public void setOptional(boolean optional)
Controls whether a failure to satisfy this requirement can be tolerated by host component or whether construction of the host component should also fail.- Parameters:
optional-trueif the requested component may be missing,falseif the component is mandatory.- Since:
- 1.3.0
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getHumanReadableKey
public java.lang.String getHumanReadableKey()
Returns a human-friendly key, suitable for display.- Returns:
- a human-friendly key
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-