gpt4 book ai didi

net.sf.taverna.t2.workflowmodel.serialization.xml.XMLDeserializerImpl类的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 18:13:05 25 4
gpt4 key购买 nike

本文整理了Java中net.sf.taverna.t2.workflowmodel.serialization.xml.XMLDeserializerImpl类的一些代码示例,展示了XMLDeserializerImpl类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLDeserializerImpl类的具体详情如下:
包路径:net.sf.taverna.t2.workflowmodel.serialization.xml.XMLDeserializerImpl
类名称:XMLDeserializerImpl

XMLDeserializerImpl介绍

[英]Implementation class that acts as the main entry point for deserialising a complete XML dataflow document into a dataflow instance.
[中]作为将完整的XML数据流文档反序列化为数据流实例的主要入口点的实现类。

代码示例

代码示例来源:origin: net.sf.taverna.t2.integration-testing/integration-testing-common

protected Dataflow loadDataflow(String resourceName) throws Exception {
    XMLDeserializer deserializer = new XMLDeserializerImpl();
    InputStream inStream = InvocationTestHelper.class.getResourceAsStream("/t2flow/" + resourceName);
    if (inStream==null) throw new IOException("Unable to find resource for t2 dataflow:"+resourceName);
    SAXBuilder builder = new SAXBuilder();
    Element el= builder.build(inStream).detachRootElement();
    return deserializer.deserializeDataflow(el);
  }
}

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

public Dataflow deserializeDataflow(Element element)
    throws DeserializationException,EditException {
  Element topDataflow = findTopDataflow(element);
  if (topDataflow==null) throw new DeserializationException("No top level workflow defined in the XML document");
  Map<String,Element> innerDataflowElements = gatherInnerDataflows(element);
  try {
    return DataflowXMLDeserializer.getInstance().deserializeDataflow(topDataflow,innerDataflowElements);
  } catch (Exception e) {
    throw new DeserializationException("An error occurred deserializing the workflow:"+e.getMessage(),e);
  }
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/dataflow-activity-ui

protected Dataflow copyDataflow(Dataflow dataflow)
    throws SerializationException, DeserializationException,
    EditException {
  XMLSerializer xmlSerializer = new XMLSerializerImpl();
  Element dataflowElement = xmlSerializer.serializeDataflow(dataflow);
  XMLDeserializer xmlDeserializer = new XMLDeserializerImpl();
  return xmlDeserializer.deserializeDataflow(dataflowElement);
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

public Dataflow deserializeDataflow(Element element)
    throws DeserializationException,EditException {
  Element topDataflow = findTopDataflow(element);
  if (topDataflow==null) throw new DeserializationException("No top level dataflow defined in the XML document");
  Map<String,Element> innerDataflowElements = gatherInnerDataflows(element);
  try {
    return DataflowXMLDeserializer.getInstance().deserializeDataflow(topDataflow,innerDataflowElements);
  } catch (Exception e) {
    throw new DeserializationException("An error occurred deserializing the dataflow:"+e.getMessage(),e);
  }
}

代码示例来源:origin: net.sf.taverna.t2.activities/dataflow-activity-ui

protected Dataflow copyDataflow(Dataflow dataflow)
    throws SerializationException, DeserializationException,
    EditException {
  XMLSerializer xmlSerializer = new XMLSerializerImpl();
  Element dataflowElement = xmlSerializer.serializeDataflow(dataflow);
  XMLDeserializer xmlDeserializer = new XMLDeserializerImpl();
  return xmlDeserializer.deserializeDataflow(dataflowElement);
}

代码示例来源:origin: net.sf.taverna.t2.workbench/file-impl

protected Dataflow openDataflowStream(InputStream workflowXMLstream)
    throws OpenException {
  XMLDeserializer deserializer = new XMLDeserializerImpl();
  SAXBuilder builder = new SAXBuilder();
  Document document;
  try {
    document = builder.build(workflowXMLstream);
  } catch (JDOMException e) {
    throw new OpenException("Could not parse XML of dataflow", e);
  } catch (IOException e) {
    throw new OpenException("Could not read dataflow", e);
  }
  Dataflow dataflow;
  try {
    dataflow = deserializer.deserializeDataflow(document
        .getRootElement());
  } catch (DeserializationException e) {
    throw new OpenException("Could not deserialise dataflow ", e);
  } catch (EditException e) {
    throw new OpenException("Could not construct dataflow ", e);
  }
  return dataflow;
}

代码示例来源:origin: net.sf.taverna.t2.ui-impl/file-impl

protected Dataflow openDataflowStream(InputStream workflowXMLstream)
    throws OpenException {
  XMLDeserializer deserializer = new XMLDeserializerImpl();
  SAXBuilder builder = new SAXBuilder();
  Document document;
  try {
    document = builder.build(workflowXMLstream);
  } catch (JDOMException e) {
    throw new OpenException("Could not parse XML of the workflow", e);
  } catch (IOException e) {
    throw new OpenException("Could not open the workflow file for parsing", e);
  }
  Dataflow dataflow;
  try {
    dataflow = deserializer.deserializeDataflow(document
        .getRootElement());
  } catch (DeserializationException e) {
    throw new OpenException("Could not deserialise the workflow", e);
  } catch (EditException e) {
    throw new OpenException("Could not construct the workflow", e);
  }
  return dataflow;
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/dataflow-activity-ui

/**
 * Make a copy of a dataflow by serializing and deserializing.
 * 
 * @param source
 *            Dataflow to copy
 * @return A copy of the dataflow.
 * @throws DeserializationException
 *             If a copy could not be made
 * @throws EditException
 *             If a copy could not be made
 * @throws SerializationException
 *             If a copy could not be made
 */
public static Dataflow copyWorkflow(Dataflow source)
    throws DeserializationException, EditException,
    SerializationException {
  XMLSerializer serialiser = new XMLSerializerImpl();
  XMLDeserializer deserializer = new XMLDeserializerImpl();
  return deserializer.deserializeDataflow(serialiser
      .serializeDataflow(source));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com