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


Java IDataUtil.remove方法代码示例

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


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

示例1: idataFromClasspathResource

import com.wm.data.IDataUtil; //导入方法依赖的package包/类
protected IData idataFromClasspathResource(String fileName) throws Exception {
	InputStreamReader isr = new InputStreamReader(streamFromClasspathResource(fileName));
	char [] buf = new char[100];
	int len = isr.read(buf);
	boolean isIData = new String(buf,0,len).contains("IData");
	if (isIData) {
		return new IDataXMLCoder().decode(streamFromClasspathResource(fileName));
	} else {
		Document node = new com.wm.lang.xml.Document(streamFromClasspathResource(fileName), null, "UTF-8", false, null, true);
		Values in = new Values();
		DocumentToRecordService dtrs = new DocumentToRecordService(in, false);
		dtrs.setIsXTD(true);
		IData idata = (IData) dtrs.bind(node);
		IDataCursor cursor = idata.getCursor();
		IDataUtil.remove(cursor , "@version"); // Inserted during conversion
		cursor.destroy();
		return idata;
	}
}
 
开发者ID:wmaop,项目名称:wm-jbehave,代码行数:20,代码来源:BaseServiceStep.java

示例2: drop

import com.wm.data.IDataUtil; //导入方法依赖的package包/类
/**
 * Removes the value with the given key from the given IData document.
 *
 * @param document An IData document.
 * @param key      A fully-qualified key identifying the value to be removed from the given IData document.
 * @return         The given IData document.
 */
private static IData drop(IData document, IDataKey key) {
    if (document != null && key != null && key.size() > 0) {
        IDataCursor cursor = document.getCursor();
        IDataKey.Part keyPart = key.remove();

        if (key.size() > 0) {
            if (keyPart.hasArrayIndex()) {
                drop(ArrayHelper.get(toIDataArray(IDataUtil.get(cursor, keyPart.getKey())), keyPart.getIndex()), key);
            } else if (keyPart.hasKeyIndex()) {
                drop(toIData(get(document, keyPart.getKey(), keyPart.getIndex())), key);
            } else {
                Object value = IDataUtil.get(cursor, keyPart.getKey());
                IData[] array = toIDataArray(value);
                if (array != null) {
                    // if we are referencing an IData[], drop the key from all items in the array
                    for (IData item : array) {
                        drop(item, key.clone());
                    }
                } else {
                    drop(toIData(value), key);
                }
            }
        } else {
            if (keyPart.hasArrayIndex()) {
                IDataUtil.put(cursor, keyPart.getKey(), ArrayHelper.drop(IDataUtil.getObjectArray(cursor, keyPart.getKey()), keyPart.getIndex()));
            } else if (keyPart.hasKeyIndex()) {
                drop(document, keyPart.getKey(), keyPart.getIndex());
            } else {
                IDataUtil.remove(cursor, keyPart.getKey());
            }
        }
        cursor.destroy();
    }
    return document;
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:43,代码来源:IDataHelper.java

示例3: remove

import com.wm.data.IDataUtil; //导入方法依赖的package包/类
/**
 * Removes the mapping for a key from this map if it is present (optional operation).
 *
 * @param key   A key whose mapping is to be removed from the map.
 * @return      The previous value associated with key, or null if there was no mapping for key.
 */
@Override
public Object remove(Object key) {
    IDataCursor cursor = this.getCursor();
    Object value = get(key);
    IDataUtil.remove(cursor, (String)key);
    return value;
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:14,代码来源:IDataMap.java

示例4: clearPipeline

import com.wm.data.IDataUtil; //导入方法依赖的package包/类
private void clearPipeline(final IData pipeline)
{
	final IDataCursor cursor = pipeline.getCursor();
	while (cursor.next())
	{
		IDataUtil.remove(cursor, cursor.getKey());
	}
}
 
开发者ID:StefanMacke,项目名称:ao-integrationserver,代码行数:9,代码来源:JavaService.java

示例5: spawn

import com.wm.data.IDataUtil; //导入方法依赖的package包/类
public static final void spawn (IData pipeline)
       throws ServiceException
{
	// --- <<IS-START(spawn)>> ---
	// @sigtype java 3.5
	// [i] field:0:required $serviceName
	// [i] field:0:required $pool
	// [i] field:0:optional $priority {"1","2","3","4","5","6","7","8","9","10"}
	// [i] field:0:optional $deepClone {"true","false"}
	// [o] object:0:required future
	IDataCursor pipelineCur = pipeline.getCursor();
	
	try {
		String serviceName = IDataUtil.getString(pipelineCur, "$serviceName");
		String sPriority = IDataUtil.getString(pipelineCur, "$priority");
		String pool = IDataUtil.getString(pipelineCur, "$pool");
		boolean deepClone = Boolean.valueOf(IDataUtil.getString(pipelineCur, "$deepClone"));
		
		IDataUtil.remove(pipelineCur, "$serviceName");
		IDataUtil.remove(pipelineCur, "$priority");
		IDataUtil.remove(pipelineCur, "$pool");
		IDataUtil.remove(pipelineCur, "$deepClone");
		
		Future future = null;
		if(deepClone) {
			future = ReactiveWMFacade.submit(pool, serviceName, getPriority(sPriority), IDataUtil.deepClone(pipeline));	
		} else {
			future = ReactiveWMFacade.submit(pool, serviceName, getPriority(sPriority), pipeline);
		}
		
		IDataUtil.put(pipelineCur, "future", future);
	} catch(Exception e) {
		throw new ServiceException(e);
	} finally {
		if(pipelineCur != null) {
			pipelineCur.destroy();
		}
	}
		
	// --- <<IS-END>> ---

               
}
 
开发者ID:teivah,项目名称:reactiveWM,代码行数:44,代码来源:pub.java


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