• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java StateService类的典型用法和代码示例

java 1次浏览

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

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

示例1: validateStateCode

点赞 3

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * This method retrieves the entered state code and checks that this value is valid by comparing it against known values in the
 * SH_STATE_T database table.
 *
 * @param stateCode
 * @return Whether state code entered is valid
 */
protected boolean validateStateCode(String countryCode, String stateCode) {
    boolean valid = true;

    // Perform lookup for state code provided
    if ( StringUtils.isNotBlank(stateCode) && StringUtils.isNotBlank(countryCode) ) {
    State state = SpringContext.getBean(StateService.class).getState(countryCode, stateCode);

    // If no values returned, state code is invalid, throw error
    if (state== null) {
        putFieldError("subcontractorStateCode", OLEKeyConstants.ERROR_STATE_CODE_INVALID, stateCode);
        valid = false;
    }
    }

    return valid;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:24,
代码来源:SubcontractorRule.java

示例2: validateStateCode

点赞 3

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * This method retrieves the entered state code and checks that this value is valid by comparing it against known values in the
 * SH_STATE_T database table.
 *
 * @param stateCode
 * @return Whether state code entered is valid
 */
protected boolean validateStateCode(String countryCode, String stateCode) {
    boolean valid = true;

    // Perform lookup for state code provided
    if ( StringUtils.isNotBlank(stateCode) && StringUtils.isNotBlank(countryCode) ) {
        State state = SpringContext.getBean(StateService.class).getState(countryCode, stateCode);

        // If no values returned, state code is invalid, throw error
        if (state== null) {
            putFieldError("subcontractorStateCode", KFSKeyConstants.ERROR_STATE_CODE_INVALID, stateCode);
            valid = false;
        }
    }

    return valid;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:24,
代码来源:SubcontractorRule.java

示例3: setupServiceUnderTest

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
@Before
@Override
public void setupServiceUnderTest() {
    super.setupServiceUnderTest();
    StateService remoteProxy =
            harness.publishEndpointAndReturnProxy(StateService.class, this.getStateServiceImpl());
    super.setStateService(remoteProxy);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:9,
代码来源:StateServiceRemoteTest.java

示例4: validateAddress

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
public boolean validateAddress(String postalCountryCode, String stateCode, String postalCode, String statePropertyConstant, String postalCodePropertyConstant) {
    boolean valid = true;

    if (StringUtils.equals(OLEConstants.COUNTRY_CODE_UNITED_STATES, postalCountryCode)) {

        if (StringUtils.isBlank(stateCode)) {
            valid &= false;
            if (StringUtils.isNotBlank(statePropertyConstant)) {
                GlobalVariables.getMessageMap().putError(statePropertyConstant, OLEKeyConstants.ERROR_US_REQUIRES_STATE);
            }
        }

        if (StringUtils.isBlank(postalCode)) {
            valid &= false;
            if (StringUtils.isNotBlank(postalCodePropertyConstant)) {
                GlobalVariables.getMessageMap().putError(postalCodePropertyConstant, OLEKeyConstants.ERROR_US_REQUIRES_ZIP);
            }
        }
        else {
            ZipcodeValidationPattern zipPattern = new ZipcodeValidationPattern();
            if (!zipPattern.matches(StringUtils.defaultString(postalCode))) {
                valid &= false;
                if (StringUtils.isNotBlank(postalCodePropertyConstant)) {
                    GlobalVariables.getMessageMap().putError(postalCodePropertyConstant, OLEKeyConstants.ERROR_POSTAL_CODE_INVALID);
                }
            }
        }

    }

    // verify state code exist
    if (StringUtils.isNotBlank(postalCountryCode) && StringUtils.isNotBlank(stateCode)) {
        State state = SpringContext.getBean(StateService.class).getState(postalCountryCode, stateCode);
        if (state == null) {
            GlobalVariables.getMessageMap().putError(statePropertyConstant, OLEKeyConstants.ERROR_STATE_CODE_INVALID, stateCode);
        }
    }
    
    return valid;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:41,
代码来源:PostalCodeValidationServiceImpl.java

示例5: getKeyValues

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
public List getKeyValues() {

        List<State> codes = SpringContext.getBean(StateService.class).findAllStatesInCountry("US");
        List<KeyValue> labels = new ArrayList<KeyValue>();
        labels.add(new ConcreteKeyValue("", ""));
        for (State state : codes) {
            if(state.isActive()) {
                labels.add(new ConcreteKeyValue(state.getCode(), state.getCode()));
            }
        }

        return labels;
    }
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:14,
代码来源:StateCodeValuesFinder.java

示例6: isValidTaxRegionState

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * This method returns true if the state on tax region state object is valid.
 *
 * @param taxRegionState
 * @return
 */
protected boolean isValidTaxRegionState(TaxRegionState taxRegionState) {
    boolean success = true;

    if ( StringUtils.isNotBlank(taxRegionState.getPostalCountryCode()) && StringUtils.isNotBlank(taxRegionState.getStateCode()) ) {
        State state = SpringContext.getBean(StateService.class).getState(taxRegionState.getPostalCountryCode(),taxRegionState.getStateCode());
    if (ObjectUtils.isNull(state) || !state.isActive()) {
        GlobalVariables.getMessageMap().putError(OLEConstants.TaxRegionConstants.TAX_REGION_STATE_CODE, OLEKeyConstants.ERROR_DOCUMENT_TAX_REGION_INVALID_STATE, taxRegionState.getStateCode());
        success = false;
    }
    }

    return success;
}
 

开发者ID:VU-libtech,
项目名称:OLE-INST,
代码行数:20,
代码来源:TaxRegionRule.java

示例7: getKeyValues

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
 */
@Override
public List<KeyValue> getKeyValues() {

    List<State> codes = SpringContext.getBean(StateService.class).findAllStatesInCountry(KFSConstants.COUNTRY_CODE_UNITED_STATES);
    List<KeyValue> keyvalues = new ArrayList<KeyValue>();
    keyvalues.add(new ConcreteKeyValue(KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING));
    for (State state : codes) {
        if(state.isActive()) {
            keyvalues.add(new ConcreteKeyValue(state.getCode(), state.getCode()));
        }
    }
    return keyvalues;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:17,
代码来源:StateCodeValuesFinder.java

示例8: validateAddress

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
public boolean validateAddress(String postalCountryCode, String stateCode, String postalCode, String statePropertyConstant, String postalCodePropertyConstant) {
    boolean valid = true;

    if (StringUtils.equals(KFSConstants.COUNTRY_CODE_UNITED_STATES, postalCountryCode)) {

        if (StringUtils.isBlank(stateCode)) {
            valid &= false;
            if (StringUtils.isNotBlank(statePropertyConstant)) {
                GlobalVariables.getMessageMap().putError(statePropertyConstant, KFSKeyConstants.ERROR_US_REQUIRES_STATE);
            }
        }

        if (StringUtils.isBlank(postalCode)) {
            valid &= false;
            if (StringUtils.isNotBlank(postalCodePropertyConstant)) {
                GlobalVariables.getMessageMap().putError(postalCodePropertyConstant, KFSKeyConstants.ERROR_US_REQUIRES_ZIP);
            }
        }
        else {
            ZipcodeValidationPattern zipPattern = new ZipcodeValidationPattern();
            if (!zipPattern.matches(StringUtils.defaultString(postalCode))) {
                valid &= false;
                if (StringUtils.isNotBlank(postalCodePropertyConstant)) {
                    GlobalVariables.getMessageMap().putError(postalCodePropertyConstant, KFSKeyConstants.ERROR_POSTAL_CODE_INVALID);
                }
            }
        }

    }

    // verify state code exist
    if (StringUtils.isNotBlank(postalCountryCode) && StringUtils.isNotBlank(stateCode)) {
        State state = SpringContext.getBean(StateService.class).getState(postalCountryCode, stateCode);
        if (state == null) {
            GlobalVariables.getMessageMap().putError(statePropertyConstant, KFSKeyConstants.ERROR_STATE_CODE_INVALID, stateCode);
        }
    }
    
    return valid;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:41,
代码来源:PostalCodeValidationServiceImpl.java

示例9: isValidTaxRegionState

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * This method returns true if the state on tax region state object is valid.
 *
 * @param taxRegionState
 * @return
 */
protected boolean isValidTaxRegionState(TaxRegionState taxRegionState) {
    boolean success = true;

    if ( StringUtils.isNotBlank(taxRegionState.getPostalCountryCode()) && StringUtils.isNotBlank(taxRegionState.getStateCode()) ) {
        State state = SpringContext.getBean(StateService.class).getState(taxRegionState.getPostalCountryCode(),taxRegionState.getStateCode());
        if (ObjectUtils.isNull(state) || !state.isActive()) {
            GlobalVariables.getMessageMap().putError(KFSConstants.TaxRegionConstants.TAX_REGION_STATE_CODE, KFSKeyConstants.ERROR_DOCUMENT_TAX_REGION_INVALID_STATE, taxRegionState.getStateCode());
            success = false;
        }
    }

    return success;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:20,
代码来源:TaxRegionRule.java

示例10: getStateService

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
public static StateService getStateService() {
    return getService(STATE_SERVICE);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:4,
代码来源:LocationApiServiceLocator.java

示例11: getStateService

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
protected StateService getStateService() {
    if (stateService == null) {
        stateService = LocationApiServiceLocator.getStateService();
    }
    return stateService;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:7,
代码来源:LocationRemoteModuleService.java

示例12: getStateService

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * @return the implementation of the StateService to use
 */
public StateService getStateService() {
    return stateService;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:7,
代码来源:TravelPaymentSpecialHandlingStateCodeValidation.java

示例13: getStateService

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
public StateService getStateService() {
    return stateService;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:4,
代码来源:TravelDocumentServiceImpl.java

示例14: setStateService

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
public void setStateService(StateService stateService) {
    this.stateService = stateService;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:4,
代码来源:TravelDocumentServiceImpl.java

示例15: validateOffCampusLocation

点赞 2

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
protected boolean validateOffCampusLocation(Map<LocationField, String> fieldMap, String contactName, String streetAddress, String cityName, String stateCode, String zipCode, String countryCode) {
    boolean valid = true;
    boolean isCountryUS = false;
    if (isBlank(fieldMap, LocationField.COUNTRY_CODE, countryCode)) {
        putError(fieldMap, LocationField.COUNTRY_CODE, CamsKeyConstants.AssetLocation.ERROR_OFFCAMPUS_COUNTRY_REQUIRED);
        valid &= false;
    }
    else {
        isCountryUS = countryCode.equals(KFSConstants.COUNTRY_CODE_UNITED_STATES);
    }

    if (isBlank(fieldMap, LocationField.CONTACT_NAME, contactName)) {
        putError(fieldMap, LocationField.CONTACT_NAME, CamsKeyConstants.AssetLocation.ERROR_OFFCAMPUS_CONTACT_REQUIRED);
        valid &= false;
    }

    if (isBlank(fieldMap, LocationField.STREET_ADDRESS, streetAddress)) {
        putError(fieldMap, LocationField.STREET_ADDRESS, CamsKeyConstants.AssetLocation.ERROR_OFFCAMPUS_ADDRESS_REQUIRED);
        valid &= false;
    }
    if (isBlank(fieldMap, LocationField.CITY_NAME, cityName)) {
        putError(fieldMap, LocationField.CITY_NAME, CamsKeyConstants.AssetLocation.ERROR_OFFCAMPUS_CITY_REQUIRED);
        valid &= false;
    }


    if (isCountryUS) {
        if (isBlank(fieldMap, LocationField.STATE_CODE, stateCode)) {
            putError(fieldMap, LocationField.STATE_CODE, CamsKeyConstants.AssetLocation.ERROR_OFFCAMPUS_STATE_REQUIRED);
            valid &= false;
        }
        if (isBlank(fieldMap, LocationField.ZIP_CODE, zipCode)) {
            putError(fieldMap, LocationField.ZIP_CODE, CamsKeyConstants.AssetLocation.ERROR_OFFCAMPUS_ZIP_REQUIRED);
            valid &= false;
        }
        if (!isBlank(fieldMap, LocationField.STATE_CODE, stateCode)) {
            Map assetLocationMap = new HashMap();
            assetLocationMap.put(KFSPropertyConstants.POSTAL_STATE_CODE, stateCode);
            State locationState = SpringContext.getBean(StateService.class).getState(countryCode, stateCode);
            if (ObjectUtils.isNull(locationState)) {
                putError(fieldMap, LocationField.STATE_CODE, CamsKeyConstants.AssetLocation.ERROR_INVALID_OFF_CAMPUS_STATE, stateCode);
                valid &= false;
            }
        }
    }

    return valid;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:49,
代码来源:AssetLocationServiceImpl.java

示例16: getStateService

点赞 1

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * Gets the stateService attribute.
 * @return Returns the stateService.
 */
public StateService getStateService() {
	return stateService;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:8,
代码来源:PerDiemServiceImpl.java

示例17: setStateService

点赞 1

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * Sets the stateService attribute value.
 * @param stateService The stateService to set.
 */
public void setStateService(StateService stateService) {
	this.stateService = stateService;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:8,
代码来源:PerDiemServiceImpl.java

示例18: setStateService

点赞 1

import org.kuali.rice.location.api.state.StateService; //导入依赖的package包/类
/**
 * Sets the implementation of the StateService to use
 * @param stateService the implementation of the StateService to use
 */
public void setStateService(StateService stateService) {
    this.stateService = stateService;
}
 

开发者ID:kuali,
项目名称:kfs,
代码行数:8,
代码来源:TravelPaymentSpecialHandlingStateCodeValidation.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)