Top Description Inners Fields Constructors Methods
org.jboss.modules.xml

public final Class ModuleXmlParser

extends Object
Class Inheritance
Imports
java.io.BufferedInputStream, .Closeable, .File, .FileInputStream, .FileNotFoundException, .FileOutputStream, .IOException, .InputStream, .OutputStream, java.util.ArrayList, .Arrays, .Collections, .Enumeration, .HashSet, .Iterator, .List, .Locale, .Set, java.util.jar.JarFile, java.util.zip.ZipEntry, .ZipFile, org.jboss.modules.AssertionSetting, .DependencySpec, .LocalDependencySpecBuilder, .ModuleDependencySpec, .ModuleDependencySpecBuilder, .Version, .VersionDetection, .ModuleIdentifier, .ModuleLoadException, .ModuleLoader, .ModuleSpec, .NativeLibraryResourceLoader, .PathUtils, .ResourceLoader, .ResourceLoaderSpec, .ResourceLoaders, org.jboss.modules.maven.ArtifactCoordinates, .MavenResolver, org.jboss.modules.filter.MultiplePathFilterBuilder, .PathFilter, .PathFilters, org.jboss.modules.security.FactoryPermissionCollection, .ModularPermissionFactory, .PermissionFactory

A fast, validating module.xml parser.
Authors
David M. Lloyd, [email protected]

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
private static interface
ModuleXmlParser.PropertiesCallback

XML parsing callback for property elements.

public static interface
ModuleXmlParser.ResourceRootFactory

A factory for resource roots, based on a root path, loader path, and loader name.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
pack-priv static final ModuleDependencySpec
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final List<String>
private static final List<String>
private static final List<String>
private static final List<String>
private static final List<String>
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static ModuleXmlParser.PropertiesCallback

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
private static boolean
atLeast1_6(final XmlPullParser reader)

private static boolean
atLeast1_7(final XmlPullParser reader)

private static boolean
atLeast1_8(final XmlPullParser reader)

private static boolean
atLeast1_9(final XmlPullParser reader)

