Top Description Fields Constructors Methods
org.apache.tools.ant.util

public Class ScriptFixBSFPath

extends Object
Class Inheritance
Imports
java.io.File, java.util.HashMap, .Map, org.apache.tools.ant.AntClassLoader, .BuildException, .MagicNames

A class to modify a classloader to support BSF language support.

Field Summary

Modifier and TypeField and Description
private static final Map<String, String>
BSF_LANGUAGE_MAP

A map of languages for which the engine in located in bsf

private static final String[]
BSF_LANGUAGES

The following are languages that have scripting engines embedded in bsf.jar.

private static final String
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
fixClassLoader(ClassLoader
the classloader to fix.
loader
,
String
the language to use.
language
)

Check if need to mess about with the classloader.

private File
getClassSource(ClassLoader loader, String className)

private File
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BSF_LANGUAGE_MAPback to summary
private static final Map<String, String> BSF_LANGUAGE_MAP

A map of languages for which the engine in located in bsf

BSF_LANGUAGESback to summary
private static final String[] BSF_LANGUAGES

The following are languages that have scripting engines embedded in bsf.jar. The array is converted to a map of languagename->classname.

BSF_MANAGERback to summary
private static final String BSF_MANAGER
BSF_PACKAGEback to summary
private static final String BSF_PACKAGE
BSF_SCRIPT_RUNNERback to summary
private static final String BSF_SCRIPT_RUNNER
UTIL_OPTIONAL_PACKAGEback to summary
private static final String UTIL_OPTIONAL_PACKAGE

Constructor Detail

ScriptFixBSFPathback to summary
public ScriptFixBSFPath()

Method Detail

fixClassLoaderback to summary
public void fixClassLoader(ClassLoader loader, String language)

Check if need to mess about with the classloader. The class loader will need to be modified for two reasons:

  1. language is at a higher level than bsf for engines in bsf, move bsf.
  2. bsf is at a higher level than oata.util.optional.ScriptRunner
Assume a simple model for the loader: thisloader<-customloader or thisloader
Parameters
loader:ClassLoader

the classloader to fix.

language:String

the language to use.

getClassSourceback to summary
private File getClassSource(ClassLoader loader, String className)
getClassSourceback to summary
private File getClassSource(String className)