org.netbeans.core.startup/1 1.40

org.netbeans.core.startup
Class AutomaticDependencies

java.lang.Object
  extended by org.netbeans.core.startup.AutomaticDependencies

public final class AutomaticDependencies
extends Object

Parser and interpreter for automatic module dependencies. Public for possible access from AU (see #29577). Usage: see implementation of ModuleInstaller.refineDependencies(org.netbeans.Module, java.util.Set).

Since:
org.netbeans.core/1 1.12
See Also:
"#30161", -//NetBeans//DTD Module Automatic Dependencies 1.0//EN

Nested Class Summary
static class AutomaticDependencies.Report
          A struct for holding information on the result of dependency refinement.
 
Method Summary
static AutomaticDependencies empty()
          Create an empty list of transformations.
static AutomaticDependencies getDefault()
          Create default list of transformations.
static void main(String[] x)
          For testing purposes only.
static AutomaticDependencies parse(URL[] urls)
          Create a list of transformations based on some XML files.
 void refineDependencies(String cnb, Set<Dependency> dependencies)
          Interpret the transformations on a module.
 AutomaticDependencies.Report refineDependenciesAndReport(String cnb, Set<Dependency> dependencies)
          Interpret the transformations on a module, and report the changes.
 String refineDependenciesSimple(String cnb, Set<String> dependencies)
          Variant of refineDependenciesAndReport(java.lang.String, java.util.Set) with simple signature intended for use from org.netbeans.nbbuild.ParseProjectXml.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

empty

public static AutomaticDependencies empty()
Create an empty list of transformations.

Returns:
an empty list

getDefault

public static AutomaticDependencies getDefault()
Create default list of transformations. This is now all handled from declarative configuration files: in the system filesystem, ModuleAutoDeps/*.xml may be added according to the DTD "-//NetBeans//DTD Module Automatic Dependencies 1.0//EN".

Returns:
the default list
Since:
1.39

parse

public static AutomaticDependencies parse(URL[] urls)
                                   throws SAXException,
                                          IOException
Create a list of transformations based on some XML files. They must be valid (this method may not validate them). Doctype must be <transformations> from -//NetBeans//DTD Module Automatic Dependencies 1.0//EN.

Parameters:
urls - the XML files
Returns:
a list of parsed transformations
Throws:
SAXException - if malformed
IOException - if unloadable

main

public static void main(String[] x)
                 throws Exception
For testing purposes only. Should dump file structure.

Parameters:
x - list of URLs to parse
Throws:
Exception

refineDependenciesAndReport

public AutomaticDependencies.Report refineDependenciesAndReport(String cnb,
                                                                Set<Dependency> dependencies)
Interpret the transformations on a module, and report the changes. The module's dependencies may be added to, changed, or removed, according to the configuration of this transformations list.

Parameters:
cnb - the code name base of the module being considered
dependencies - a mutable set of type Dependency; call-by-reference
Since:
org.netbeans.core/1 1.19

refineDependencies

public void refineDependencies(String cnb,
                               Set<Dependency> dependencies)
Interpret the transformations on a module. The module's dependencies may be added to, changed, or removed, according to the configuration of this transformations list. Does the same thing as refineDependenciesAndReport(java.lang.String, java.util.Set) but does not report on the details.

Parameters:
cnb - the code name base of the module being considered
dependencies - a mutable set of type Dependency; call-by-reference

refineDependenciesSimple

public String refineDependenciesSimple(String cnb,
                                       Set<String> dependencies)
Variant of refineDependenciesAndReport(java.lang.String, java.util.Set) with simple signature intended for use from org.netbeans.nbbuild.ParseProjectXml.

Parameters:
cnb - the code name base of the module being considered
dependencies - a mutable set of dependencies in the format given by Dependency.toString() and Dependency.create(int, java.lang.String) on Dependency.TYPE_MODULE
Returns:
a message listing some changes, or null if there were no changes
Since:
org.netbeans.core.startup 1.21

toString

public String toString()
Overrides:
toString in class Object

org.netbeans.core.startup/1 1.40

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.