本文整理匯總了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);
}
}
示例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()));
}