Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.nanocontainer.script
Class ScriptedContainerBuilderFactory

    java.lang.Object
      org.nanocontainer.script.ScriptedContainerBuilderFactory

    public class ScriptedContainerBuilderFactory

extends Object

The main class for configuration of PicoContainer with various scripting languages. When using the constructors taking a file, the extensions must be one of the following:

- .groovy
- .bsh
- .js
- .py
- .xml

-And the content of the file likewise. See NanoContainer documentation for details.

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

Field Summary
`static String` | `BEANSHELL` Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.BEANSHELL instead.
`static String` | `GROOVY` Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.GROOVY instead.
`static String` | `JAVASCRIPT` Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.JAVASCRIPT instead.
`static String` | `JYTHON` Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.JYTHON instead.
`static String` | `XML` Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.XML instead.

Constructor Summary
`ScriptedContainerBuilderFactory(File compositionFile)`
`ScriptedContainerBuilderFactory(File compositionFile, ClassLoader classLoader)`
`ScriptedContainerBuilderFactory(File compositionFile, ClassLoader classLoader, ScriptBuilderResolver builderClassResolver)` Added since Nano RC-2.
`ScriptedContainerBuilderFactory(Reader composition, String builderClass)`
`ScriptedContainerBuilderFactory(Reader composition, String builderClass, ClassLoader classLoader)` Allows you to create a factory that isntantiats the builder class you desire.
`ScriptedContainerBuilderFactory(URL compositionURL)`
`ScriptedContainerBuilderFactory(URL compositionURL, ClassLoader classLoader, ScriptBuilderResolver builderClassResolver)` Added since Nano RC-2.
`ScriptedContainerBuilderFactory(URL compositionURL, String builderClassName, ClassLoader contextClassLoader)`

Method Summary
`static String` | `getBuilderClassName(String extension)` Deprecated. Since NanoContainer 1.0 RC-2. Use the class ScriptBuilderResolver for this functionality.
`ScriptedContainerBuilder` | `getContainerBuilder()` Retrieve the created container builder instance.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### GROOVY

    public static final String GROOVY

  Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.GROOVY instead.
  See Also:
    Constant Field Values

### BEANSHELL

    public static final String BEANSHELL

  Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.BEANSHELL instead.
  See Also:
    Constant Field Values

### JAVASCRIPT

    public static final String JAVASCRIPT

  Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.JAVASCRIPT instead.
  See Also:
    Constant Field Values

### JYTHON

    public static final String JYTHON

  Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.JYTHON instead.
  See Also:
    Constant Field Values

### XML

    public static final String XML

  Deprecated. Since NanoContainer RC-2. (14-Dec-2005). Use ScriptBuilderResolver.XML instead.
  See Also:
    Constant Field Values

Constructor Detail

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(File compositionFile,
                                           ClassLoader classLoader)
                                    throws IOException,
                                           ClassNotFoundException

Throws:
  `IOException`
  `ClassNotFoundException`

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(File compositionFile,
                                           ClassLoader classLoader,
                                           ScriptBuilderResolver builderClassResolver)
                                    throws IOException,
                                           ClassNotFoundException,
                                           UnsupportedScriptTypeException

  Added since Nano RC-2. This allows you to add/modify registered builders to replace script handling or add new extensions by modifying a constructed ScriptBuilderResolver before constructing this object.

  Parameters:
    `compositionFile` - File The script file.
    `classLoader` - ClassLoader for class resolution once we resolve what the name of the builder should be..
    `builderClassResolver` - ScriptBuilderResolver the resolver for figuring out file names to container builder class names.
  Throws:
    `IOException` - upon java.io.File name resolution error.
    `ClassNotFoundException` - If there is an error loading the specified builder using the specified classloader.
    `UnsupportedScriptTypeException` - if the extension of the file does not match that of any known script.

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(File compositionFile)
                                    throws IOException,
                                           ClassNotFoundException

Throws:
  `IOException`
  `ClassNotFoundException`

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(URL compositionURL)
                                    throws ClassNotFoundException

Throws:
  `ClassNotFoundException`

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(URL compositionURL,
                                           ClassLoader classLoader,
                                           ScriptBuilderResolver builderClassResolver)
                                    throws ClassNotFoundException,
                                           UnsupportedScriptTypeException

  Added since Nano RC-2. This allows you to add/modify registered builders to replace script handling or add new extensions by modifying a constructed ScriptBuilderResolver before constructing this object.

  Parameters:
    `compositionURL` - The script URL.
    `builderClassResolver` - ScriptBuilderResolver 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..
  Throws:
    `ClassNotFoundException` - If there is an error loading the specified builder using the specified classloader.
    `UnsupportedScriptTypeException` - if the extension of the file does not match that of any known script.

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(URL compositionURL,
                                           String builderClassName,
                                           ClassLoader contextClassLoader)
                                    throws ClassNotFoundException

Throws:
  `ClassNotFoundException`

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(Reader composition,
                                           String builderClass)
                                    throws ClassNotFoundException

Throws:
  `ClassNotFoundException`

### ScriptedContainerBuilderFactory

    public ScriptedContainerBuilderFactory(Reader composition,
                                           String builderClass,
                                           ClassLoader classLoader)
                                    throws ClassNotFoundException

  Allows you to create a factory that isntantiats the builder class you desire.

  Parameters:
    `composition` - Reader the script you wish to create the builder for.
    `builderClass` - String the builder class that instantiate.
    `classLoader` - ClassLoader the classloader to use for instantiation.
  Throws:
    `ClassNotFoundException` - if the specified class cannot be found.

Method Detail

### getBuilderClassName

    public static String getBuilderClassName(String extension)

  Deprecated. Since NanoContainer 1.0 RC-2. Use the class ScriptBuilderResolver for this functionality.

  This function does not support custom file type resolving -- for backwards compatibility, it uses a fresh instance of ScriptBuilderResolver for each invocation. Use ScriptBuilderResolver instead.

  Parameters:
    `extension` - String the file extension to res
  Returns:
    String the classname to use for the specified extension.

### getContainerBuilder

    public ScriptedContainerBuilder getContainerBuilder()

  Retrieve the created container builder instance.

  Returns:
    ScriptedContainerBuilder instance, never null.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2007 Codehaus. All Rights Reserved.