本文整理汇总了Java中org.apache.taverna.scufl2.api.configurations.Configuration.setParent方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.setParent方法的具体用法?Java Configuration.setParent怎么用?Java Configuration.setParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.taverna.scufl2.api.configurations.Configuration
的用法示例。
在下文中一共展示了Configuration.setParent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configurationNotAddedTwice
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
/**
* Similar bug to {@link DataLinkCompareTest#dataLinkNotAddedTwice()}
*/
@Test
public void configurationNotAddedTwice() throws Exception {
Configuration c1a = new Configuration("c1");
Profile p1 = new Profile("p1");
p1.getConfigurations().add(c1a);
c1a.setParent(p1);
p1.getConfigurations().add(c1a);
Configuration c1b = new Configuration("c1");
Profile p2 = new Profile("p2");
p2.getConfigurations().add(c1b);
c1b.setParent(p2);
p2.getConfigurations().add(c1b);
WorkflowBundle bundle = new WorkflowBundle();
p1.setParent(bundle);
p2.setParent(bundle);
new Scufl2Tools().setParents(bundle);
assertEquals(1, p1.getConfigurations().size());
assertEquals(1, p2.getConfigurations().size());
}
示例2: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
ComponentConfig config = unmarshallConfig(t2FlowParser, configBean,
"xstream", ComponentConfig.class);
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(ACTIVITY_URI.resolve("#Config"));
json.put("registryBase", config.getRegistryBase());
json.put("familyName", config.getFamilyName());
json.put("componentName", config.getComponentName());
if (config.getComponentVersion() != null)
json.put("componentVersion", (int) config.getComponentVersion());
return configuration;
}
示例3: parseScuflObject
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public void parseScuflObject(Object o) {
StringconstantType sc = (StringconstantType) o;
Configuration configuration = new Configuration();
configuration.setParent(getParserState().getCurrentProfile());
configuration.setType(CONSTANT.resolve("#Config"));
((ObjectNode) configuration.getJson()).put("string", sc.getValue());
Activity activity = new Activity();
getParserState().setCurrentActivity(activity);
activity.setParent(getParserState().getCurrentProfile());
activity.setType(CONSTANT);
OutputActivityPort valuePort = new OutputActivityPort(activity, VALUE);
valuePort.setDepth(0);
valuePort.setGranularDepth(0);
configuration.setConfigures(activity);
ProcessorBinding pb = new ProcessorBinding();
pb.setParent(getParserState().getCurrentProfile());
pb.setBoundProcessor(getParserState().getCurrentProcessor());
pb.setBoundActivity(activity);
}
示例4: createConfigurationFor
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public Configuration createConfigurationFor(Activity activity,
URI configType) {
Profile profile = activity.getParent();
Configuration config = new Configuration(activity.getName());
profile.getConfigurations().addWithUniqueName(config);
config.setParent(profile);
config.setConfigures(activity);
config.setType(configType);
return config;
}
示例5: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
SoaplabConfig soaplabConfig = unmarshallConfig(t2FlowParser,
configBean, "xstream", SoaplabConfig.class);
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(scufl2Uri.resolve("#Config"));
String endpoint = soaplabConfig.getEndpoint();
if (endpoint == null || endpoint.isEmpty())
throw new ReaderException("Soablab config has no endpoint set");
json.put("endpoint", endpoint);
double pollingBackoff = soaplabConfig.getPollingBackoff();
json.put("pollingBackoff", pollingBackoff);
BigInteger pollingInterval = soaplabConfig.getPollingInterval();
if (pollingInterval != null)
json.put("pollingInterval", pollingInterval.intValue());
BigInteger pollingIntervalMax = soaplabConfig.getPollingIntervalMax();
if (pollingIntervalMax != null)
json.put("pollingIntervalMax", pollingIntervalMax.intValue());
return configuration;
}
示例6: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(ACTIVITY_URI.resolve("#Config"));
json.put("martQuery",
T2FlowParser.elementToXML((Element) configBean.getAny()));
return configuration;
}
示例7: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
XPathConfig xpathConfig = unmarshallConfig(t2FlowParser, configBean,
"xstream", XPathConfig.class);
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
parserState.setCurrentConfiguration(configuration);
try {
ObjectNode json = (ObjectNode)configuration.getJson();
configuration.setType(ACTIVITY_URI.resolve("#Config"));
String xmlDocument = xpathConfig.getXmlDocument();
if (xmlDocument != null) {
json.put("exampleXmlDocument", xmlDocument);
}
String xpathExpression = xpathConfig.getXpathExpression();
json.put("xpathExpression", xpathExpression);
ArrayNode namespaceMap = json.arrayNode();
json.put("xpathNamespaceMap", namespaceMap);
// TODO look at why the schema translation here is so wrong
for (Entry list : xpathConfig.getXpathNamespaceMap().getEntry()) {
String namespacePrefix = list.getContent().get(0).getValue();
String namespaceURI = list.getContent().get(1).getValue();
ObjectNode map = json.objectNode();
map.put("prefix", namespacePrefix);
map.put("uri", namespaceURI);
namespaceMap.add(map);
}
} finally {
parserState.setCurrentConfiguration(null);
}
return configuration;
}
示例8: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser, ConfigBean configBean,
ParserState parserState) throws ReaderException {
SpreadsheetImportConfig config = unmarshallConfig(t2FlowParser, configBean, "xstream",
SpreadsheetImportConfig.class);
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(ACTIVITY_URI.resolve("#Config"));
ObjectNode columnRange = json.objectNode();
json.put("columnRange", columnRange);
makeRange(config.getColumnRange(), columnRange);
ObjectNode rowRange = json.objectNode();
json.put("rowRange", rowRange);
makeRange(config.getRowRange(), rowRange);
if (config.getEmptyCellValue() != null)
json.put("emptyCellValue", config.getEmptyCellValue());
ArrayNode columnNames = json.arrayNode();
if (config.getColumnNames() != null && config.getColumnNames().getEntry() != null) {
for (SpreadsheetColumnNameEntry entry : config.getColumnNames().getEntry()) {
ObjectNode mapping = json.objectNode();
columnNames.add(mapping);
mapping.put("column", entry.getString().get(0));
mapping.put("port", entry.getString().get(1));
}
if (columnNames.size() > 0)
json.put("columnNames", columnNames);
}
json.put("allRows", config.isAllRows());
json.put("excludeFirstRow", config.isExcludeFirstRow());
json.put("ignoreBlankRows", config.isIgnoreBlankRows());
if (config.getEmptyCellPolicy() != null)
json.put("emptyCellPolicy", config.getEmptyCellPolicy().value());
if (config.getOutputFormat() != null)
json.put("outputFormat", config.getOutputFormat().value());
if (config.getCsvDelimiter() != null)
json.put("csvDelimiter", config.getCsvDelimiter());
return configuration;
}
示例9: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
ApiConsumerConfig config = unmarshallConfig(t2FlowParser, configBean,
"xstream", ApiConsumerConfig.class);
Configuration configuration = new Configuration();
configuration.setParent(parserState.getCurrentProfile());
ObjectNode json = (ObjectNode) configuration.getJson();
configuration.setType(ACTIVITY_URI.resolve("#Config"));
json.put("apiConsumerDescription", config.getApiConsumerDescription());
json.put("apiConsumerName", config.getApiConsumerName());
json.put("description", config.getDescription());
json.put("className", config.getClassName());
json.put("methodName", config.getMethodName());
ArrayNode parameterNames = json.arrayNode();
json.put("parameterNames", parameterNames);
for (String parameterName : config.getParameterNames().getString())
parameterNames.add(parameterName);
ArrayNode parameterDimensions = json.arrayNode();
json.put("parameterDimensions", parameterDimensions);
for (BigInteger parameterDimension : config.getParameterDimensions()
.getInt())
parameterDimensions.add(parameterDimension.intValue());
ArrayNode parameterTypes = json.arrayNode();
json.put("parameterTypes", parameterTypes);
for (String parameterType : config.getParameterTypes().getString())
parameterTypes.add(parameterType);
json.put("returnType", config.getReturnType());
json.put("returnDimension", config.getReturnDimension().intValue());
json.put("isMethodConstructor", config.isIsMethodConstructor());
json.put("isMethodStatic", config.isIsMethodStatic());
return configuration;
}
示例10: makeConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
private void makeConfiguration() {
URI BEANSHELL = URI
.create("http://ns.taverna.org.uk/2010/activity/beanshell");
/**
* Most activities also require a configuration in order to run. The
* name of the configuration is not important, but must be unique within
* the configurations of a profile. The default constructor
* Configuration() generates a UUID-based name as a fallback.
*/
Configuration beanshellConfig = new Configuration("beanshellConf");
/**
* The activity we configure. (DispatchStackLayer can also be
* configured)
*/
beanshellConfig.setConfigures(myBeanshell);
/**
* A configuration is of a specified type (specified as an URI), which
* is typically related to (but different from) the activity type - but
* might in some cases be shared amongst several activity types.
*/
beanshellConfig.setType(BEANSHELL.resolve("#Config"));
/**
* Configurations are normally shared in the same profile as the
* activity they configure (the parent) - but in some cases might also
* be added by other profiles in order to reuse a configuration across
* profiles. (Note: A profile is *stored* within its parent profile).
*/
beanshellConfig.setParent(profile);
profile.getConfigurations().add(beanshellConfig);
/**
* Depending on the configuration type specified above, certain
* *properties* should be specified, and other properties might be
* optional. In this case, only "script" is
* specified, as a string value. (more complex properties can be
* specified using Jackson JSON methods of the ObjectNode)
*/
beanshellConfig.getJsonAsObjectNode().put("script", "out1 = in1");
/**
* Note that property names are specified as URIs, which are often
* related to the URI of the configuration type - but might be reused
* across several configuration types.
*/
}