當前位置: 首頁>>代碼示例>>Java>>正文


Java NullArgumentException類代碼示例

本文整理匯總了Java中org.apache.commons.lang.NullArgumentException的典型用法代碼示例。如果您正苦於以下問題:Java NullArgumentException類的具體用法?Java NullArgumentException怎麽用?Java NullArgumentException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NullArgumentException類屬於org.apache.commons.lang包,在下文中一共展示了NullArgumentException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TriggerSpecification

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
/**
 * Instantiates a new trigger specification.
 *
 * @param ldapOperation the LDAP operation
 * @param actionTime the action time
 * @param spSpecs the stored procedure specs
 */
public TriggerSpecification( LdapOperation ldapOperation, ActionTime actionTime, List<SPSpec> spSpecs )
{
    super();
    
    if ( ( ldapOperation == null ) || ( actionTime == null ) || ( spSpecs == null ) )
    {
        throw new NullArgumentException( I18n.err( I18n.ERR_04331 ) );
    }
    
    if ( spSpecs.isEmpty() )
    {
        throw new IllegalArgumentException( I18n.err( I18n.ERR_04332 ) );
    }
    
    this.ldapOperation = ldapOperation;
    this.actionTime = actionTime;
    this.spSpecs = spSpecs;
}
 
開發者ID:apache,項目名稱:directory-ldap-api,代碼行數:26,代碼來源:TriggerSpecification.java

示例2: findJarFileByDir

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
/**
 * 尋找目錄下麵的jar
 * @param dir
 * @return
 */
public static final File[] findJarFileByDir(File dir)
{
	if(dir==null)
	{
		throw new NullArgumentException("dir ==null");
	}
	if(dir.isFile())
	{
		throw new IllegalArgumentException("dir "+dir+" is not a dir");
	}
	if(!dir.exists())
	{
		throw new IllegalArgumentException("dir "+dir+" not found");
	}
	File[] jarFiles = dir.listFiles(new FileFilter() {
		@Override
		public boolean accept(File pathname) 
			{
				return pathname.getName().endsWith(".jar");
			}
		});
	return jarFiles;
}
 
開發者ID:juebanlin,項目名稱:util4j,代碼行數:29,代碼來源:FileUtil.java

示例3: execute

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
@Override
public void execute(String queueName, Task task) {
   	if(shutdown)
   	{
   		rejectTask(task);
   	}
   	if(queueName==null || task ==null)
   	{
   		throw new NullArgumentException("queueName is null");
   	}
   	TaskQueueImpl tasksQueue = getTaskQueue(queueName);
   	if(tasksQueue!=null)
   	{
   		tasksQueue.offer(task);
   	}
}
 
開發者ID:juebanlin,項目名稱:util4j,代碼行數:17,代碼來源:FixedThreadPoolQueuesExecutor.java

示例4: execute

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
@Override
public void execute(String queueName, Task task) {
   	if(queueName==null || task ==null)
   	{
   		throw new NullArgumentException("queueName is null");
   	}
   	if(shutdown)
   	{
   		rejectTask(task);
   	}
   	TaskQueueImpl tasksQueue = getTaskQueue(queueName);
   	if(tasksQueue!=null)
   	{
   		tasksQueue.offer(task);
   	}
}
 
開發者ID:juebanlin,項目名稱:util4j,代碼行數:17,代碼來源:ThreadPoolTaskQueuesExecutor.java

示例5: buildSignatureParams

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
@Override
public Map<String, Object> buildSignatureParams() {
    if (StringUtils.isBlank(this.appId)) {
        throw new NullArgumentException(IWxPay.Const.APP_ID);
    }
    if (StringUtils.isBlank(this.transactionId)
            && StringUtils.isBlank(this.outTradeNo)
            && StringUtils.isBlank(this.outRefundNo)
            && StringUtils.isBlank(this.refundId)) {
        throw new NullArgumentException("");
    }
    //
    Map<String, Object> _params = super.buildSignatureParams();
    _params.put(IWxPay.Const.APP_ID, appId);
    _params.put(IWxPay.Const.DEVICE_INFO, deviceInfo);
    _params.put("transaction_id", transactionId);
    _params.put(IWxPay.Const.OUT_TRADE_NO, outTradeNo);
    _params.put("out_refund_no", outRefundNo);
    _params.put("refund_id", refundId);
    return _params;
}
 
開發者ID:suninformation,項目名稱:ymate-payment-v2,代碼行數:22,代碼來源:WxPayRefundQuery.java

