ShrinkWrap Resolver API 2.0.0-alpha-3

org.jboss.shrinkwrap.resolver.api
Class ConfiguredResolverSystemFactory<RESOLVERSYSTEMTYPE extends ResolverSystem,CONFIGURABLERESOLVERSYSTEMTYPE extends ConfigurableResolverSystem<RESOLVERSYSTEMTYPE>>

java.lang.Object
  extended by org.jboss.shrinkwrap.resolver.api.ConfiguredResolverSystemFactory<RESOLVERSYSTEMTYPE,CONFIGURABLERESOLVERSYSTEMTYPE>
Type Parameters:
RESOLVERSYSTEMTYPE - Configured view type of the ResolverSystem
CONFIGURABLERESOLVERSYSTEMTYPE - Configurable view type of the ResolverSystem

public class ConfiguredResolverSystemFactory<RESOLVERSYSTEMTYPE extends ResolverSystem,CONFIGURABLERESOLVERSYSTEMTYPE extends ConfigurableResolverSystem<RESOLVERSYSTEMTYPE>>
extends Object

Factory to create configured ResolverSystem instances

Author:
Andrew Lee Rubinger

Constructor Summary
ConfiguredResolverSystemFactory(Class<CONFIGURABLERESOLVERSYSTEMTYPE> type)
          Creates a new instance to configure a new ConfigurableResolverSystem of the specified type, using the current Thread.getContextClassLoader() for creation of the ConfigurableResolverSystem
ConfiguredResolverSystemFactory(Class<CONFIGURABLERESOLVERSYSTEMTYPE> type, ClassLoader clForCreation)
          Creates a new instance to configure a new ConfigurableResolverSystem of the specified type, using the Thread.getContextClassLoader() of the specified ClassLoader for creation of the ConfigurableResolverSystem
 
Method Summary
protected  CONFIGURABLERESOLVERSYSTEMTYPE create()
           
 RESOLVERSYSTEMTYPE fromClassloaderResource(String path)
          Configures this ResolverSystem from the result of ClassLoader.getResource(String) using the current Thread.getContextClassLoader()
 RESOLVERSYSTEMTYPE fromClassloaderResource(String path, ClassLoader loader)
          Configures this ResolverSystem from the result of ClassLoader.getResource(String) using the specified ClassLoader
 RESOLVERSYSTEMTYPE fromFile(File file)
          Configures this ResolverSystem from the specified file
 RESOLVERSYSTEMTYPE fromFile(String pathToFile)
          Configures this ResolverSystem from the file at the specified path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfiguredResolverSystemFactory

public ConfiguredResolverSystemFactory(Class<CONFIGURABLERESOLVERSYSTEMTYPE> type)
                                throws IllegalArgumentException
Creates a new instance to configure a new ConfigurableResolverSystem of the specified type, using the current Thread.getContextClassLoader() for creation of the ConfigurableResolverSystem

Parameters:
type -
Throws:
IllegalArgumentException - If the type is not specified

ConfiguredResolverSystemFactory

public ConfiguredResolverSystemFactory(Class<CONFIGURABLERESOLVERSYSTEMTYPE> type,
                                       ClassLoader clForCreation)
                                throws IllegalArgumentException
Creates a new instance to configure a new ConfigurableResolverSystem of the specified type, using the Thread.getContextClassLoader() of the specified ClassLoader for creation of the ConfigurableResolverSystem

Parameters:
type -
clForCreation -
Throws:
IllegalArgumentException - If either argument is not specified
Method Detail

fromFile

public RESOLVERSYSTEMTYPE fromFile(File file)
                                                   throws IllegalArgumentException,
                                                          InvalidConfigurationFileException
Configures this ResolverSystem from the specified file

Parameters:
file -
Throws:
IllegalArgumentException - If the file is not specified, is a directory, or does not exist
InvalidConfigurationFileException - If the file is not in correct format

fromFile

public RESOLVERSYSTEMTYPE fromFile(String pathToFile)
                                                   throws IllegalArgumentException,
                                                          InvalidConfigurationFileException
Configures this ResolverSystem from the file at the specified path

Parameters:
pathToFile -
Throws:
IllegalArgumentException - If the file is not specified, is a directory, or does not exist
InvalidConfigurationFileException - If the file is not in correct format

fromClassloaderResource

public RESOLVERSYSTEMTYPE fromClassloaderResource(String path)
                                                                  throws IllegalArgumentException,
                                                                         InvalidConfigurationFileException
Configures this ResolverSystem from the result of ClassLoader.getResource(String) using the current Thread.getContextClassLoader()

Parameters:
path -
Throws:
IllegalArgumentException - If the path is not specified or can not be found
InvalidConfigurationFileException - If the file is not in correct format

fromClassloaderResource

public RESOLVERSYSTEMTYPE fromClassloaderResource(String path,
                                                  ClassLoader loader)
                                                                  throws IllegalArgumentException,
                                                                         InvalidConfigurationFileException
Configures this ResolverSystem from the result of ClassLoader.getResource(String) using the specified ClassLoader

Parameters:
path -
Throws:
IllegalArgumentException - If the either argument is not specified or if the path can not be found
InvalidConfigurationFileException - If the file is not in correct format

create

protected CONFIGURABLERESOLVERSYSTEMTYPE create()

ShrinkWrap Resolver API 2.0.0-alpha-3

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.