當前位置: 首頁>>代碼示例>>Java>>正文


Java Result.getSystemId方法代碼示例

本文整理匯總了Java中javax.xml.transform.Result.getSystemId方法的典型用法代碼示例。如果您正苦於以下問題:Java Result.getSystemId方法的具體用法?Java Result.getSystemId怎麽用?Java Result.getSystemId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.xml.transform.Result的用法示例。


在下文中一共展示了Result.getSystemId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createOutput

import javax.xml.transform.Result; //導入方法依賴的package包/類
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
    logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName});
    Result r = resolver.createOutput(namespaceUri,suggestedFileName);
    if(r!=null) {
        String sysId = r.getSystemId();
        logger.finer("system ID = "+sysId);
        if(sysId!=null) {
            // TODO: make sure that the system Id is absolute

            // don't use java.net.URI, because it doesn't allow some characters (like SP)
            // which can legally used as file names.

            // but don't use java.net.URL either, because it doesn't allow a made-up URI
            // like kohsuke://foo/bar/zot
        } else
            throw new AssertionError("system ID cannot be null");
    }
    logger.exiting(getClass().getName(),"createOutput",r);
    return r;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:21,代碼來源:FoolProofResolver.java

示例2: doGeneration

import javax.xml.transform.Result; //導入方法依賴的package包/類
/**
 * Performes the actual WSDL generation
 */
public void doGeneration() {
    XmlSerializer serviceWriter;
    XmlSerializer portWriter = null;
    String fileName = mangleName(model.getServiceQName().getLocalPart());
    Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL);
    wsdlLocation = result.getSystemId();
    serviceWriter = new CommentFilter(ResultFactory.createSerializer(result));
    if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) {
        portWriter = serviceWriter;
        schemaPrefix = fileName + "_";
    } else {
        String wsdlName = mangleName(model.getPortTypeName().getLocalPart());
        if (wsdlName.equals(fileName))
            wsdlName += "PortType";
        Holder<String> absWSDLName = new Holder<String>();
        absWSDLName.value = wsdlName + DOT_WSDL;
        result = wsdlResolver.getAbstractWSDL(absWSDLName);

        if (result != null) {
            portWSDLID = result.getSystemId();
            if (portWSDLID.equals(wsdlLocation)) {
                portWriter = serviceWriter;
            } else {
                portWriter = new CommentFilter(ResultFactory.createSerializer(result));
            }
        } else {
            portWSDLID = absWSDLName.value;
        }
        schemaPrefix = new java.io.File(portWSDLID).getName();
        int idx = schemaPrefix.lastIndexOf('.');
        if (idx > 0)
            schemaPrefix = schemaPrefix.substring(0, idx);
        schemaPrefix = mangleName(schemaPrefix) + "_";
    }
    generateDocument(serviceWriter, portWriter);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:40,代碼來源:WSDLGenerator.java


注:本文中的javax.xml.transform.Result.getSystemId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。