org.picocontainer.script
Class ScriptedContainerBuilderFactory

java.lang.Object
  extended by org.picocontainer.script.ScriptedContainerBuilderFactory

public class ScriptedContainerBuilderFactory
extends Object

Factory class for scripted container builders of various scripting languages. When using the constructors taking a File, the extensions must be one of the following:

with the content of the file of the corresponding scripting language.

Author:
Paul Hammant, Aslak Helles&oslah;y, Obie Fernandez, Michael Rimov, Mauro Talevi

Constructor Summary
ScriptedContainerBuilderFactory(File compositionFile)
          Creates a ScriptedContainerBuilderFactory with default script builder resolver and context class loader
ScriptedContainerBuilderFactory(File compositionFile, ClassLoader classLoader)
          Creates a ScriptedContainerBuilderFactory with default script builder resolver
ScriptedContainerBuilderFactory(File compositionFile, ClassLoader classLoader, ScriptedBuilderNameResolver scriptedBuilderResolver)
          Creates a ScriptedContainerBuilderFactory
ScriptedContainerBuilderFactory(Reader composition, String builderClassName)
          Creates a ScriptedContainerBuilderFactory with context class loader
ScriptedContainerBuilderFactory(Reader composition, String builderClassName, ClassLoader classLoader)
          Creates a ScriptedContainerBuilderFactory
ScriptedContainerBuilderFactory(URL compositionURL)
          Creates a ScriptedContainerBuilderFactory with default script builder resolver and context class loader
ScriptedContainerBuilderFactory(URL compositionURL, ClassLoader classLoader, ScriptedBuilderNameResolver builderClassResolver)
          Creates a ScriptedContainerBuilderFactory
ScriptedContainerBuilderFactory(URL compositionURL, String builderClassName, ClassLoader classLoader)
          Creates a ScriptedContainerBuilderFactory
 
Method Summary
 ScriptedContainerBuilder getContainerBuilder()
          Returns the created container builder instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(File compositionFile,
                                       ClassLoader classLoader,
                                       ScriptedBuilderNameResolver scriptedBuilderResolver)
                                throws UnsupportedScriptTypeException,
                                       FileNotFoundException
Creates a ScriptedContainerBuilderFactory

Parameters:
compositionFile - File The script file.
classLoader - ClassLoader for class resolution once we resolve what the name of the builder should be.
scriptedBuilderResolver - ScriptedBuilderNameResolver the resolver of container builder class names from file names.
Throws:
IOException - upon File name resolution error
UnsupportedScriptTypeException - if the extension of the file does not match that of any known script.
FileNotFoundException - if composition file is not found

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(File compositionFile,
                                       ClassLoader classLoader)
                                throws IOException
Creates a ScriptedContainerBuilderFactory with default script builder resolver

Parameters:
compositionFile - File The script file.
classLoader - ClassLoader for class resolution once we resolve what the name of the builder should be.
Throws:
IOException
See Also:
ScriptedContainerBuilderFactory(File, ClassLoader, ScriptedBuilderNameResolver)

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(File compositionFile)
                                throws IOException
Creates a ScriptedContainerBuilderFactory with default script builder resolver and context class loader

Parameters:
compositionFile - File The script file.
Throws:
IOException
See Also:
ScriptedContainerBuilderFactory(File, ClassLoader, ScriptedBuilderNameResolver)

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(URL compositionURL)
Creates a ScriptedContainerBuilderFactory with default script builder resolver and context class loader

Parameters:
compositionURL - The script URL.
Throws:
UnsupportedScriptTypeException - if the extension of the file does not match that of any known script.

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(URL compositionURL,
                                       ClassLoader classLoader,
                                       ScriptedBuilderNameResolver builderClassResolver)
                                throws UnsupportedScriptTypeException
Creates a ScriptedContainerBuilderFactory

Parameters:
compositionURL - The script URL.
builderClassResolver - ScriptedBuilderNameResolver the resolver for figuring out file names to container builder class names.
classLoader - ClassLoader for class resolution once we resolve what the name of the builder should be.. the specified builder using the specified classloader.
Throws:
UnsupportedScriptTypeException - if the extension of the file does not match that of any known script.

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(URL compositionURL,
                                       String builderClassName,
                                       ClassLoader classLoader)
Creates a ScriptedContainerBuilderFactory

Parameters:
compositionURL - The script URL.
builderClassName - the class name of the ContainerBuilder to instantiate
classLoader - ClassLoader for class resolution once we resolve what the name of the builder should be.. the specified builder using the specified classloader.

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(Reader composition,
                                       String builderClassName)
Creates a ScriptedContainerBuilderFactory with context class loader

Parameters:
composition - the Reader encoding the script to create the builder with
builderClassName - the class name of the ContainerBuilder to instantiate
See Also:
ScriptedContainerBuilderFactory(Reader, String, ClassLoader)

ScriptedContainerBuilderFactory

public ScriptedContainerBuilderFactory(Reader composition,
                                       String builderClassName,
                                       ClassLoader classLoader)
Creates a ScriptedContainerBuilderFactory

Parameters:
composition - the Reader encoding the script to create the builder with
builderClassName - the class name of the ContainerBuilder to instantiate
classLoader - the Classloader to use for instantiation
Method Detail

getContainerBuilder

public ScriptedContainerBuilder getContainerBuilder()
Returns the created container builder instance.

Returns:
The ScriptedContainerBuilder instance


Copyright © 2003-2010 Codehaus. All Rights Reserved.