| java.lang.Object org.netbeans.Util
All known Subclasses: org.netbeans.ProxyClassLoader,
Util | abstract public class Util (Code) | | Static utility methods for use within this package.
author: Jesse Glick |
Inner Class :final static class FileWithSuffix | |
Inner Class :public interface PackageAccessibleClassLoader | |
Inner Class :public interface ModuleProvider | |
Inner Class :final static class ModuleLookup extends Lookup | |
Field Summary | |
final public static Logger | err Log everything happening in the module system. |
Method Summary | |
static boolean | checkJavaDependency(Dependency dep) Check whether a simple dependency is met. | static boolean | checkPackageDependency(Dependency dep, ClassLoader cl) Check whether a package dependency is met. | public static String | createPackageName(String name) Convert a class file name to a resource name suitable for Beans.instantiate. | static List<File> | findLocaleVariantsOf(File f) Find existing locale variants of f, in search order. | static List<FileWithSuffix> | findLocaleVariantsWithSuffixesOf(File f) Find existing locale variants of f, in search order. | public static String | findLocalizedMessage(Throwable t, boolean detailOK) Find the most human-presentable message present in an exception. | public static synchronized String[] | getLocalizingSuffixesFast() Similar to
NbBundle.getLocalizingSuffixes but optimized. | public static SpecificationVersion | getModuleDep(Set<Dependency> dependencies, String cnb) Get API module dependency, if any, for a module. | static FilenameFilter | jarFilter() Get a filter for JAR files. | static File | makeTempJar(File moduleFile) Make a temporary copy of a JAR file. | public static Map<Module, List<Module>> | moduleDependencies(Collection<Module> modules, Map<String, Module> modulesByName, Map<String, Set<Module>> _providersOf) Enumerate (direct) interdependencies among a set of modules. | static Set<Module> | moduleInterdependencies(Module m, boolean reverse, boolean transitive, Set<Module> modules, Map<String, Module> modulesByName, Map<String, Set<Module>> providersOf) Get dependencies forward or backwards starting from one module. | public static Object[] | parseCodeName(String cn) Find the code name base and major release version from a code name.
Caches these parses. | public static void | transitiveClosureModuleDependencies(ModuleManager mgr, Set<Module> modules) Transitively fill out a set of modules with all of its module dependencies. |
err | final public static Logger err(Code) | | Log everything happening in the module system.
|
checkJavaDependency | static boolean checkJavaDependency(Dependency dep) throws IllegalArgumentException(Code) | | Check whether a simple dependency is met.
Only applicable to Java dependencies.
|
checkPackageDependency | static boolean checkPackageDependency(Dependency dep, ClassLoader cl) throws IllegalArgumentException(Code) | | Check whether a package dependency is met.
A classloader must be supplied to check in.
|
createPackageName | public static String createPackageName(String name) throws IllegalArgumentException(Code) | | Convert a class file name to a resource name suitable for Beans.instantiate.
Parameters: name - resource name of class file class name without the .class /.ser extension, and using dots as package separator throws: IllegalArgumentException - if the name did not have a valid extension, or originally contained dots outside the extension, etc. since: JST-PENDING: used from NbInstaller |
findLocaleVariantsOf | static List<File> findLocaleVariantsOf(File f)(Code) | | Find existing locale variants of f, in search order.
|
findLocaleVariantsWithSuffixesOf | static List<FileWithSuffix> findLocaleVariantsWithSuffixesOf(File f)(Code) | | Find existing locale variants of f, in search order.
|
findLocalizedMessage | public static String findLocalizedMessage(Throwable t, boolean detailOK)(Code) | | Find the most human-presentable message present in an exception.
At worst, the detail message, but preferably a localized message
if different, or the first localized annotation found.
If returning the detail message is not OK, returns null instead.
since: JST-PENDING: used from NbProblemDisplayer |
getLocalizingSuffixesFast | public static synchronized String[] getLocalizingSuffixesFast()(Code) | | Similar to
NbBundle.getLocalizingSuffixes but optimized.
since: JST-PENDING: Called from InstalledFileLocatorImpl |
getModuleDep | public static SpecificationVersion getModuleDep(Set<Dependency> dependencies, String cnb)(Code) | | Get API module dependency, if any, for a module.
Parameters: dependencies - module dependencies Parameters: cnb - code name base of API module a fake spec version (0.x.y if x.y w/ no major release, else r.x.y); or null if no dep since: JST-PENDING: used from NbInstaller |
moduleDependencies | public static Map<Module, List<Module>> moduleDependencies(Collection<Module> modules, Map<String, Module> modulesByName, Map<String, Set<Module>> _providersOf)(Code) | | Enumerate (direct) interdependencies among a set of modules.
If used in a topological sort, the result will be a reverse-order
list of modules (suitable for disabling; reverse for enabling).
Parameters: modules - some modules Parameters: modulesByName - map from module cnbs to modules (may contain unrelated modules) Parameters: providersOf - map from tokens to sets of modules providing them (may mention unrelated modules) a map from modules to lists of modules they depend on See Also: Utilities.topologicalSort See Also: JST-PENDING needed from tests |
parseCodeName | public static Object[] parseCodeName(String cn) throws NumberFormatException(Code) | | Find the code name base and major release version from a code name.
Caches these parses. Thread-safe (i.e. OK from read mutex).
an array consisting of the code name base (String) followed by the release version (Integer or null)followed by another end-range version (Integer or null) throws: NumberFormatException - if the release version is mangled since: JST-PENDING: used from NbInstaller |
transitiveClosureModuleDependencies | public static void transitiveClosureModuleDependencies(ModuleManager mgr, Set<Module> modules)(Code) | | Transitively fill out a set of modules with all of its module dependencies.
Dependencies on missing modules are silently ignored, but dependencies
on present but uninstallable (problematic) modules are included.
Parameters: mgr - the manager Parameters: modules - a mutable set of modules since: JST-PENDING: used from NbInstaller |
|
|