示例6: buildSignatureParams

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
@Override
public Map<String, Object> buildSignatureParams() {
    if (StringUtils.isBlank(this.appId)) {
        throw new NullArgumentException(IWxPay.Const.APP_ID);
    }
    if (StringUtils.isBlank(this.billData)) {
        throw new NullArgumentException("bill_date");
    }
    if (this.billType == null) {
        throw new NullArgumentException("bill_type");
    }
    Map<String, Object> _params = super.buildSignatureParams();
    _params.put(IWxPay.Const.APP_ID, appId);
    _params.put(IWxPay.Const.DEVICE_INFO, deviceInfo);
    _params.put("bill_date", billData);
    _params.put("bill_type", billType.name());
    if (this.tarType) {
        _params.put("tar_type", "GZIP");
    }
    return _params;
}
 
開發者ID:suninformation,項目名稱:ymate-payment-v2,代碼行數:22,代碼來源:WxPayDownloadBill.java

示例7: buildSignatureParams

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
@Override
public Map<String, Object> buildSignatureParams() {
    if (StringUtils.isBlank(this.appId)) {
        throw new NullArgumentException(IWxPay.Const.APP_ID);
    }
    if (StringUtils.isBlank(this.mchBillNo)) {
        throw new NullArgumentException("mch_billno");
    }
    if (StringUtils.isBlank(this.billType)) {
        this.billType = "MCHT";
    }
    Map<String, Object> _params = super.buildSignatureParams();
    _params.put(IWxPay.Const.APP_ID, appId);
    _params.put("mch_billno", mchBillNo);
    _params.put("bill_type", billType);
    return _params;
}
 
開發者ID:suninformation,項目名稱:ymate-payment-v2,代碼行數:18,代碼來源:WxPayRedPackInfo.java

示例8: DefaultModuleCfg

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
public DefaultModuleCfg(YMP owner) {
    Map<String, String> _moduleCfgs = owner.getConfig().getModuleConfigs(IWxPay.MODULE_NAME);
    //
    __accountProvider = ClassUtils.impl(_moduleCfgs.get("account_provider_class"), IWxPayAccountProvider.class, getClass());
    if (__accountProvider == null) {
        __accountProvider = new DefaultWxPayAccountProvider();
        //
        WxPayAccountMeta _meta = new WxPayAccountMeta(_moduleCfgs.get("app_id"),
                _moduleCfgs.get(IWxPay.Const.MCH_ID),
                _moduleCfgs.get(IWxPay.Const.MCH_KEY),
                _moduleCfgs.get("cert_file_path"),
                _moduleCfgs.get(IWxPay.Const.NOTIFY_URL));
        _meta.setSandboxEnabled(BlurObject.bind(_moduleCfgs.get("sandbox_enabled")).toBooleanValue());
        _meta.setSandboxPrefix(StringUtils.defaultIfBlank(_moduleCfgs.get("sandbox_prefix"), "sandboxnew"));
        //
        __defaultAccountId = _meta.getAppId();
        __accountProvider.registerAccount(_meta);
    } else {
        __defaultAccountId = StringUtils.trimToNull(_moduleCfgs.get("default_account_id"));
    }
    //
    __eventHandler = ClassUtils.impl(_moduleCfgs.get("event_handler_class"), IWxPayEventHandler.class, getClass());
    if (__eventHandler == null) {
        throw new NullArgumentException("event_handler_class");
    }
    //
    __jsApiView = StringUtils.defaultIfBlank(_moduleCfgs.get("jsapi_view"), "wxpay_jsapi");
    __nativeView = StringUtils.defaultIfBlank(_moduleCfgs.get("native_view"), "wxpay_native");
    //
    __signCheckDisabled = BlurObject.bind(_moduleCfgs.get("sign_check_disabled")).toBooleanValue();
}
 
開發者ID:suninformation,項目名稱:ymate-payment-v2,代碼行數:32,代碼來源:DefaultModuleCfg.java

示例9: AliPayBaseRequest

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
public AliPayBaseRequest(AliPayAccountMeta accountMeta, String method, String version, DATA bizContent, boolean needNotify, boolean needReturn, IAliPayResponseParser<RESPONSE> responseParser) {
    if (accountMeta == null) {
        throw new NullArgumentException("accountMeta");
    }
    if (StringUtils.isBlank(method)) {
        throw new NullArgumentException("method");
    }
    if (bizContent == null) {
        throw new NullArgumentException("bizContent");
    }
    if (responseParser == null) {
        throw new NullArgumentException("responseParser");
    }
    //
    this.accountMeta = accountMeta;
    this.method = method;
    this.version = StringUtils.defaultIfBlank(version, "1.0");
    this.bizContent = bizContent;
    //
    this.needNotify = needNotify;
    this.needReturn = needReturn;
    //
    this.responseParser = responseParser;
}
 
開發者ID:suninformation,項目名稱:ymate-payment-v2,代碼行數:25,代碼來源:AliPayBaseRequest.java

