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


Java RiceIllegalArgumentException类代码示例

本文整理汇总了Java中org.kuali.rice.core.api.exception.RiceIllegalArgumentException的典型用法代码示例。如果您正苦于以下问题:Java RiceIllegalArgumentException类的具体用法?Java RiceIllegalArgumentException怎么用?Java RiceIllegalArgumentException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RiceIllegalArgumentException类属于org.kuali.rice.core.api.exception包,在下文中一共展示了RiceIllegalArgumentException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateForCreate

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
protected void validateForCreate(PeopleFlowDefinition peopleFlow) {
    if (peopleFlow == null) {
        throw new RiceIllegalArgumentException("peopleFlow is null");
    }
    if (StringUtils.isNotBlank(peopleFlow.getId())) {
        throw new RiceIllegalArgumentException("Attempted to create a new PeopleFlow definition with a specified peopleFlowId of '"
                + peopleFlow.getId() + "'.  This is not allowed, when creating a new PeopleFlow definition, id must be null.");
    }
    if (peopleFlow.getVersionNumber() != null) {
        throw new RiceIllegalArgumentException("The version number on the given PeopleFlow definition was not null, value was " + peopleFlow.getVersionNumber() +
                "  When creating a new PeopleFlow, the given version number must be null.");
    }
    validatePeopleFlowMembersForCreate(peopleFlow);
    if (getPeopleFlowBoByName(peopleFlow.getNamespaceCode(), peopleFlow.getName()) != null) {
        throw new RiceIllegalStateException("A PeopleFlow definition with the namespace code '" + peopleFlow.getNamespaceCode() +
        "' and name '" + peopleFlow.getName() + "' already exists.");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:PeopleFlowServiceImpl.java

示例2: validateAttributesAgainstExisting

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
/**
 * <p>This method validates the passed in attributes for a kewTypeId generating a List of
 * {@link RemotableAttributeError}s.  This method used the oldAttributes to aid in validation.  This is useful for
 * validating "new" or "updated" attributes.</p>
 *
 * @param kewTypeId the people flow type identifier.  Must not be null or blank.
 * @param newAttributes the kim type attributes to validate. Cannot be null.
 * @param oldAttributes the old attributes to use for validation. Cannot be null.
 * @return any errors that are discovered during validation.  Will not return null.
 * @throws RiceIllegalArgumentException
 */
@WebMethod(operationName="validateAttributesAgainstExisting")
@XmlElementWrapper(name = "attributeErrors", required = true)
@XmlElement(name = "attributeError", required = false)
@WebResult(name = "attributeErrors")
List<RemotableAttributeError> validateAttributesAgainstExisting(

        @WebParam(name = "kewTypeId") String kewTypeId,

        @WebParam(name = "newAttributes")
        @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
        Map<String, String> newAttributes,

        @WebParam(name = "oldAttributes")
        @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
        Map<String, String> oldAttributes

) throws RiceIllegalArgumentException;
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:PeopleFlowTypeService.java

示例3: findPostalCodes

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public PostalCodeQueryResults findPostalCodes(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
    incomingParamCheck(queryByCriteria, "queryByCriteria");

    QueryResults<PostalCodeBo> results = getDataObjectService().findMatching(PostalCodeBo.class, queryByCriteria);

    PostalCodeQueryResults.Builder builder = PostalCodeQueryResults.Builder.create();
    builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
    builder.setTotalRowCount(results.getTotalRowCount());

    final List<PostalCode.Builder> ims = new ArrayList<PostalCode.Builder>();
    for (PostalCodeBo bo : results.getResults()) {
        ims.add(PostalCode.Builder.create(bo));
    }

    builder.setResults(ims);
    return builder.build();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:PostalCodeServiceImpl.java

示例4: customizeResults

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public DocumentSearchResultValues customizeResults(DocumentSearchCriteria documentSearchCriteria,
        List<DocumentSearchResult> defaultResults,
        String customizerName) throws RiceIllegalArgumentException {
    if (documentSearchCriteria == null) {
        throw new RiceIllegalArgumentException("documentSearchCriteria was null");
    }
    if (defaultResults == null) {
        throw new RiceIllegalArgumentException("defaultResults was null");
    }
    if (StringUtils.isBlank(customizerName)) {
        throw new RiceIllegalArgumentException("customizerName was null or blank");
    }
    DocumentSearchCustomizer customizer = loadCustomizer(customizerName);
    return customizer.customizeResults(documentSearchCriteria, defaultResults);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:DocumentSearchCustomizationHandlerServiceImpl.java

示例5: addCitizenshipToEntity

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public EntityCitizenship addCitizenshipToEntity(
        EntityCitizenship citizenship) throws RiceIllegalArgumentException, RiceIllegalStateException {
    incomingParamCheck(citizenship, "citizenship");

    if (StringUtils.isBlank(citizenship.getEntityId())) {
        throw new RiceIllegalStateException("Citizenship's entityId must be populated before creation");
    } else {
        if (citizenship.getStatus() == null) {
            throw new RiceIllegalStateException("Citizenship's status must be populated before creation");
        }
        if (getEntityCitizenshipBo(citizenship.getEntityId(), citizenship.getStatus().getCode()) != null) {
            throw new RiceIllegalStateException("the EntityCitizenship to create already exists: " + citizenship);
        }
    }
    EntityCitizenshipBo bo = EntityCitizenshipBo.from(citizenship);

    return EntityCitizenshipBo.to(dataObjectService.save(bo));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:IdentityServiceImpl.java

示例6: addEntityTypeContactInfoToEntity

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public EntityTypeContactInfo addEntityTypeContactInfoToEntity(
        EntityTypeContactInfo entityTypeData) throws RiceIllegalArgumentException, RiceIllegalStateException {
    incomingParamCheck(entityTypeData, "entityTypeData");

    if (StringUtils.isBlank(entityTypeData.getEntityId())
            || StringUtils.isBlank(entityTypeData.getEntityTypeCode())) {
        throw new RiceIllegalStateException(
                "EntityTypeData's entityId and entityTypeCode must be populated before creation");
    } else {
        if (getEntityTypeDataBo(entityTypeData.getEntityId(), entityTypeData.getEntityTypeCode()) != null) {
            throw new RiceIllegalStateException("the entityTypeData to create already exists: " + entityTypeData);
        }
    }
    EntityTypeContactInfoBo bo = EntityTypeContactInfoBo.from(entityTypeData);

    return EntityTypeContactInfoBo.to(dataObjectService.save(bo));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:IdentityServiceImpl.java

示例7: removePrincipalFromGroup

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public boolean removePrincipalFromGroup(String principalId, String groupId) throws RiceIllegalArgumentException {
	incomingParamCheck(principalId, "principalId");
    incomingParamCheck(groupId, "groupId");

    List<GroupMemberBo> groupMembers =
		getActiveGroupMembers(groupId, principalId, KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE);

    if(groupMembers.size() == 1) {
    	GroupMemberBo member = groupMembers.iterator().next();
    	member.setActiveToDateValue(new java.sql.Timestamp(DateTime.now().getMillis()));
    	this.dataObjectService.save(member);
        KimImplServiceLocator.getGroupInternalService().updateForUserRemovedFromGroup(member.getMemberId(),
                member.getGroupId());
        return true;
    }

    return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:GroupServiceImpl.java

示例8: getTermSpecificationByNameAndNamespace

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public TermSpecificationDefinition getTermSpecificationByNameAndNamespace(String name, String namespace)
        throws RiceIllegalArgumentException {
    if (name == null || name.trim().isEmpty()) {
        throw new RiceIllegalArgumentException ("name is " + name);
    }
    if (namespace == null || namespace.trim().isEmpty()) {
        throw new RiceIllegalArgumentException ("namespace is " + namespace);
    }
    for (TermSpecificationDefinition info : this.termSpecificationMap.values()) {
        if (namespace.equals(info.getNamespace())) {
            if (name.equals(info.getName())) {
                return info;
            }
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:TermRepositoryServiceMockImpl.java

示例9: createParameter

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
@Transactional
public Parameter createParameter(Parameter parameter) {
    if (parameter == null) {
        throw new RiceIllegalArgumentException("parameter is null");
    }

    final ParameterKey key = ParameterKey.create(parameter.getApplicationId(), parameter.getNamespaceCode(), parameter.getComponentCode(), parameter.getName());
    final Parameter existing = getParameter(key);
    if (existing != null && existing.getApplicationId().equals(parameter.getApplicationId())) {
        throw new RiceIllegalStateException("the parameter to create already exists: " + parameter);
    }
    //Parameter flush needed here to accomodate the fact that the version number is not set until flush
    //and the immediate transform of the object loses its JPA context
    ParameterBo parameterBo = getDataObjectService().save(ParameterBo.from(parameter), PersistenceOption.FLUSH);
    return ParameterBo.to(parameterBo);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:ParameterRepositoryServiceImpl.java

示例10: getRuleFields

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public WorkflowRuleAttributeFields getRuleFields(Map<String, String> parameters,
                                                 ExtensionDefinition extensionDefinition,
                                                 boolean required)
        throws RiceIllegalArgumentException {
    if (parameters == null) {
        parameters = new HashMap<String, String>();
    }
    WorkflowRuleAttribute attribute = loadAttribute(extensionDefinition);
    attribute.setRequired(required);
    List<RemotableAttributeError> errors = attribute.validateRuleData(parameters);
    List<RemotableAttributeField> fields = FieldUtils.convertRowsToAttributeFields(attribute.getRuleRows());
    List<RuleExtensionValue> ruleExtensionValues = attribute.getRuleExtensionValues();
    Map<String, String> ruleExtensionValuesMap = new HashMap<String, String>();
    for (RuleExtensionValue ruleExtensionValue : ruleExtensionValues) {
        ruleExtensionValuesMap.put(ruleExtensionValue.getKey(), ruleExtensionValue.getValue());
    }
    return WorkflowRuleAttributeFields.create(errors, fields, ruleExtensionValuesMap);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:WorkflowRuleAttributeHandlerServiceImpl.java

示例11: addExternalIdentifierToEntity

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public EntityExternalIdentifier addExternalIdentifierToEntity(
        EntityExternalIdentifier externalId) throws RiceIllegalArgumentException, RiceIllegalStateException {
    incomingParamCheck(externalId, "externalId");

    if (StringUtils.isBlank(externalId.getEntityId())
            || StringUtils.isBlank(externalId.getExternalIdentifierTypeCode())) {
        throw new RiceIllegalStateException(
                "EntityExternalIdentifier's entityId and entityTypeCode must be populated before creation");
    } else {
        if (getEntityExternalIdentifierBo(externalId.getEntityId(), externalId.getExternalIdentifierTypeCode())
                != null) {
            throw new RiceIllegalStateException(
                    "the EntityExternalIdentifier to create already exists: " + externalId);
        }
    }
    EntityExternalIdentifierBo bo = EntityExternalIdentifierBo.from(externalId);

    return EntityExternalIdentifierBo.to(dataObjectService.save(bo));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:IdentityServiceImpl.java

示例12: createRule

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public RuleDefinition createRule(RuleDefinition ruleDefinition)
        throws RiceIllegalArgumentException {
    // CREATE
    if (ruleDefinition.getId() != null) {
        RuleDefinition orig = this.getRule(ruleDefinition.getId());
        if (orig != null) {
            throw new RiceIllegalArgumentException(ruleDefinition.getId());
        }
    }
    RuleDefinition.Builder copy = RuleDefinition.Builder.create(ruleDefinition);
    if (copy.getId() == null) {
        copy.setId(UUID.randomUUID().toString());
    }
    ruleDefinition = copy.build();
    ruleMap.put(ruleDefinition.getId(), ruleDefinition);
    return ruleDefinition;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:RuleManagementServiceMockImpl.java

示例13: getRoleMembersFromDerivedRole

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
   public List<RoleMembership> getRoleMembersFromDerivedRole(String namespaceCode, String roleName, Map<String, String> qualification) {
	if (StringUtils.isBlank(namespaceCode)) {
           throw new RiceIllegalArgumentException("namespaceCode was null or blank");
       }

       if (StringUtils.isBlank(roleName)) {
           throw new RiceIllegalArgumentException("roleName was null");
       }
       List<RoleMembership> members = new ArrayList<RoleMembership>();
	if ( qualification != null && !qualification.isEmpty() ) {
	    String principalId = qualification.get(KimConstants.AttributeConstants.PRINCIPAL_ID);
		if (qualification.containsKey(KimConstants.AttributeConstants.PRINCIPAL_ID)
				&& hasDerivedRole(principalId, null, namespaceCode,
						roleName, qualification)) {
               members.add(RoleMembership.Builder.create(null/*roleId*/, null, principalId, MemberType.PRINCIPAL, null).build());
		}
	}
	return members;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:ActionRequestDerivedRoleTypeServiceImpl.java

示例14: loadAttribute

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
private WorkflowRuleAttribute loadAttribute(ExtensionDefinition extensionDefinition) {
    if (extensionDefinition == null) {
        throw new RiceIllegalArgumentException("extensionDefinition was null or blank");
    }
    Object attribute = ExtensionUtils.loadExtension(extensionDefinition);
    if (attribute == null) {
        throw new RiceIllegalArgumentException("Failed to load WorkflowRuleAttribute for: " + extensionDefinition);
    }
    if (!WorkflowRuleAttribute.class.isAssignableFrom(attribute.getClass())) {
        throw new RiceIllegalArgumentException("Failed to locate a WorkflowRuleAttribute with the given name: " + extensionDefinition.getName());
    }
    if (attribute instanceof XmlConfiguredAttribute) {
        ((XmlConfiguredAttribute) attribute).setExtensionDefinition(extensionDefinition);
    }
    return (WorkflowRuleAttribute) attribute;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:WorkflowRuleAttributeHandlerServiceImpl.java

示例15: getCounty

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; //导入依赖的package包/类
@Override
public County getCounty(String countryCode, String stateCode, String code) {
    if (StringUtils.isBlank(countryCode)) {
        throw new RiceIllegalArgumentException(("countryCode is null"));
    }

    if (StringUtils.isBlank(code)) {
        throw new RiceIllegalArgumentException(("code is null"));
    }

    if (StringUtils.isBlank(stateCode)) {
        throw new RiceIllegalArgumentException(("stateCode is null"));
    }

    final Map<String, Object> map = new HashMap<String, Object>();
    map.put("countryCode", countryCode);
    map.put("stateCode", stateCode);
    map.put("code", code);

    return CountyBo.to(getDataObjectService().find(CountyBo.class, new CompoundKey(map)));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:CountyServiceImpl.java


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