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