当前位置: 首页>>代码示例>>Java>>正文


Java TermSpecificationBo.getContexts方法代码示例

本文整理汇总了Java中org.kuali.rice.krms.impl.repository.TermSpecificationBo.getContexts方法的典型用法代码示例。如果您正苦于以下问题:Java TermSpecificationBo.getContexts方法的具体用法?Java TermSpecificationBo.getContexts怎么用?Java TermSpecificationBo.getContexts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krms.impl.repository.TermSpecificationBo的用法示例。


在下文中一共展示了TermSpecificationBo.getContexts方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateContext

import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
private boolean validateContext(TermSpecificationBo termSpec) {
    List<ContextBo> termSpecContexts = termSpec.getContexts();
    List<String> contextIds = new ArrayList<String>();
    boolean valid = true;
    for (ContextBo context: termSpecContexts) {
        if (contextIds.contains(context.getId())) {
            this.putFieldError(KRMSPropertyConstants.TermSpecification.CONTEXT, "error.termSpecification.duplicateContext");
            valid = false;
        } else {
            contextIds.add(context.getId());
        }
    }
    return valid;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:TermSpecBusRule.java

示例2: prepareForSave

import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
/**
 * Store contexts in contextIds (needed for serialization)
 *
 * @see org.kuali.rice.krad.maintenance.Maintainable#prepareForSave
 */
@Override
public void prepareForSave() {
    super.prepareForSave();

    TermSpecificationBo termSpec = (TermSpecificationBo) getDataObject();
    termSpec.setContextIds(new ArrayList<String>());
    for (ContextBo context : termSpec.getContexts()) {
        termSpec.getContextIds().add(context.getId());
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:16,代码来源:TermSpecificationMaintainable.java

示例3: copyContextsOldToNewBo

import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
/**
 * Copy the contexts from the old TermSpecificationBo to the newTermSpecificationBo of the maintenance document.
 * <p>
 * Since the contexts is a transient field it doesn't get copied by the deepCopy in
 * MaintenanceDocumentServiceImpl.setupMaintenanceObject, we manually need to copy the values over.
 * For performance reasons a shallow copy is done since the ContextBo themselves are never changed.
 * </p>
 * @param document that contains the old and new TermSpecificationBos
 */
private void copyContextsOldToNewBo(MaintenanceDocument document) {
    TermSpecificationBo newTermSpec = (TermSpecificationBo) document.getNewMaintainableObject().getDataObject();

    // Hydrade contexts as they are transient
    newTermSpec.getContexts().clear();
    newTermSpec.getContexts();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:TermSpecificationMaintainable.java

示例4: copyContextsOldToNewBo

import org.kuali.rice.krms.impl.repository.TermSpecificationBo; //导入方法依赖的package包/类
/**
 * Copy the contexts from the old TermSpecificationBo to the newTermSpecificationBo of the maintenance document.
 * <p>
 * Since the contexts is a transient field it doesn't get copied by the deepCopy in
 * MaintenanceDocumentServiceImpl.setupMaintenanceObject, we manually need to copy the values over.
 * For performance reasons a shallow copy is done since the ContextBo themselves are never changed.
 * </p>
 * @param document that contains the old and new TermSpecificationBos
 */
private void copyContextsOldToNewBo(MaintenanceDocument document) {
    TermSpecificationBo oldTermSpec = (TermSpecificationBo) document.getOldMaintainableObject().getDataObject();
    TermSpecificationBo newTermSpec = (TermSpecificationBo) document.getNewMaintainableObject().getDataObject();
    newTermSpec.setContexts(new ArrayList<ContextBo>());
    for (ContextBo contextBo : oldTermSpec.getContexts()) {
        newTermSpec.getContexts().add(contextBo);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:18,代码来源:TermSpecificationMaintainable.java


注:本文中的org.kuali.rice.krms.impl.repository.TermSpecificationBo.getContexts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。