org.fuin.units4j.dependency
Class Dependencies

java.lang.Object
  extended by org.fuin.units4j.dependency.Dependencies

public final class Dependencies
extends java.lang.Object

Package dependency rules. Caution: A package cannot be in both lists!


Constructor Summary
Dependencies()
          Default constructor.
 
Method Summary
 Package<DependsOn> findAllowedByName(java.lang.String packageName)
          Find an entry in the allowed list by package name.
 Package<NotDependsOn> findForbiddenByName(java.lang.String packageName)
          Find an entry in the forbidden list by package name.
 java.util.List<Package<DependsOn>> getAllowed()
          Returns the list of allowed package dependencies.
 java.util.List<DependsOn> getAlwaysAllowed()
          Returns a list of packages like "java.lang" that are always Ok to depend on.
 java.util.List<NotDependsOn> getAlwaysForbidden()
          Returns a list of packages that are always forbidden to depend on.
 java.util.List<Package<NotDependsOn>> getForbidden()
          Returns the list of forbidden package dependencies.
 boolean isAlwaysAllowed(java.lang.String packageName)
          Checks if the package is always OK.
 boolean isAlwaysForbidden(java.lang.String packageName)
          Checks if the package is always forbidden.
 void validate()
          Checks if the definition is valid - Especially if no package is in both lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dependencies

public Dependencies()
Default constructor.

Method Detail

getAlwaysAllowed

public final java.util.List<DependsOn> getAlwaysAllowed()
Returns a list of packages like "java.lang" that are always Ok to depend on.

Returns:
List of packages.

getAlwaysForbidden

public final java.util.List<NotDependsOn> getAlwaysForbidden()
Returns a list of packages that are always forbidden to depend on.

Returns:
List of packages.

isAlwaysAllowed

public final boolean isAlwaysAllowed(java.lang.String packageName)
Checks if the package is always OK.

Parameters:
packageName - Name of the package to check.
Returns:
If the package is always allowed true else false.

isAlwaysForbidden

public final boolean isAlwaysForbidden(java.lang.String packageName)
Checks if the package is always forbidden.

Parameters:
packageName - Name of the package to check.
Returns:
If the package is always forbidden true else false.

getAllowed

public final java.util.List<Package<DependsOn>> getAllowed()
Returns the list of allowed package dependencies.

Returns:
List of explicit allowed dependencies - All other dependencies are considered to be an error.

getForbidden

public final java.util.List<Package<NotDependsOn>> getForbidden()
Returns the list of forbidden package dependencies.

Returns:
List of explicit forbidden dependencies - All other dependencies are considered to be valid.

validate

public final void validate()
                    throws InvalidDependenciesDefinitionException
Checks if the definition is valid - Especially if no package is in both lists.

Throws:
InvalidDependenciesDefinitionException - This instance is invalid.

findAllowedByName

public final Package<DependsOn> findAllowedByName(java.lang.String packageName)
Find an entry in the allowed list by package name.

Parameters:
packageName - Name to find.
Returns:
Package or null if no entry with the given name was found.

findForbiddenByName

public final Package<NotDependsOn> findForbiddenByName(java.lang.String packageName)
Find an entry in the forbidden list by package name.

Parameters:
packageName - Name to find.
Returns:
Package or null if no entry with the given name was found.


Copyright © 2010 Future Invent Informationsmanagement GmbH. All Rights Reserved.