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).
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set(package private) static final String(package private) static final StringDefault file to read imports from, can be overridden by setting the 'org.apache.batik.script.imports' System property(package private) static ImportInfo(package private) static Stringprotected Set(package private) static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a class to the set of classes to import (must be a fully qualified classname - "java.lang.System").voidaddImports(URL src) Add imports read from a URL to this ImportInfo instance.voidaddPackage(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 ImportInfoReturns the default ImportInfo instance.Return an unmodifiable iterator over the list of packages(package private) static ImportInfobooleanremoveClass(String cls) Remove a class from the set of classes to import (must be a fully qualified classname - "java.lang.System").booleanremovePackage(String pkg) Remove a package from the set of packages to import (must be a fully qualified package - "java.lang").
-
Field Details
-
defaultFile
Default file to read imports from, can be overridden by setting the 'org.apache.batik.script.imports' System property- See Also:
-
importFile
-
defaultImports
-
classes
-
packages
-
classStr
- See Also:
-
packageStr
- See Also:
-
-
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'. -
readImports
-
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
-