本文整理汇总了Java中com.wm.data.IDataCursor.destroy方法的典型用法代码示例。如果您正苦于以下问题:Java IDataCursor.destroy方法的具体用法?Java IDataCursor.destroy怎么用?Java IDataCursor.destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.wm.data.IDataCursor
的用法示例。
在下文中一共展示了IDataCursor.destroy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filterSample
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public static final void filterSample(IData pipeline) throws ServiceException {
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
// indocs
IData[] indocs = IDataUtil.getIDataArray( pipelineCursor, "indocs" );
pipelineCursor.destroy();
java.util.List<IData> idataList = (java.util.List) Arrays.asList(indocs);
java.util.List<IData> result = idataList.stream()
.filter( idata -> idata.toString().indexOf("street=ABCStreet 42") > -1)
.collect(Collectors.toList());
result.stream()
.forEach(System.out::println);
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
// outdocs
IDataUtil.put( pipelineCursor_1, "outdocs", result.toArray() );
pipelineCursor_1.destroy();
}
开发者ID:ThomasToepperwien,项目名称:webmethods-integrationserver-java8-stream-filtering,代码行数:27,代码来源:Java8Streaming.java
示例2: testGetTopLevelKeys
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
@Test
public void testGetTopLevelKeys() {
List<String> expected = Lists.newArrayList("value1", "value2");
IData idata = IDataFactory.create();
IDataCursor cursor = idata.getCursor();
IDataUtil.put(cursor, "value1", "something");
IDataUtil.put(cursor, "value2", "another one");
cursor.destroy();
Document document = docFactory.wrap(idata);
CollectionUtils.isEqualCollection(expected, document.getKeys());
}
示例3: listEncryptionAlgorithms
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public static final void listEncryptionAlgorithms (IData pipeline)
throws ServiceException
{
// --- <<IS-START(listEncryptionAlgorithms)>> ---
// @specification pgp.specifications:listAlgorithmsSpec
// @subtype unknown
// @sigtype java 3.5
// Return values
IDataCursor pc = pipeline.getCursor();
IDataUtil.put(pc, "algorithms",
PGPInit.listEncryptionAlgorithms().toArray(new String[0]));
pc.destroy();
// --- <<IS-END>> ---
}
示例4: listKeyExchangeAlgorithms
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public static final void listKeyExchangeAlgorithms (IData pipeline)
throws ServiceException
{
// --- <<IS-START(listKeyExchangeAlgorithms)>> ---
// @specification pgp.specifications:listAlgorithmsSpec
// @subtype unknown
// @sigtype java 3.5
// Return values
IDataCursor pc = pipeline.getCursor();
IDataUtil.put(pc, "algorithms",
PGPInit.listKeyExchangeAlgorithms().toArray(new String[0]));
pc.destroy();
// --- <<IS-END>> ---
}
示例5: listSignatureAlgorithms
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public static final void listSignatureAlgorithms (IData pipeline)
throws ServiceException
{
// --- <<IS-START(listSignatureAlgorithms)>> ---
// @specification pgp.specifications:listAlgorithmsSpec
// @subtype unknown
// @sigtype java 3.5
// Return values
IDataCursor pc = pipeline.getCursor();
IDataUtil.put(pc, "algorithms",
PGPInit.listSignatureAlgorithms().toArray(new String[0]));
pc.destroy();
// --- <<IS-END>> ---
}
示例6: enableInterception
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public void enableInterception(IData pipeline) {
IDataCursor pipelineCursor = pipeline.getCursor();
String resourceID = IDataUtil.getString( pipelineCursor, ENABLED );
boolean enabled;
if (resourceID == null || resourceID.length() == 0) {
enabled = AOPChainProcessor.getInstance().isEnabled();
} else {
enabled = Boolean.valueOf(resourceID);
AOPChainProcessor.getInstance().setEnabled(enabled);
}
// pipeline
IDataUtil.put( pipelineCursor, ENABLED, Boolean.toString(enabled) );
pipelineCursor.destroy();
}
示例7: registerException
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public void registerException(IData pipeline) throws ServiceException {
IDataCursor pipelineCursor = pipeline.getCursor();
String adviceId = IDataUtil.getString(pipelineCursor, ADVICE_ID);
String interceptPoint = IDataUtil.getString(pipelineCursor, INTERCEPT_POINT);
String serviceName = IDataUtil.getString(pipelineCursor, SERVICE_NAME);
String pipelineCondition = IDataUtil.getString(pipelineCursor, CONDITION);
String exception = IDataUtil.getString(pipelineCursor, EXCEPTION);
String calledBy = IDataUtil.getString(pipelineCursor, CALLED_BY);
pipelineCursor.destroy();
mandatory(pipeline, "{0} must exist when creating an assertion", ADVICE_ID, INTERCEPT_POINT, SERVICE_NAME, EXCEPTION);
try {
registerInterceptor(adviceId, getRemit(pipeline), interceptPoint, serviceName, pipelineCondition, new ExceptionInterceptor(exception, "WMAOP " + serviceName), calledBy);
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | IllegalArgumentException | SecurityException e) {
throw new ServiceException(e);
}
}
示例8: idataFromClasspathResource
import com.wm.data.IDataCursor; //导入方法依赖的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;
}
}
示例9: getDocumentContents
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
private IData getDocumentContents() throws Exception {
IData idreturn;
IData idata = idataFromClasspathResource(idataFile);
IDataCursor idc = idata.getCursor();
if (IDataUtil.size(idc) == 1) {
IData id = IDataUtil.getIData(idc, documentName);
if (id != null) {
idreturn = id;
} else {
idreturn = idata;
}
} else {
idreturn = idata;
}
idc.destroy();
return idreturn;
}
示例10: parse
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
/**
* Parses a query string.
*
* @param input The query string to be parsed.
* @param charset The character set to use when decoding URI encoded values.
* @param decode Whether to URI decode the values in the query string.
* @return An IData representation of the parsed query string.
*/
public static IData parse(String input, Charset charset, boolean decode) {
if (input == null) return null;
IData output = IDataFactory.create();
IDataCursor outputCursor = output.getCursor();
for (String pair : input.split(QUERY_STRING_KEY_VALUE_PAIR_TOKEN_SEPARATOR)) {
String[] tokens = pair.split(QUERY_STRING_KEY_VALUE_PAIR_EQUALS_OPERATOR, 2);
String name = tokens.length > 0 ? tokens[0] : "";
String value = tokens.length > 1 ? tokens[1] : "";
if (decode) {
name = URIHelper.decode(name, charset);
value = URIHelper.decode(value, charset);
}
outputCursor.insertAfter(name, value);
}
outputCursor.destroy();
return IDataHelper.normalize(output);
}
示例11: getIDataValueList
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
/**
* Returns all the top-level values that are IData compatible objects, including elements in IData[] compatible
* arrays, from the given IData document.
*
* @param document An IData document.
* @return The list of top-level values that are IData compatible objects, including elements in IData[]
* compatible arrays, from the given IData document
*/
@SuppressWarnings("unchecked")
public static List<IData> getIDataValueList(IData document) {
List<IData> values = new ArrayList<IData>(size(document));
if (document != null) {
IDataCursor cursor = document.getCursor();
try {
while (cursor.next()) {
Object value = cursor.getValue();
if (value instanceof IData[] || value instanceof Table || value instanceof IDataCodable[] || value instanceof IDataPortable[] || value instanceof ValuesCodable[]) {
values.addAll(Arrays.asList(toIDataArray(value)));
} else if (value instanceof IData || value instanceof IDataCodable || value instanceof IDataPortable || value instanceof ValuesCodable) {
values.add(toIData(value));
}
}
} finally {
cursor.destroy();
}
}
return values;
}
示例12: convertPrimitiveDataTypes
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
@Test
public void convertPrimitiveDataTypes() throws IDataConversionException
{
final IData iData = IDataFactory.create();
final IDataCursor iDataCursor = iData.getCursor();
IDataUtil.put(iDataCursor, "byte", Byte.MAX_VALUE);
IDataUtil.put(iDataCursor, "short", Short.MAX_VALUE);
IDataUtil.put(iDataCursor, "int", Integer.MAX_VALUE);
IDataUtil.put(iDataCursor, "long", Long.MAX_VALUE);
IDataUtil.put(iDataCursor, "float", Float.MAX_VALUE);
IDataUtil.put(iDataCursor, "double", Double.MAX_VALUE);
IDataUtil.put(iDataCursor, "char", 'a');
IDataUtil.put(iDataCursor, "boolean", true);
iDataCursor.destroy();
assertThat(sut.convertToObject(iData, "byte", Byte.class), is(Byte.MAX_VALUE));
assertThat(sut.convertToObject(iData, "short", Short.class), is(Short.MAX_VALUE));
assertThat(sut.convertToObject(iData, "int", Integer.class), is(Integer.MAX_VALUE));
assertThat(sut.convertToObject(iData, "long", Long.class), is(Long.MAX_VALUE));
assertThat(sut.convertToObject(iData, "float", Float.class), is(Float.MAX_VALUE));
assertThat(sut.convertToObject(iData, "double", Double.class), is(Double.MAX_VALUE));
assertThat(sut.convertToObject(iData, "char", Character.class), is('a'));
assertThat(sut.convertToObject(iData, "boolean", Boolean.class), is(true));
}
示例13: createWrapperIData
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public static IData createWrapperIData(final Wrapper wrapper)
{
final IData input = IDataFactory.create();
final IDataCursor inputCursor = input.getCursor();
IDataUtil.put(inputCursor, "Text", wrapper.Input.Text);
IDataUtil.put(inputCursor, "TheNumber", wrapper.Input.getNumber());
inputCursor.destroy();
final IData output = IDataFactory.create();
final IDataCursor outputCursor = output.getCursor();
IDataUtil.put(outputCursor, "Result", wrapper.Output.Result);
outputCursor.destroy();
final IData expected = IDataFactory.create();
final IDataCursor expectedCursor = expected.getCursor();
IDataUtil.put(expectedCursor, "Input", input);
IDataUtil.put(expectedCursor, "Output", output);
expectedCursor.destroy();
return expected;
}
示例14: encodeToString
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
/**
* Returns a CSV representation of the given IData object.
*
* @param document The IData to convert to CSV.
* @return The CSV representation of the IData.
*/
@Override
public String encodeToString(IData document) throws IOException {
if (document == null) return null;
IDataCursor cursor = document.getCursor();
IData[] records = IDataUtil.getIDataArray(cursor, "recordWithNoID");
cursor.destroy();
if (records == null) return null;
if (records.length == 0) return "";
String[] columns = this.columns;
if (columns == null || columns.length == 0) columns = IDataHelper.getKeys(records);
StringBuilder builder = new StringBuilder();
CSVPrinter printer = new CSVPrinter(builder, formatter(columns));
for (IData record : records) {
if (record != null) printer.printRecord(IDataHelper.getValues(record));
}
return builder.toString();
}
示例15: getPackagePath
import com.wm.data.IDataCursor; //导入方法依赖的package包/类
public static final void getPackagePath (IData pipeline)
throws ServiceException
{
// --- <<IS-START(getPackagePath)>> ---
// @specification pgp.specifications:getPackagePathSpec
// @subtype unknown
// @sigtype java 3.5
// Handle input params
IDataCursor pc = pipeline.getCursor();
String packageName = IDataUtil.getString(pc, "package");
String subdir = IDataUtil.getString(pc, "subDir");
String filename = IDataUtil.getString(pc, "fileName");
if (packageName == null) {
packageName = Service.getServiceEntry().getPackage().getName();
}
String packageDir = Server.getResources().getPackageDir(packageName)
.getAbsolutePath().concat(File.separator);
if (new File(packageDir).exists()) {
if (subdir != null) {
packageDir = packageDir.concat(subdir).concat(File.separator);
}
if (filename != null) {
packageDir = packageDir.concat(filename);
}
IDataUtil.put(pc, "path", packageDir);
}
pc.destroy();
// --- <<IS-END>> ---
}