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


Java Source.getSystemId方法代码示例

本文整理汇总了Java中javax.xml.transform.Source.getSystemId方法的典型用法代码示例。如果您正苦于以下问题:Java Source.getSystemId方法的具体用法?Java Source.getSystemId怎么用?Java Source.getSystemId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.xml.transform.Source的用法示例。


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

示例1: MexEntityResolver

import javax.xml.transform.Source; //导入方法依赖的package包/类
public MexEntityResolver(List<? extends Source> wsdls) throws IOException {
    Transformer transformer = XmlUtil.newTransformer();
    for (Source source : wsdls) {
        XMLStreamBufferResult xsbr = new XMLStreamBufferResult();
        try {
            transformer.transform(source, xsbr);
        } catch (TransformerException e) {
            throw new WebServiceException(e);
        }
        String systemId = source.getSystemId();

        //TODO: can we do anything if the given mex Source has no systemId?
        if(systemId != null){
            SDDocumentSource doc = SDDocumentSource.create(JAXWSUtils.getFileOrURL(systemId), xsbr.getXMLStreamBuffer());
            this.wsdls.put(systemId, doc);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:MexEntityResolver.java

示例2: getTransletBaseName

import javax.xml.transform.Source; //导入方法依赖的package包/类
/**
 * Return the base class name of the translet.
 * The translet name is resolved using the following rules:
 * 1. if the _transletName attribute is set and its value is not "GregorSamsa",
 *    then _transletName is returned.
 * 2. otherwise get the translet name from the base name of the system ID
 * 3. return "GregorSamsa" if the result from step 2 is null.
 *
 * @param source The input Source
 * @return The name of the translet class
 */
private String getTransletBaseName(Source source)
{
    String transletBaseName = null;
    if (!_transletName.equals(DEFAULT_TRANSLET_NAME))
        return _transletName;
    else {
        String systemId = source.getSystemId();
        if (systemId != null) {
            String baseName = Util.baseName(systemId);
            if (baseName != null) {
                baseName = Util.noExtName(baseName);
                transletBaseName = Util.toJavaName(baseName);
            }
        }
    }

    return (transletBaseName != null) ? transletBaseName : DEFAULT_TRANSLET_NAME;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:TransformerFactoryImpl.java

示例3: putDocumentInCache

import javax.xml.transform.Source; //导入方法依赖的package包/类
/**
 * Put the source tree root node in the document cache.
 * TODO: This function needs to be a LOT more sophisticated.
 *
 * @param n The node to cache.
 * @param source The Source object to cache.
 */
public void putDocumentInCache(int n, Source source)
{

  int cachedNode = getNode(source);

  if (DTM.NULL != cachedNode)
  {
    if (!(cachedNode == n))
      throw new RuntimeException(
        "Programmer's Error!  "
        + "putDocumentInCache found reparse of doc: "
        + source.getSystemId());
    return;
  }
  if (null != source.getSystemId())
  {
    m_sourceTree.addElement(new SourceTree(n, source.getSystemId()));
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:SourceTreeManager.java

示例4: buildDocList

import javax.xml.transform.Source; //导入方法依赖的package包/类
/**
 * Convert metadata sources using identity transform. So that we can
 * reuse the Source object multiple times.
 */
private List<SDDocumentSource> buildDocList() {
    List<SDDocumentSource> r = new ArrayList<>();

    if (metadata != null) {
        for (Source source : metadata) {
            try {
                XMLStreamBufferResult xsbr = XmlUtil.identityTransform(source, new XMLStreamBufferResult());
                String systemId = source.getSystemId();

                r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer()));
            } catch (TransformerException | IOException | SAXException | ParserConfigurationException te) {
                throw new ServerRtException("server.rt.err", te);
            }
        }
    }

    return r;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:EndpointImpl.java

示例5: getSystemId

import javax.xml.transform.Source; //导入方法依赖的package包/类
private String getSystemId(WSDLModel model) {
    // # 170429
    File file = model.getModelSource().getLookup().lookup(File.class);
     
    if (file != null) {
        return file.toURI().toString();
    }
    Source source = model.getModelSource().getLookup().lookup(Source.class);

    if (source != null) {
        return source.getSystemId();
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:WSDLInlineSchemaValidator.java

示例6: getNode

import javax.xml.transform.Source; //导入方法依赖的package包/类
/**
   * Given a Source object, find the node associated with it.
   *
   * @param source The Source object to act as the key.
   *
   * @return The node that is associated with the Source, or null if not found.
   */
  public int getNode(Source source)
  {

//    if (source instanceof DOMSource)
//      return ((DOMSource) source).getNode();

    // TODO: Not sure if the BaseID is really the same thing as the ID.
    String url = source.getSystemId();

    if (null == url)
      return DTM.NULL;

    int n = m_sourceTree.size();

    // System.out.println("getNode: "+n);
    for (int i = 0; i < n; i++)
    {
      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);

      // System.out.println("getNode -         url: "+url);
      // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
      if (url.equals(sTree.m_url))
        return sTree.m_root;
    }

    // System.out.println("getNode - returning: "+node);
    return DTM.NULL;
  }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:SourceTreeManager.java


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