本文整理汇总了Java中com.wm.data.IDataUtil.put方法的典型用法代码示例。如果您正苦于以下问题:Java IDataUtil.put方法的具体用法?Java IDataUtil.put怎么用?Java IDataUtil.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.wm.data.IDataUtil
的用法示例。
在下文中一共展示了IDataUtil.put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filterSample
import com.wm.data.IDataUtil; //导入方法依赖的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.IDataUtil; //导入方法依赖的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.IDataUtil; //导入方法依赖的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.IDataUtil; //导入方法依赖的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.IDataUtil; //导入方法依赖的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.IDataUtil; //导入方法依赖的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: shouldHandleMultipleExpressions
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
@Test
public void shouldHandleMultipleExpressions() {
Map<String, String> exprs = new HashMap<>();
exprs.put("expr1", "foo == 'a'");
exprs.put("expr2", "foo == 'b'");
JexlIDataMatcher jidm = new JexlIDataMatcher(exprs);
IData idata = IDataFactory.create();
IDataCursor idc = idata.getCursor();
IDataUtil.put(idc, "foo", "x");
assertFalse(jidm.match(idata).isMatch());
IDataUtil.put(idc, "foo", "a");
MatchResult m = jidm.match(idata);
assertTrue(m.isMatch());
assertEquals("expr1", m.getId());
IDataUtil.put(idc, "foo", "b");
m = jidm.match(idata);
assertTrue(m.isMatch());
assertEquals("expr2", m.getId());
}
示例8: fromJsonObject
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
/**
* Converts a JSON object to an IData document.
*
* @param input The JSON object to be converted.
* @return The converted IData document.
*/
protected static IData fromJsonObject(JsonObject input) {
if (input == null) return null;
Iterator<String> iterator = input.keySet().iterator();
IData output = IDataFactory.create();
IDataCursor cursor = output.getCursor();
while (iterator.hasNext()) {
String key = iterator.next();
JsonValue value = input.get(key);
IDataUtil.put(cursor, key, fromJsonValue(value));
}
cursor.destroy();
return output;
}
示例9: reflect
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
/**
* Returns information about the service with the given name.
*
* @param serviceName The name of the service to be reflected on.
* @return An IData document containing information about the service.
*/
public static IData reflect(String serviceName) {
if (serviceName == null) return null;
BaseService service = Namespace.getService(NSName.create(serviceName));
if (service == null) return null;
IData output = IDataFactory.create();
IDataCursor cursor = output.getCursor();
IDataUtil.put(cursor, "name", serviceName);
IDataUtil.put(cursor, "type", service.getServiceType().getType());
IDataUtil.put(cursor, "package", service.getPackageName());
IDataHelper.put(cursor, "description", service.getComment(), false);
IDataUtil.put(cursor, "references", getReferences(service.getNSName().getFullName()));
IDataUtil.put(cursor, "dependents", getDependents(service.getNSName().getFullName()));
cursor.destroy();
return output;
}
示例10: introspect
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
public static IData introspect(String pool) {
ReactiveServiceThreadManager manager = ReactiveServiceThreadManager.getInstance();
String s = manager.introspect(pool);
if (s != null) {
String[] n = s.split(";");
if (n.length == 2) {
IData id = IDataFactory.create();
IDataCursor idCur = id.getCursor();
IDataUtil.put(idCur, "size", n[0]);
IDataUtil.put(idCur, "count", n[1]);
idCur.destroy();
return id;
}
}
return null;
}
示例11: decodeFromString
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
/**
* Returns an IData representation of the YAML data.
*
* @param content The String to be decoded.
* @return An IData representation of the given data.
* @throws IOException If an I/O problem occurs.
*/
@Override
public IData decodeFromString(String content) throws IOException {
Object value = normalize(new Yaml().load(content));
IData output;
if (value instanceof IData) {
output = (IData)value;
} else {
output = IDataFactory.create();
IDataCursor cursor = output.getCursor();
IDataUtil.put(cursor, "recordWithNoID", value);
cursor.destroy();
}
return output;
}
示例12: decode
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
/**
* Returns an IData representation of the JSON data in the given input stream.
*
* @param inputStream The input stream to be decoded.
* @param charset The character set to use.
* @return An IData representation of the given input stream data.
* @throws IOException If there is a problem reading from the stream.
*/
public IData decode(InputStream inputStream, Charset charset) throws IOException {
JsonReader reader = jsonReaderFactory.createReader(inputStream, CharsetHelper.normalize(charset));
JsonStructure structure = reader.read();
reader.close();
Object object = fromJsonValue(structure);
IData output = null;
if (object instanceof IData) {
output = (IData)object;
} else if (object instanceof Object[]) {
output = IDataFactory.create();
IDataCursor cursor = output.getCursor();
IDataUtil.put(cursor, "recordWithNoID", object);
cursor.destroy();
}
return output;
}
示例13: testGetAsArrayWithArrayIndex
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
@Test
public void testGetAsArrayWithArrayIndex() throws Exception {
Object[] expected = new String[] { "2" };
Object[] array = new String[] { "1", "2", "3" };
IData document = IDataFactory.create();
IDataCursor cursor = document.getCursor();
IDataUtil.put(cursor, "a", array);
IDataUtil.put(cursor, "b", "4");
cursor.destroy();
Object[] actual = IDataHelper.getAsArray(document, "a[1]");
assertArrayEquals(expected, actual);
assertTrue(actual instanceof String[]);
}
示例14: createWrapperIData
import com.wm.data.IDataUtil; //导入方法依赖的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;
}
示例15: log
import com.wm.data.IDataUtil; //导入方法依赖的package包/类
/**
* Adds an activity log statement to the given BizDocEnvelope.
* TODO: convert this to a pure java service, rather than an invoke of a flow service.
*
* @param bizdoc The BizDocEnvelope to add the activity log statement to.
* @param messageType The type of message to be logged.
* @param messageClass The class of the message to be logged.
* @param messageSummary The summary of the message to be logged.
* @param messageDetails The detail of the message to be logged.
* @throws ServiceException If an error occurs while logging.
*/
public static void log(BizDocEnvelope bizdoc, String messageType, String messageClass, String messageSummary, String messageDetails) throws ServiceException {
IData input = IDataFactory.create();
IDataCursor cursor = input.getCursor();
IDataUtil.put(cursor, "$bizdoc", bizdoc);
IDataUtil.put(cursor, "$type", messageType);
IDataUtil.put(cursor, "$class", messageClass);
IDataUtil.put(cursor, "$summary", messageSummary);
IDataUtil.put(cursor, "$message", messageDetails);
cursor.destroy();
try {
Service.doInvoke(LOG_SERVICE, input);
} catch (Exception ex) {
ExceptionHelper.raise(ex);
}
}