private static void
private static void
createMavenNativeArtifactLoader(final MavenResolver mavenResolver, final String name, final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

public static XmlPullParserException
private static void
expandName(final ModuleLoader moduleLoader, final String moduleName, final ArrayList<PermissionFactory> list, String permission, String name, String actions)

private static ModuleXmlParser.PropertiesCallback

Returns:

a no-op implementation of properties callback
getNoopPropsCallback
()

Returns a no-op implementation of properties callback currently used for parsing properties attached to module dependencies that aren't used at runtime in jboss-modules but are important in other projects where module dependencies are analyzed.

private static XmlPullParserException
invalidModuleName(final XmlPullParser reader, final String expected)

private static XmlPullParserException
missingAttributes(final XmlPullParser reader, final Set<String> required)

private static Version
parseArtifact(final ModuleXmlParser.ResourceRootFactory factory, final MavenResolver mavenResolver, final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

private static String
private static void
private static void
private static void
parseDependencies(final XmlPullParser reader, final ArrayList<DependencySpec> dependencies)

private static ModuleSpec
parseDocument(final MavenResolver mavenResolver, final ModuleXmlParser.ResourceRootFactory factory, final String rootPath, XmlPullParser reader, final ModuleLoader moduleLoader, final String moduleName)

private static void
private static void
private static void
parseGrant(final XmlPullParser reader, final ModuleLoader moduleLoader, final String moduleName, final ArrayList<PermissionFactory> list)

private static void
parseMainClass(final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

private static void
parseModuleAbsentContents(final XmlPullParser reader, final String moduleName)

private static ModuleSpec
parseModuleAliasContents(final XmlPullParser reader, final String moduleName)

private static ModuleSpec.Builder
parseModuleContents(final MavenResolver mavenResolver, final XmlPullParser reader, final ModuleXmlParser.ResourceRootFactory factory, final ModuleLoader moduleLoader, final String moduleName, final String rootPath)

private static void
parseModuleDependency(final XmlPullParser reader, final ArrayList<DependencySpec> dependencies)

public static ModuleSpec

Returns:

a module specification
parseModuleXml
(final ModuleLoader
the module loader to use for dependency specifications
moduleLoader
,
final ModuleIdentifier
the module identifier of the module to load
moduleIdentifier
,
final File
the module path root
root
,
final File
the File of the module.xml content
moduleInfoFile
)

Parse a module.xml file.
public static ModuleSpec

Returns:

a module specification
parseModuleXml
(final ModuleLoader
the module loader to use for dependency specifications
moduleLoader
,
final String
the name of the module to load
moduleName
,
final File
the module path root
root
,
final File
the File of the module.xml content
moduleInfoFile
)

Parse a module.xml file.

public static ModuleSpec

Returns:

a module specification
parseModuleXml
(final ModuleXmlParser.ResourceRootFactory
the resource root factory to use (must not be null)
factory
,
final ModuleLoader
the module loader to use for dependency specifications
moduleLoader
,
final String
the name of the module to load
moduleName
,
final File
the module path root
root
,
final File
the File of the module.xml content
moduleInfoFile
)

Parse a module.xml file.

public static ModuleSpec

Returns:

a module specification
parseModuleXml
(final ModuleXmlParser.ResourceRootFactory
the resource root factory to use (must not be null)
factory
,
final String
the root path to send in to the resource root factory (must not be null)
rootPath
,
InputStream
a stream of the module.xml content (must not be null)
source
,
final String
the File of the module.xml content (must not be null)
moduleInfoFile
,
final ModuleLoader
the module loader to use for dependency specifications (must not be null)
moduleLoader
,
final ModuleIdentifier
the module identifier of the module to load
moduleIdentifier
)

Parse a module.xml file.
public static ModuleSpec

Returns:

a module specification
parseModuleXml
(final ModuleXmlParser.ResourceRootFactory
the resource root factory to use (must not be null)
factory
,
final String
the root path to send in to the resource root factory (must not be null)
rootPath
,
InputStream
a stream of the module.xml content (must not be null)
source
,
final String
the File of the module.xml content (must not be null)
moduleInfoFile
,
final ModuleLoader
the module loader to use for dependency specifications (must not be null)
moduleLoader
,
final String
the module name of the module to load
moduleName
)

Parse a module.xml file.

public static ModuleSpec

Returns:

a module specification
parseModuleXml
(final ModuleXmlParser.ResourceRootFactory
the resource root factory to use (must not be null)
factory
,
final MavenResolver
the Maven artifact resolver to use (must not be null)
mavenResolver
,
final String
the root path to send in to the resource root factory (must not be null)
rootPath
,
InputStream
a stream of the module.xml content (must not be null)
source
,
final String
the File of the module.xml content (must not be null)
moduleInfoFile
,
final ModuleLoader
the module loader to use for dependency specifications (must not be null)
moduleLoader
,
final ModuleIdentifier
the module identifier of the module to load
moduleIdentifier
)

Parse a module.xml file.
public static ModuleSpec

Returns:

a module specification
parseModuleXml
(final ModuleXmlParser.ResourceRootFactory
the resource root factory to use (must not be null)
factory
,
final MavenResolver
the Maven artifact resolver to use (must not be null)
mavenResolver
,
final String
the root path to send in to the resource root factory (must not be null)
rootPath
,
InputStream
a stream of the module.xml content (must not be null)
source
,
final String
the File of the module.xml content (must not be null)
moduleInfoFile
,
final ModuleLoader
the module loader to use for dependency specifications (must not be null)
moduleLoader
,
final String
the module name of the module to load
moduleName
)

Parse a module.xml file.

private static void
parseNativeArtifact(final MavenResolver mavenResolver, final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

private static void
private static void
parsePath(final XmlPullParser reader, final boolean include, final MultiplePathFilterBuilder builder)

private static void
parsePathName(final XmlPullParser reader, final Set<String> set)

private static void
parsePermissions(final XmlPullParser reader, final ModuleLoader moduleLoader, final String moduleName, final ModuleSpec.Builder specBuilder)

private static void
private static void
private static void
parseProvidedServiceType(final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

private static void
parseProvidesType(final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

private static Version
parseResourceRoot(final ModuleXmlParser.ResourceRootFactory factory, final String rootPath, final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

private static void
parseResources(final MavenResolver mavenResolver, final ModuleXmlParser.ResourceRootFactory factory, final String rootPath, final XmlPullParser reader, final ModuleSpec.Builder specBuilder)

private static ModuleSpec
parseRootElement(final MavenResolver mavenResolver, final ModuleXmlParser.ResourceRootFactory factory, final String rootPath, final XmlPullParser reader, final ModuleLoader moduleLoader, final String moduleName)

private static Set<String>
parseSet(final XmlPullParser reader)

private static void
parseSet(final XmlPullParser reader, final boolean include, final MultiplePathFilterBuilder builder)

private static void
parseSystemDependency(final XmlPullParser reader, final ArrayList<DependencySpec> dependencies)

private static void
safeClose(Closeable closeable)

public static XmlPullParserException
pack-priv static XmlPullParserException
unknownAttribute(final XmlPullParser parser, final int index)

private static XmlPullParserException
unknownAttributeValue(final XmlPullParser parser, final int index)

private static void
unzip(File src, File destDir)

private static void
validateAttributeNamespace(final XmlPullParser reader, final int index)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait