@Component(value="core_Dom4jTools")
public class Dom4jTools
extends java.lang.Object
cuba.dom4j.maxPoolSize
and cuba.dom4j.maxBorrowWaitMillis
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.pool2.impl.GenericObjectPool<javax.xml.parsers.SAXParser> |
pool |
protected CoreProperties |
properties |
protected javax.servlet.ServletContext |
servletContext |
Constructor and Description |
---|
Dom4jTools(CoreProperties properties,
javax.servlet.ServletContext servletContext)
INTERNAL
|
Modifier and Type | Method and Description |
---|---|
protected org.dom4j.io.SAXReader |
getSaxReader(javax.xml.parsers.SAXParser saxParser) |
protected void |
initPool() |
void |
loadMap(org.dom4j.Element mapElement,
java.util.Map<java.lang.String,java.lang.String> map) |
org.dom4j.Document |
readDocument(java.io.File file) |
org.dom4j.Document |
readDocument(java.io.InputStream stream) |
org.dom4j.Document |
readDocument(java.io.Reader reader) |
org.dom4j.Document |
readDocument(java.lang.String xmlString) |
void |
shutdown()
Shuts down the pool, unregisters JMX.
|
void |
storeMap(org.dom4j.Element parentElement,
java.util.Map<java.lang.String,java.lang.String> map) |
void |
walkAttributes(org.dom4j.Element element,
Dom4j.ElementAttributeVisitor visitor) |
void |
walkAttributesRecursive(org.dom4j.Element element,
Dom4j.ElementAttributeVisitor visitor) |
protected <T> T |
withSAXParserFromPool(java.util.function.Function<javax.xml.parsers.SAXParser,T> action) |
java.lang.String |
writeDocument(org.dom4j.Document doc,
boolean prettyPrint) |
void |
writeDocument(org.dom4j.Document doc,
boolean prettyPrint,
java.io.OutputStream stream) |
void |
writeDocument(org.dom4j.Document doc,
boolean prettyPrint,
java.io.Writer writer) |
protected CoreProperties properties
protected javax.servlet.ServletContext servletContext
protected org.apache.commons.pool2.impl.GenericObjectPool<javax.xml.parsers.SAXParser> pool
@Autowired public Dom4jTools(CoreProperties properties, @Nullable javax.servlet.ServletContext servletContext)
protected void initPool()
public void shutdown()
public java.lang.String writeDocument(org.dom4j.Document doc, boolean prettyPrint)
public void writeDocument(org.dom4j.Document doc, boolean prettyPrint, java.io.Writer writer)
public void writeDocument(org.dom4j.Document doc, boolean prettyPrint, java.io.OutputStream stream)
public org.dom4j.Document readDocument(java.io.File file)
public org.dom4j.Document readDocument(java.io.InputStream stream)
public org.dom4j.Document readDocument(java.io.Reader reader)
public org.dom4j.Document readDocument(java.lang.String xmlString)
public void storeMap(org.dom4j.Element parentElement, java.util.Map<java.lang.String,java.lang.String> map)
public void loadMap(org.dom4j.Element mapElement, java.util.Map<java.lang.String,java.lang.String> map)
public void walkAttributesRecursive(org.dom4j.Element element, Dom4j.ElementAttributeVisitor visitor)
public void walkAttributes(org.dom4j.Element element, Dom4j.ElementAttributeVisitor visitor)
protected org.dom4j.io.SAXReader getSaxReader(javax.xml.parsers.SAXParser saxParser)
protected <T> T withSAXParserFromPool(java.util.function.Function<javax.xml.parsers.SAXParser,T> action)