Package org.apache.batik.script
Class ImportInfo
java.lang.Object
org.apache.batik.script.ImportInfo
This class represents a list of Java classes/packages to import
into a scripting environment.
It can initializes it's self by reading a file,
from the classpath (META_INF/imports/script.xt).
The format of the file is as follows:
Anything after a '#' on a line is ignored.
The first space delimited token on a line must be either 'class' or
'package'.
The remainder of a line is whitespace delimited, fully qualified,
Java class/package name (i.e. java.lang.System).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a class to the set of classes to import (must be a fully qualified classname - "java.lang.System").void
addImports
(URL src) Add imports read from a URL to this ImportInfo instance.void
addPackage
(String pkg) Add a package to the set of packages to import (must be a fully qualified package - "java.lang").Return an unmodifiable iterator over the list of classesstatic ImportInfo
Returns the default ImportInfo instance.Return an unmodifiable iterator over the list of packagesboolean
removeClass
(String cls) Remove a class from the set of classes to import (must be a fully qualified classname - "java.lang.System").boolean
removePackage
(String pkg) Remove a package from the set of packages to import (must be a fully qualified package - "java.lang").
-
Field Details
-
classes
-
packages
-
-
Constructor Details
-
ImportInfo
public ImportInfo()Construct an empty ImportInfo instance
-
-
Method Details
-
getImports
Returns the default ImportInfo instance. This instance is initialized by reading the file identified by 'importFile'. -
getClasses
Return an unmodifiable iterator over the list of classes -
getPackages
Return an unmodifiable iterator over the list of packages -
addClass
Add a class to the set of classes to import (must be a fully qualified classname - "java.lang.System"). -
addPackage
Add a package to the set of packages to import (must be a fully qualified package - "java.lang"). -
removeClass
Remove a class from the set of classes to import (must be a fully qualified classname - "java.lang.System").- Returns:
- true if the class was present.
-
removePackage
Remove a package from the set of packages to import (must be a fully qualified package - "java.lang").- Returns:
- true if the package was present.
-
addImports
Add imports read from a URL to this ImportInfo instance. See the class documentation for the expected format of the file.- Throws:
IOException
-