示例10: AliPayAccountMeta

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
public AliPayAccountMeta(String appId, String signType, String privateKey, String publicKey) {
    if (StringUtils.isBlank(appId)) {
        throw new NullArgumentException("app_id");
    }
    if (StringUtils.isBlank(signType) || !StringUtils.equalsIgnoreCase(signType, IAliPay.Const.SIGN_TYPE_RSA2) && !StringUtils.equalsIgnoreCase(signType, IAliPay.Const.SIGN_TYPE_RSA)) {
        throw new IllegalArgumentException("sign_type");
    }
    if (StringUtils.isBlank(privateKey)) {
        throw new NullArgumentException("private_key");
    }
    if (StringUtils.isBlank(publicKey)) {
        throw new NullArgumentException("public_key");
    }
    this.appId = appId;
    this.signType = IAliPay.SignType.valueOf(signType.toUpperCase());
    this.privateKey = privateKey;
    this.publicKey = publicKey;
}
 
開發者ID:suninformation,項目名稱:ymate-payment-v2,代碼行數:19,代碼來源:AliPayAccountMeta.java

示例11: TradeCloseData

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
public TradeCloseData(String outTradeNo, String tradeNo) {
    if (StringUtils.isBlank(outTradeNo) && StringUtils.isBlank(tradeNo)) {
        throw new NullArgumentException("outTradeNo or tradeNo");
    }
    this.outTradeNo = outTradeNo;
    this.tradeNo = tradeNo;
}
 
開發者ID:suninformation,項目名稱:ymate-payment-v2,代碼行數:8,代碼來源:TradeCloseData.java

示例12: testItemStack

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
@Test
public void testItemStack() {
    
	when(loreGenerator.generateLore(pearl)).thenReturn(new LinkedList<String>());
	
	ItemStack is = pearl.createItemStack();

	// Positive test
	when(loreGenerator.getPearlIdFromItemStack(is)).thenReturn(pearl.getPearlId());
	assertTrue(pearl.validateItemStack(is));
	
	// Negative test
	when(loreGenerator.getPearlIdFromItemStack(is)).thenReturn(0);
	assertFalse(pearl.validateItemStack(is));
	
	// Null arg throws exception
	Throwable e = null;
	try { pearl.validateItemStack(null); } catch (Throwable ex) { e = ex; }
	assertTrue(e instanceof NullArgumentException);
}
 
開發者ID:DevotedMC,項目名稱:ExilePearl,代碼行數:21,代碼來源:CoreExilePearlTest.java

示例13: toURL

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
/**
 * @param filePath 目標文件路徑
 * @return 將文件路徑轉換成URL對象, 返回值可能為NULL, 若想將jar包中文件,必須使用URL.toString()方法生成filePath參數—即以"jar:"開頭
 */
public static URL toURL(String filePath) {
    if (StringUtils.isBlank(filePath)) {
        throw new NullArgumentException("filePath");
    }
    try {
        if (!filePath.startsWith("jar:")
                && !filePath.startsWith("file:")
                && !filePath.startsWith("zip:")
                && !filePath.startsWith("http:")
                && !filePath.startsWith("ftp:")) {

            return new File(filePath).toURI().toURL();
        }
        return new URL(filePath);
    } catch (MalformedURLException e) {
        // DO NOTHING...
    }
    return null;
}
 
開發者ID:suninformation,項目名稱:ymate-platform-v2,代碼行數:24,代碼來源:FileUtils.java

示例14: join

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
/**
 *  Joins the array of values with a given separator and returns the .
 */
public static String join(String[] arrayOfStrings, String separator) {
	boolean appendSeparator = false;
	if(arrayOfStrings!=null) {
		StringBuilder stringBuilder = new StringBuilder();
		for(String string : arrayOfStrings) {
			if(appendSeparator) {
				stringBuilder.append(separator);
			}
			else {
				appendSeparator=true;
			}
			stringBuilder.append(string);
		}
		return stringBuilder.toString();
	}
	else {
		throw new NullArgumentException("arrayOfStrings");
	}
}
 
開發者ID:flipkart-incubator,項目名稱:Poseidon,代碼行數:23,代碼來源:StringUtils.java

示例15: playerJoin

import org.apache.commons.lang.NullArgumentException; //導入依賴的package包/類
/**
 *
 * @param player
 * @return
 */
public Event playerJoin(final Player player) {
    if ((player == null) || !player.isOnline())
        throw new NullArgumentException("Player is null");
    if (!this.hasPlayerJoined(player)) {
        this.joineds.add(player);
        this.updateSigns();

        if (safeInventory()) {
            this.playerBackup(player);
            player.getInventory().clear();
            player.getInventory().setArmorContents(new ItemStack[4]);
        }

        final Location teleportTo = getRandomTeleport("lobby");
        if (teleportTo != null)
            player.teleport(teleportTo);
        else
            EventoZero.consoleMessage("O teleporte (lobby) do evento (" + getName() + ") esta nulo.");
    }
    return this;
}
 
開發者ID:ProjectSandstone,項目名稱:EventoZero,代碼行數:27,代碼來源:Event.java


注:本文中的org.apache.commons.lang.NullArgumentException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。