org.fuin.units4j.dependency
Class Utils

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

public final class Utils
extends java.lang.Object

Utilities for the package.


Method Summary
static com.thoughtworks.xstream.XStream createXStream()
          Creates a ready configured XStream instance.
static DependsOn findByName(java.util.List<DependsOn> allowed, java.lang.String pkgName)
          Find a dependency in a list by a package name.
static NotDependsOn findByName(java.util.List<NotDependsOn> forbidden, java.lang.String pkgName)
          Find a dependency in a list by a package name.
static Dependencies load(java.io.File file)
          Load dependencies from a file.
static void save(java.io.File file, Dependencies dependencies)
          Write the dependencies to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createXStream

public static com.thoughtworks.xstream.XStream createXStream()
Creates a ready configured XStream instance.

Returns:
New XStream instance.

load

public static Dependencies load(java.io.File file)
Load dependencies from a file.

Parameters:
file - XML File to load.
Returns:
New dependencies instance.

save

public static void save(java.io.File file,
                        Dependencies dependencies)
Write the dependencies to a file.

Parameters:
file - XML File.
dependencies - Dependencies to save.

findByName

public static DependsOn findByName(java.util.List<DependsOn> allowed,
                                   java.lang.String pkgName)
Find a dependency in a list by a package name.

Parameters:
allowed - List to search.
pkgName - Name of the package to find.
Returns:
Entry or null if nothing was found.

findByName

public static NotDependsOn findByName(java.util.List<NotDependsOn> forbidden,
                                      java.lang.String pkgName)
Find a dependency in a list by a package name.

Parameters:
forbidden - List to search.
pkgName - Name of the package to find.
Returns:
Entry or null if nothing was found.


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