Package net.sf.jasperreports.engine.util
Class JRXmlUtils
- java.lang.Object
-
- net.sf.jasperreports.engine.util.JRXmlUtils
-
public final class JRXmlUtils extends java.lang.ObjectXML parsing utilities.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXCEPTION_MESSAGE_KEY_DOCUMENT_BUILDER_FACTORY_CREATION_FAILUREstatic java.lang.StringEXCEPTION_MESSAGE_KEY_DOCUMENT_PARSING_FAILUREstatic java.lang.StringFEATURE_DISALLOW_DOCTYPEstatic java.lang.StringPROPERTY_ALLOW_DOCTYPE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static booleanallowDoctype()static org.w3c.dom.DocumentcreateDocument(org.w3c.dom.Node sourceNode)static org.w3c.dom.DocumentcreateDocument(org.w3c.dom.Node sourceNode, boolean isNamespaceAware)Creates a document having a node as root.static javax.xml.parsers.DocumentBuildercreateDocumentBuilder()static javax.xml.parsers.DocumentBuildercreateDocumentBuilder(boolean isNamespaceAware)Creates a XML document builder.static org.w3c.dom.Documentparse(java.io.File file)static org.w3c.dom.Documentparse(java.io.File file, boolean isNamespaceAware)Parses a file into a document.static org.w3c.dom.Documentparse(java.io.InputStream is)static org.w3c.dom.Documentparse(java.io.InputStream is, boolean isNamespaceAware)Parses an input stream into a XML document.static org.w3c.dom.Documentparse(java.lang.String uri)static org.w3c.dom.Documentparse(java.lang.String uri, boolean isNamespaceAware)Parses a document specified by an URI.static org.w3c.dom.Documentparse(java.net.URL url)static org.w3c.dom.Documentparse(java.net.URL url, boolean isNamespaceAware)Parses an URL stream as a XML document.static org.w3c.dom.Documentparse(org.xml.sax.InputSource is)static org.w3c.dom.Documentparse(org.xml.sax.InputSource is, boolean isNamespaceAware)Parses an input source into a document.
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_DOCUMENT_BUILDER_FACTORY_CREATION_FAILURE
public static final java.lang.String EXCEPTION_MESSAGE_KEY_DOCUMENT_BUILDER_FACTORY_CREATION_FAILURE
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_DOCUMENT_PARSING_FAILURE
public static final java.lang.String EXCEPTION_MESSAGE_KEY_DOCUMENT_PARSING_FAILURE
- See Also:
- Constant Field Values
-
PROPERTY_ALLOW_DOCTYPE
public static final java.lang.String PROPERTY_ALLOW_DOCTYPE
- See Also:
- Constant Field Values
-
FEATURE_DISALLOW_DOCTYPE
public static final java.lang.String FEATURE_DISALLOW_DOCTYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
public static org.w3c.dom.Document parse(org.xml.sax.InputSource is) throws JRException- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(org.xml.sax.InputSource is, boolean isNamespaceAware) throws JRExceptionParses an input source into a document.- Parameters:
is- the input source- Returns:
- the parsed document
- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.lang.String uri) throws JRException- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.lang.String uri, boolean isNamespaceAware) throws JRExceptionParses a document specified by an URI.- Parameters:
uri- the URI- Returns:
- the parsed document
- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.io.File file) throws JRException- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.io.File file, boolean isNamespaceAware) throws JRExceptionParses a file into a document.- Parameters:
file- the XML file- Returns:
- the document
- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.io.InputStream is) throws JRException- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.io.InputStream is, boolean isNamespaceAware) throws JRExceptionParses an input stream into a XML document.- Parameters:
is- the input stream- Returns:
- the document
- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.net.URL url) throws JRException- Throws:
JRException
-
parse
public static org.w3c.dom.Document parse(java.net.URL url, boolean isNamespaceAware) throws JRExceptionParses an URL stream as a XML document.- Parameters:
url- the URL- Returns:
- the document
- Throws:
JRException
-
createDocumentBuilder
public static javax.xml.parsers.DocumentBuilder createDocumentBuilder() throws JRException- Throws:
JRException
-
createDocumentBuilder
public static javax.xml.parsers.DocumentBuilder createDocumentBuilder(boolean isNamespaceAware) throws JRExceptionCreates a XML document builder.- Returns:
- a XML document builder
- Throws:
JRException
-
allowDoctype
protected static boolean allowDoctype()
-
createDocument
public static org.w3c.dom.Document createDocument(org.w3c.dom.Node sourceNode) throws JRException- Throws:
JRException
-
createDocument
public static org.w3c.dom.Document createDocument(org.w3c.dom.Node sourceNode, boolean isNamespaceAware) throws JRExceptionCreates a document having a node as root.- Parameters:
sourceNode- the node- Returns:
- a document having the specified node as root
- Throws:
JRException
-
-