本文整理汇总了Java中org.kuali.rice.krms.api.repository.term.TermDefinition.getSpecification方法的典型用法代码示例。如果您正苦于以下问题:Java TermDefinition.getSpecification方法的具体用法?Java TermDefinition.getSpecification怎么用?Java TermDefinition.getSpecification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krms.api.repository.term.TermDefinition
的用法示例。
在下文中一共展示了TermDefinition.getSpecification方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lookupTermType
import org.kuali.rice.krms.api.repository.term.TermDefinition; //导入方法依赖的package包/类
/**
* Lookup the {@link org.kuali.rice.krms.api.repository.term.TermSpecificationDefinitionContract} type.
* @param key krms_term_t key
* @return String the krms_term_spec_t TYP for the given krms_term_t key given
*/
private String lookupTermType(String key) {
TermSpecificationDefinition termSpec = null;
if (key.startsWith(KrmsImplConstants.PARAMETERIZED_TERM_PREFIX)) {
String termSpecificationId = key.substring(KrmsImplConstants.PARAMETERIZED_TERM_PREFIX.length());
termSpec = KrmsRepositoryServiceLocator.getTermBoService().getTermSpecificationById(termSpecificationId);
} else {
TermDefinition term = KrmsRepositoryServiceLocator.getTermBoService().getTerm(key);
if (term != null) {
termSpec = term.getSpecification();
}
}
if (termSpec != null) {
return termSpec.getType();
} else {
return null;
}
}
示例2: translateTermDefinition
import org.kuali.rice.krms.api.repository.term.TermDefinition; //导入方法依赖的package包/类
protected Term translateTermDefinition(TermDefinition termDefinition) {
if (termDefinition == null) {
throw new RepositoryDataException("Given TermDefinition is null");
}
TermSpecificationDefinition termSpecificationDefinition = termDefinition.getSpecification();
if (termSpecificationDefinition == null) { throw new RepositoryDataException("term with id " + termDefinition.getId() + " has a null specification"); }
List<TermParameterDefinition> params = termDefinition.getParameters();
Map<String,String> paramsMap = new TreeMap<String,String>();
if (!CollectionUtils.isEmpty(params)) for (TermParameterDefinition param : params) {
if (StringUtils.isBlank(param.getName())) {
throw new RepositoryDataException("TermParameterDefinition.name may not be blank");
}
paramsMap.put(param.getName(), param.getValue());
}
return new Term(termSpecificationDefinition.getName(), paramsMap);
}