public class PackageLibrary extends Object
Constructor and Description |
---|
PackageLibrary() |
Modifier and Type | Method and Description |
---|---|
void |
addPackage(String name,
StylesheetPackage packageIn)
Add a package to the current library with the given name
|
void |
addPackage(StylesheetPackage packageIn)
Add a package to the current library
|
PackageLibrary |
copy() |
StylesheetPackage |
getPackage(String name)
Return the latest version of a package of the given name from the library.
|
StylesheetPackage |
getPackage(String name,
PackageVersionRanges ranges)
Return a package from the library that has the given name and whose version lies in the given ranges.
|
StylesheetPackage |
getPackage(String name,
PackageVersionRanges ranges,
boolean first)
Return the first or latest package from the library that has the given name
and whose version lies in the given ranges
|
List<StylesheetPackage> |
getPackages()
Supply all the packages that currently exist in this library
|
int |
size(String name) |
public void addPackage(StylesheetPackage packageIn)
Packages which have the same name and version to one already within the library are considered to be duplicates and are not added.
packageIn
- The stylesheet package to be addedpublic void addPackage(String name, StylesheetPackage packageIn)
Packages which have the same name and version to one already within the library are considered to be duplicates and are not added.
name
- The name to use for this packagepackageIn
- The stylesheet package to be addedpublic StylesheetPackage getPackage(String name, PackageVersionRanges ranges)
name
- The name of the packageranges
- The ranges of versions of that package that are acceptablepublic StylesheetPackage getPackage(String name, PackageVersionRanges ranges, boolean first)
name
- The name of the packageranges
- The ranges of versions of that package that are acceptablefirst
- Whether to return the first (true) or the latest version (false)public StylesheetPackage getPackage(String name)
The definition of 'latest' is determined by partial ordering of the PackageVersion
class
name
- The name of the package to be returnedpublic int size(String name)
public List<StylesheetPackage> getPackages()
public PackageLibrary copy()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.