当前位置: 首页>>代码示例>>Java>>正文


Java MarkupBuilder类代码示例

本文整理汇总了Java中groovy.xml.MarkupBuilder的典型用法代码示例。如果您正苦于以下问题:Java MarkupBuilder类的具体用法?Java MarkupBuilder怎么用?Java MarkupBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MarkupBuilder类属于groovy.xml包,在下文中一共展示了MarkupBuilder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getGPathParamValue

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
private Object getGPathParamValue(String varName, String varType) throws ActivityException {
    Object value = super.getVariableValue(varName);
    com.centurylink.mdw.variable.VariableTranslator translator = VariableTranslator.getTranslator(getPackage(), varType);
    if (translator instanceof DocumentReferenceTranslator) {
        try {
            DocumentReferenceTranslator docRefTranslator = (DocumentReferenceTranslator) translator;
            outputDocumentWriter = new StringWriter();
            if (isOutputDocument(varName)) {
                if (value == null) {
                    MarkupBuilder builder = new MarkupBuilder(outputDocumentWriter);
                    builder.setDoubleQuotes(true);
                    value = builder;
                }
                else {
                    value = new XmlParser().parseText(docRefTranslator.realToString(value));
                }
            }
            else {
                value = new XmlSlurper().parseText(docRefTranslator.realToString(value));
            }
        }
        catch (Exception ex) {
            logger.severeException(ex.getMessage(), ex);
            throw new ActivityException(ex.getMessage(), ex);
        }
    }

    return value;
}
 
开发者ID:CenturyLinkCloud,项目名称:mdw,代码行数:30,代码来源:TransformActivity.java

示例2: getOperationInfo

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
@GET @Path("/{wsdlUrl}/bindings/{bindingName}/operations/{operationName}")
public SOAPOperationInfo getOperationInfo(@PathParam("wsdlUrl") String wsdlUrl, @PathParam("bindingName") String bindingName,
                                          @PathParam("operationName") String operationName) {
    SOAPOperationInfo info = new SOAPOperationInfo();
    WSDLParser parser = new WSDLParser();
    Definitions definition = parser.parse(wsdlUrl);
    StringWriter writer = new StringWriter();
    SOARequestCreator creator = new SOARequestCreator(definition, new RequestTemplateCreator(), new MarkupBuilder(writer));
    creator.createRequest(null, operationName, bindingName);
    info.setSampleRequest(writer.toString());

    return info;
}
 
开发者ID:zheng-wang,项目名称:irontest,代码行数:14,代码来源:WSDLResource.java

示例3: HtmlRenderContext

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
public HtmlRenderContext(MarkupBuilder markupBuilder, Transformer<String, File> relativizer) {
    this.relativizer = relativizer;
    this.markupBuilder = markupBuilder;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:HtmlRenderContext.java

示例4: getSuiteXmlBuilder

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
public MarkupBuilder getSuiteXmlBuilder() {
    return suiteXmlBuilder;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:TestNGOptions.java

示例5: setSuiteXmlBuilder

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
public void setSuiteXmlBuilder(MarkupBuilder suiteXmlBuilder) {
    this.suiteXmlBuilder = suiteXmlBuilder;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:TestNGOptions.java

示例6: xmlBuilder

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
public static MarkupBuilder xmlBuilder(Closure c){
  MarkupBuilder builder = new MarkupBuilder();
  return builder;
}
 
开发者ID:detectiveframework,项目名称:detective,代码行数:5,代码来源:Detective.java

示例7: createSoapTemplate

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
/**
 * Function to create response message template
 *
 * @param SrcWsdl   source wsld : wsdl file path or url
 * @param portType  callback port type
 * @param operation callback operation name
 * @param binding   callback binding
 * @return DOM element of response message template
 * @throws IOException  If error occurred while parsing string xml to Dom element
 * @throws SAXException If error occurred while parsing string xml to Dom element
 */
private static Element createSoapTemplate(String SrcWsdl, String portType, String operation,
                                          String binding)
        throws IOException, SAXException {
    WSDLParser parser = new WSDLParser();

    //BPS-677
    int fileLocationPrefixIndex = SrcWsdl.indexOf(HumanTaskConstants.FILE_LOCATION_FILE_PREFIX);
    if( SrcWsdl.indexOf(HumanTaskConstants.FILE_LOCATION_FILE_PREFIX) != -1 ){
        SrcWsdl = SrcWsdl.substring( fileLocationPrefixIndex + HumanTaskConstants.FILE_LOCATION_FILE_PREFIX
                .length());
    }

    Definitions wsdl = parser.parse(SrcWsdl);

    StringWriter writer = new StringWriter();

    //SOAPRequestCreator constructor: SOARequestCreator(Definitions, Creator, MarkupBuilder)
    SOARequestCreator creator = new SOARequestCreator(wsdl, new RequestTemplateCreator(), new MarkupBuilder(writer));

    //creator.createRequest(PortType name, Operation name, Binding name);
    creator.createRequest(portType, operation, binding);

    Element outGenMessageDom = DOMUtils.stringToDOM(writer.toString());

    Element outMsgElement = null;
    NodeList nodes = outGenMessageDom.getElementsByTagNameNS(outGenMessageDom.getNamespaceURI(), "Body").item(0).getChildNodes();

    if (nodes != null) {
        for (int i = 0; i < nodes.getLength(); i++) {
            if (nodes.item(i).getNodeType() == Node.ELEMENT_NODE) {
                outMsgElement = (Element) nodes.item(i);
                break;
            }
        }
    }

    if (outMsgElement != null) {
        //convert element to string and back to element to remove Owner Document
        return DOMUtils.stringToDOM(DOMUtils.domToString(outMsgElement));
    }

    return null;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:55,代码来源:HTRenderingApiImpl.java

示例8: html

import groovy.xml.MarkupBuilder; //导入依赖的package包/类
/**
 * starts or continues rendering html/angular and returns MarkupBuilder to build html.
 * <pre> g.html().with{
 *  h1("hello")
 *  h2("world")
 * }</pre>
 */
public MarkupBuilder html() {
  startOutputType("%angular");
  return new MarkupBuilder(out);
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:12,代码来源:GObject.java


注:本文中的groovy.xml.MarkupBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。