本文整理汇总了Java中org.codehaus.plexus.component.annotations.Requirement.hint方法的典型用法代码示例。如果您正苦于以下问题:Java Requirement.hint方法的具体用法?Java Requirement.hint怎么用?Java Requirement.hint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.plexus.component.annotations.Requirement
的用法示例。
在下文中一共展示了Requirement.hint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createComponentRequirement
import org.codehaus.plexus.component.annotations.Requirement; //导入方法依赖的package包/类
public static ComponentRequirement createComponentRequirement(Field field, Requirement requirement) {
ComponentRequirement cr = new ComponentRequirement();
cr.setFieldName(field.getName());
cr.setOptional(requirement.optional());
if (requirement.role() != null && requirement.role() != Object.class) {
cr.setRole(requirement.role().getName());
}
else {
cr.setRole(field.getType().getName());
}
if (requirement.hint() != null) {
cr.setRoleHint(requirement.hint());
}
return cr;
}
示例2: createComponentRequirement
import org.codehaus.plexus.component.annotations.Requirement; //导入方法依赖的package包/类
private static ComponentRequirement createComponentRequirement(Field field, Requirement requirement) {
ComponentRequirement cr = new ComponentRequirement();
cr.setFieldName(field.getName());
cr.setOptional(requirement.optional());
if (requirement.role() != null && requirement.role() != Object.class) {
cr.setRole(requirement.role().getName());
}
else {
cr.setRole(field.getType().getName());
}
if (requirement.hint() != null) {
cr.setRoleHint(requirement.hint());
}
return cr;
}
示例3: buildRequirement
import org.codehaus.plexus.component.annotations.Requirement; //导入方法依赖的package包/类
private ComponentRequirement buildRequirement(Field field, Requirement requirement) {
ComponentRequirement req = new ComponentRequirement();
req.setFieldName(field.getName());
if (requirement.role() != null && requirement.role() != Object.class) {
req.setRole(requirement.role().getName());
}
else {
req.setRole(field.getType().getName());
}
if (requirement.hint() != null && requirement.hint().length() > 0) {
req.setRoleHint(requirement.hint());
}
if (requirement.optional()) {
req.setOptional(true);
}
return req;
}