本文整理了Java中org.apereo.portal.xml.XmlUtilities
类的一些代码示例,展示了XmlUtilities
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlUtilities
类的具体详情如下:
包路径:org.apereo.portal.xml.XmlUtilities
类名称:XmlUtilities
[英]Defines commonly used XML and XSLT utilities
[中]定义常用的XML和XSLT实用程序
代码示例来源:origin: org.jasig.portal/uPortal-api-rest
protected BufferedXMLEventReader createSourceXmlEventReader(MultipartFile multipartFile)
throws IOException {
final InputStream inputStream = multipartFile.getInputStream();
final String name = multipartFile.getOriginalFilename();
final XMLInputFactory xmlInputFactory = this.xmlUtilities.getXmlInputFactory();
final XMLEventReader xmlEventReader;
try {
xmlEventReader = xmlInputFactory.createXMLEventReader(name, inputStream);
} catch (XMLStreamException e) {
throw new RuntimeException("Failed to create XML Event Reader for data Source", e);
}
return new BufferedXMLEventReader(xmlEventReader, -1);
}
代码示例来源:origin: Jasig/uPortal
@Override
public void afterPropertiesSet() throws Exception {
this.upgradeTemplates = this.xmlUtilities.getTemplates(xslResource);
}
代码示例来源:origin: Jasig/uPortal
@Override
public final Transformer getTransformer(
HttpServletRequest request, HttpServletResponse response) {
final Resource stylesheetResource = this.getStylesheetResource(request);
try {
return this.xmlUtilities.getTransformer(stylesheetResource);
} catch (TransformerConfigurationException e) {
throw new RuntimeException(
"Failed to get Transformer for stylesheet: " + stylesheetResource, e);
} catch (IOException e) {
throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
}
}
代码示例来源:origin: Jasig/uPortal
@Override
public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
final Resource stylesheetResource = this.getStylesheetResource(request);
final Serializable stylesheetCacheKey;
try {
stylesheetCacheKey = this.xmlUtilities.getStylesheetCacheKey(stylesheetResource);
} catch (TransformerConfigurationException e) {
throw new RuntimeException(
"Failed to get Transformer for stylesheet: " + stylesheetResource, e);
} catch (IOException e) {
throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
}
return CacheKey.build(stylesheetResource.getDescription(), stylesheetCacheKey);
}
代码示例来源:origin: Jasig/uPortal
@Override
protected XMLEvent filterEvent(XMLEvent event, boolean peek) {
if (logEvents && logger.isDebugEnabled()) {
if (peek) {
logger.debug("Peek: " + XmlUtilitiesImpl.toString(event));
} else {
logger.debug("Read: " + XmlUtilitiesImpl.toString(event));
}
}
if (logFullDocument && logger.isDebugEnabled()) {
eventBuffer.add(event);
if (event.isEndDocument()) {
final String xmlOutput =
xmlUtilities.serializeXMLEvents(eventBuffer, logFullDocumentAsHtml);
logger.debug(stepIdentifier + "\n" + xmlOutput);
}
}
return event;
}
代码示例来源:origin: org.jasig.portal/uPortal-rendering
final XMLOutputFactory outputFactory = this.xmlUtilities.getHtmlOutputFactory();
final XMLEventWriter xmlEventWriter;
try {
代码示例来源:origin: Jasig/uPortal
sourceNode = xmlUtilities.convertToDom(xmlEventReader);
} catch (XMLStreamException e) {
throw new RuntimeException(
代码示例来源:origin: org.jasig.portal/uPortal-rendering
@Override
public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) {
final Resource stylesheetResource = this.getStylesheetResource(request);
final Serializable stylesheetCacheKey;
try {
stylesheetCacheKey = this.xmlUtilities.getStylesheetCacheKey(stylesheetResource);
} catch (TransformerConfigurationException e) {
throw new RuntimeException(
"Failed to get Transformer for stylesheet: " + stylesheetResource, e);
} catch (IOException e) {
throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
}
return CacheKey.build(stylesheetResource.getDescription(), stylesheetCacheKey);
}
代码示例来源:origin: org.jasig.portal/uPortal-rendering
@Override
protected XMLEvent filterEvent(XMLEvent event, boolean peek) {
if (logEvents && logger.isDebugEnabled()) {
if (peek) {
logger.debug("Peek: " + XmlUtilitiesImpl.toString(event));
} else {
logger.debug("Read: " + XmlUtilitiesImpl.toString(event));
}
}
if (logFullDocument && logger.isDebugEnabled()) {
eventBuffer.add(event);
if (event.isEndDocument()) {
final String xmlOutput =
xmlUtilities.serializeXMLEvents(eventBuffer, logFullDocumentAsHtml);
logger.debug(stepIdentifier + "\n" + xmlOutput);
}
}
return event;
}
代码示例来源:origin: Jasig/uPortal
final XMLOutputFactory outputFactory = this.xmlUtilities.getHtmlOutputFactory();
final XMLEventWriter xmlEventWriter;
try {
代码示例来源:origin: org.jasig.portal/uPortal-io-core
sourceNode = xmlUtilities.convertToDom(xmlEventReader);
} catch (XMLStreamException e) {
throw new RuntimeException(
代码示例来源:origin: org.jasig.portal/uPortal-layout-impl
@Override
public XMLEventReader getUserLayoutReader() {
Document ul = this.getUserLayoutDOM();
if (ul == null) {
throw new PortalException(
"User layout has not been initialized for " + owner.getUserName());
}
final XMLInputFactory xmlInputFactory = this.xmlUtilities.getXmlInputFactory();
final DOMSource layoutSoure = new DOMSource(ul);
try {
return xmlInputFactory.createXMLEventReader(layoutSoure);
} catch (XMLStreamException e) {
throw new RuntimeException(
"Failed to create Layout XMLStreamReader for user: " + owner.getUserName(), e);
}
}
代码示例来源:origin: org.jasig.portal/uPortal-io-core
@Override
public void afterPropertiesSet() throws Exception {
this.upgradeTemplates = this.xmlUtilities.getTemplates(xslResource);
}
代码示例来源:origin: org.jasig.portal/uPortal-rendering
@Override
public final Transformer getTransformer(
HttpServletRequest request, HttpServletResponse response) {
final Resource stylesheetResource = this.getStylesheetResource(request);
try {
return this.xmlUtilities.getTransformer(stylesheetResource);
} catch (TransformerConfigurationException e) {
throw new RuntimeException(
"Failed to get Transformer for stylesheet: " + stylesheetResource, e);
} catch (IOException e) {
throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
}
}
代码示例来源:origin: org.jasig.portal/uPortal-io-core
private BufferedXMLEventReader createSourceXmlEventReader(final Source source) {
// If it is a StAXSource see if we can do better handling of it
if (source instanceof StAXSource) {
final StAXSource staxSource = (StAXSource) source;
XMLEventReader xmlEventReader = staxSource.getXMLEventReader();
if (xmlEventReader != null) {
if (xmlEventReader instanceof BufferedXMLEventReader) {
final BufferedXMLEventReader bufferedXMLEventReader =
(BufferedXMLEventReader) xmlEventReader;
bufferedXMLEventReader.reset();
bufferedXMLEventReader.mark(-1);
return bufferedXMLEventReader;
}
return new BufferedXMLEventReader(xmlEventReader, -1);
}
}
final XMLInputFactory xmlInputFactory = this.xmlUtilities.getXmlInputFactory();
final XMLEventReader xmlEventReader;
try {
xmlEventReader = xmlInputFactory.createXMLEventReader(source);
} catch (XMLStreamException e) {
throw new RuntimeException("Failed to create XML Event Reader for data Source", e);
}
return new BufferedXMLEventReader(xmlEventReader, -1);
}
代码示例来源:origin: Jasig/uPortal
private BufferedXMLEventReader createSourceXmlEventReader(final Source source) {
// If it is a StAXSource see if we can do better handling of it
if (source instanceof StAXSource) {
final StAXSource staxSource = (StAXSource) source;
XMLEventReader xmlEventReader = staxSource.getXMLEventReader();
if (xmlEventReader != null) {
if (xmlEventReader instanceof BufferedXMLEventReader) {
final BufferedXMLEventReader bufferedXMLEventReader =
(BufferedXMLEventReader) xmlEventReader;
bufferedXMLEventReader.reset();
bufferedXMLEventReader.mark(-1);
return bufferedXMLEventReader;
}
return new BufferedXMLEventReader(xmlEventReader, -1);
}
}
final XMLInputFactory xmlInputFactory = this.xmlUtilities.getXmlInputFactory();
final XMLEventReader xmlEventReader;
try {
xmlEventReader = xmlInputFactory.createXMLEventReader(source);
} catch (XMLStreamException e) {
throw new RuntimeException("Failed to create XML Event Reader for data Source", e);
}
return new BufferedXMLEventReader(xmlEventReader, -1);
}
代码示例来源:origin: org.jasig.portal/uPortal-web
final XMLInputFactory xmlInputFactory = this.xmlUtilities.getXmlInputFactory();
final XMLStreamReader xml;
try {
内容来源于网络,如有侵权,请联系作者删除!