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


Java NotificationContentTypeBo.getXsd方法代碼示例

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


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

示例1: resolveResource

import org.kuali.rice.ken.bo.NotificationContentTypeBo; //導入方法依賴的package包/類
/**
    * @see org.w3c.dom.ls.LSResourceResolver#resolveResource(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
    */
   public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
       if (!type.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
           return null;
       }

       if (!systemId.startsWith(CONTENT_TYPE_PREFIX)) {
           LOG.warn("Cannot resolve non-ContentType resources");
           return null;
       }

       NotificationContentTypeBo notificationContentType = resolveContentType(systemId);
       if (notificationContentType == null) {
    LOG.error("Unable to resolve system id '" + systemId + "' locally...delegating to default resolution strategy.");
    return null;
}

       Reader reader = new StringReader(notificationContentType.getXsd());
       try {
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           DocumentBuilder builder = factory.newDocumentBuilder();
           DOMImplementation domImpl = builder.getDOMImplementation();
           DOMImplementationLS dils = (DOMImplementationLS) domImpl;
           LSInput input = dils.createLSInput();
           input.setCharacterStream(reader);
           return input;
       } catch (Exception e) {
           throw new RuntimeException(e);
       }
   }
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:33,代碼來源:ContentTypeLSResourceResolver.java

示例2: resolveEntity

import org.kuali.rice.ken.bo.NotificationContentTypeBo; //導入方法依賴的package包/類
/**
 * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
 */
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
    LOG.debug("Resolving '" + publicId + "' / '" + systemId + "'");
    if (!systemId.startsWith(CONTENT_TYPE_PREFIX)) {
        LOG.warn("Cannot resolve non-ContentType resources");
        return null;
    }
    NotificationContentTypeBo notificationContentType = resolveContentType(systemId);
    if (notificationContentType == null) {
        LOG.error("Unable to resolve system id '" + systemId + "' locally...delegating to default resolution strategy.");
        return null;
    }
    LOG.debug("Resolved '" + systemId + "' to " + notificationContentType.getXsd());
    return new InputSource(new StringReader(notificationContentType.getXsd()));
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:18,代碼來源:ContentTypeEntityResolver.java


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