public class XmlHelper
extends java.lang.Object
Constructor and Description |
---|
XmlHelper() |
Modifier and Type | Method and Description |
---|---|
protected static XmlNamespaceFinder |
createNamespaceFinder() |
static javax.xml.parsers.SAXParserFactory |
getFactory() |
static java.util.Set<java.lang.String> |
getNamespaces(java.io.File file)
Returns the namespace URIs found in the given XML file
|
static java.util.Set<java.lang.String> |
getNamespaces(org.xml.sax.InputSource source)
Returns the namespace URIs found in the given XML file
|
static java.util.Set<java.lang.String> |
getNamespaces(java.io.InputStream is)
Returns the namespace URIs found in the given XML file
|
static boolean |
hasNamespace(java.io.File file,
java.lang.String... namespaceURis)
Returns true if the file can be parsed as XML and it contains one of the given namespace URs
|
static boolean |
hasNamespace(org.xml.sax.InputSource file,
java.lang.String... namespaceURis)
Returns true if the file can be parsed as XML and it contains one of the given namespace URs
|
static boolean |
hasNamespace(java.io.InputStream file,
java.lang.String... namespaceURis)
Returns true if the file can be parsed as XML and it contains one of the given namespace URs
|
static boolean |
hasNamespace(java.util.Set<java.lang.String> namespaces,
java.lang.String... namespaceURis)
Returns true if the set of namespaces containers one of the given given namespace URIs
|
static void |
setFactory(javax.xml.parsers.SAXParserFactory factory) |
public static boolean hasNamespace(java.io.File file, java.lang.String... namespaceURis)
public static boolean hasNamespace(java.io.InputStream file, java.lang.String... namespaceURis)
public static boolean hasNamespace(org.xml.sax.InputSource file, java.lang.String... namespaceURis)
public static boolean hasNamespace(java.util.Set<java.lang.String> namespaces, java.lang.String... namespaceURis)
namespaces
- namespaceURis
- public static java.util.Set<java.lang.String> getNamespaces(java.io.File file) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public static java.util.Set<java.lang.String> getNamespaces(java.io.InputStream is) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
public static java.util.Set<java.lang.String> getNamespaces(org.xml.sax.InputSource source) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public static javax.xml.parsers.SAXParserFactory getFactory()
public static void setFactory(javax.xml.parsers.SAXParserFactory factory)
protected static XmlNamespaceFinder createNamespaceFinder()
Copyright © 2014 Red Hat. All Rights Reserved.