当前位置: 首页>>代码示例>>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;未经允许,请勿转载。