Package org.jboss.modules.xml

# Class ModuleXmlParser

java.lang.Object
org.jboss.modules.xml.ModuleXmlParser

public final class ModuleXmlParser extends Object
A fast, validating `module.xml` parser.

Author:
  David M. Lloyd, thomas.diesler@jboss.com

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static interface`
`ModuleXmlParser.ResourceRootFactory`
A factory for resource roots, based on a root path, loader path, and loader name.

## Method Summary

Modifier and Type
Method
Description
`static XmlPullParserException`
`endOfDocument(XmlPullParser reader)`
`static ModuleSpec`
`parseModuleXml(ModuleLoader moduleLoader, String moduleName, File root, File moduleInfoFile)`
Parse a `module.xml` file.
`static ModuleSpec`
`parseModuleXml(ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier, File root, File moduleInfoFile)`
Deprecated.
Use `parseModuleXml(ModuleLoader, String, File, File)` instead.
`static ModuleSpec`
`parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, String moduleName)`
Parse a `module.xml` file.
`static ModuleSpec`
`parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier)`
Deprecated.
Use `parseModuleXml(ResourceRootFactory, String, InputStream, String, ModuleLoader, String)` instead.
`static ModuleSpec`
`parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, MavenResolver mavenResolver, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, String moduleName)`
Parse a `module.xml` file.
`static ModuleSpec`
`parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, MavenResolver mavenResolver, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier)`
Deprecated.
Use `parseModuleXml(ResourceRootFactory, MavenResolver, String, InputStream, String, ModuleLoader, String)` instead.
`static ModuleSpec`
`parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, ModuleLoader moduleLoader, String moduleName, File root, File moduleInfoFile)`
Parse a `module.xml` file.
`static XmlPullParserException`
`unexpectedContent(XmlPullParser reader)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### parseModuleXml

@Deprecated public static ModuleSpec parseModuleXml(ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier, File root, File moduleInfoFile) throws ModuleLoadException, IOException
Deprecated.
Use `parseModuleXml(ModuleLoader, String, File, File)` instead.
Parse a `module.xml` file.

Parameters:
  `moduleLoader` - the module loader to use for dependency specifications
  `moduleIdentifier` - the module identifier of the module to load
  `root` - the module path root
  `moduleInfoFile` - the `File` of the `module.xml` content
Returns:
  a module specification
Throws:
  `ModuleLoadException` - if a dependency could not be established or another error occurs
  `IOException` - if I/O fails

### parseModuleXml

public static ModuleSpec parseModuleXml(ModuleLoader moduleLoader, String moduleName, File root, File moduleInfoFile) throws ModuleLoadException, IOException
Parse a `module.xml` file.

Parameters:
  `moduleLoader` - the module loader to use for dependency specifications
  `moduleName` - the name of the module to load
  `root` - the module path root
  `moduleInfoFile` - the `File` of the `module.xml` content
Returns:
  a module specification
Throws:
  `ModuleLoadException` - if a dependency could not be established or another error occurs
  `IOException` - if I/O fails

### parseModuleXml

public static ModuleSpec parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, ModuleLoader moduleLoader, String moduleName, File root, File moduleInfoFile) throws ModuleLoadException, IOException
Parse a `module.xml` file.

Parameters:
  `factory` - the resource root factory to use (must not be `null`)
  `moduleLoader` - the module loader to use for dependency specifications
  `moduleName` - the name of the module to load
  `root` - the module path root
  `moduleInfoFile` - the `File` of the `module.xml` content
Returns:
  a module specification
Throws:
  `ModuleLoadException` - if a dependency could not be established or another error occurs
  `IOException` - if I/O fails

### parseModuleXml

@Deprecated public static ModuleSpec parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier) throws ModuleLoadException, IOException
Deprecated.
Use `parseModuleXml(ResourceRootFactory, String, InputStream, String, ModuleLoader, String)` instead.
Parse a `module.xml` file.

Parameters:
  `factory` - the resource root factory to use (must not be `null`)
  `rootPath` - the root path to send in to the resource root factory (must not be `null`)
  `source` - a stream of the `module.xml` content (must not be `null`)
  `moduleInfoFile` - the `File` of the `module.xml` content (must not be `null`)
  `moduleLoader` - the module loader to use for dependency specifications (must not be `null`)
  `moduleIdentifier` - the module identifier of the module to load
Returns:
  a module specification
Throws:
  `ModuleLoadException` - if a dependency could not be established or another error occurs
  `IOException` - if I/O fails

### parseModuleXml

public static ModuleSpec parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, String moduleName) throws ModuleLoadException, IOException
Parse a `module.xml` file.

Parameters:
  `factory` - the resource root factory to use (must not be `null`)
  `rootPath` - the root path to send in to the resource root factory (must not be `null`)
  `source` - a stream of the `module.xml` content (must not be `null`)
  `moduleInfoFile` - the `File` of the `module.xml` content (must not be `null`)
  `moduleLoader` - the module loader to use for dependency specifications (must not be `null`)
  `moduleName` - the module name of the module to load
Returns:
  a module specification
Throws:
  `ModuleLoadException` - if a dependency could not be established or another error occurs
  `IOException` - if I/O fails

### parseModuleXml

@Deprecated public static ModuleSpec parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, MavenResolver mavenResolver, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier) throws ModuleLoadException, IOException
Deprecated.
Use `parseModuleXml(ResourceRootFactory, MavenResolver, String, InputStream, String, ModuleLoader, String)` instead.
Parse a `module.xml` file.

Parameters:
  `factory` - the resource root factory to use (must not be `null`)
  `mavenResolver` - the Maven artifact resolver to use (must not be `null`)
  `rootPath` - the root path to send in to the resource root factory (must not be `null`)
  `source` - a stream of the `module.xml` content (must not be `null`)
  `moduleInfoFile` - the `File` of the `module.xml` content (must not be `null`)
  `moduleLoader` - the module loader to use for dependency specifications (must not be `null`)
  `moduleIdentifier` - the module identifier of the module to load
Returns:
  a module specification
Throws:
  `ModuleLoadException` - if a dependency could not be established or another error occurs
  `IOException` - if I/O fails

### parseModuleXml

public static ModuleSpec parseModuleXml(ModuleXmlParser.ResourceRootFactory factory, MavenResolver mavenResolver, String rootPath, InputStream source, String moduleInfoFile, ModuleLoader moduleLoader, String moduleName) throws ModuleLoadException, IOException
Parse a `module.xml` file.

Parameters:
  `factory` - the resource root factory to use (must not be `null`)
  `mavenResolver` - the Maven artifact resolver to use (must not be `null`)
  `rootPath` - the root path to send in to the resource root factory (must not be `null`)
  `source` - a stream of the `module.xml` content (must not be `null`)
  `moduleInfoFile` - the `File` of the `module.xml` content (must not be `null`)
  `moduleLoader` - the module loader to use for dependency specifications (must not be `null`)
  `moduleName` - the module name of the module to load
Returns:
  a module specification
Throws:
  `ModuleLoadException` - if a dependency could not be established or another error occurs
  `IOException` - if I/O fails

### unexpectedContent

public static XmlPullParserException unexpectedContent(XmlPullParser reader)

### endOfDocument

public static XmlPullParserException endOfDocument(XmlPullParser reader)