org.xmlpull.v1.builder.XmlElement.setName()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(144)

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

XmlElement.setName介绍

[英]XML Infoset [local name] property.
[中]XML信息集[local name]属性。

代码示例

代码示例来源:origin: xpp3/xpp3

public void setName(String name) {
  target.setName(name);
}

代码示例来源:origin: org.ogce/xpp3

public void setName(String name) {
  target.setName(name);
}

代码示例来源:origin: org.apache.airavata/airavata-workflow-engine

/**
 * @see org.apache.airavata.workflow.engine.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
 */
public void setInput(String name, Object value) throws WorkflowException {
  try {
    if (value instanceof XmlElement) {
      // If the value is a complex type, change the name of the
      // element to the correct one.
      XmlElement valueElement = (XmlElement) value;
      valueElement.setName(name);
    } else if (value instanceof String) {
        if(XMLUtil.isXML((String)value)){
         XmlElement valueElement = XMLUtil.stringToXmlElement3((String) value);
         valueElement.setName(name);
          value = valueElement;
      }
      // Simple case.
    } else {
      // convert int, doule to string.
      value = "" + value;
    }
    this.inputMessage.setObjectPart(name, value);
  } catch (RuntimeException e) {
    String message = "Error in setting an input. name: " + name + " value: " + value;
    throw new WorkflowException(message, e);
  }
}

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

/**
 * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
 */
public void setInput(String name, Object value) throws WorkflowException {
  try {
    if (value instanceof XmlElement) {
      // If the value is a complex type, change the name of the
      // element to the correct one.
      XmlElement valueElement = (XmlElement) value;
      valueElement.setName(name);
    } else if (value instanceof String) {
        if(XMLUtil.isXML((String)value)){
         XmlElement valueElement = XMLUtil.stringToXmlElement3((String) value);
         valueElement.setName(name);
          value = valueElement;
      }
      // Simple case.
    } else {
      // convert int, doule to string.
      value = "" + value;
    }
    this.inputMessage.setObjectPart(name, value);
  } catch (RuntimeException e) {
    String message = "Error in setting an input. name: " + name + " value: " + value;
    throw new WorkflowException(message, e);
  }
}

相关文章