org.sbml.jsbml.xml.parsers
public class PackageUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.apache.log4j.Logger |
logger
Log4j logger
|
Constructor and Description |
---|
PackageUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkPackages(SBase sbase,
java.util.List<java.lang.String> packageNamespaces,
boolean silent,
boolean fix)
Checks the given
SBase , including all it's siblings, to make sure
that the package version and namespace is set properly. |
private static void |
checkPackages(SBase sbase,
java.util.Map<java.lang.String,PackageInfo> prefixMap,
java.util.Map<java.lang.String,PackageInfo> namespaceMap,
boolean silent,
boolean fix)
Checks the given
SBase , including all it's siblings, to make sure
that the package version and namespace is set properly. |
static void |
checkPackages(SBMLDocument doc)
Checks the whole
SBMLDocument , including all siblings, to make sure
that the package version and namespace is set properly. |
static void |
checkPackages(SBMLDocument doc,
boolean silent,
boolean fix)
Checks the whole
SBMLDocument , including all siblings, to make sure
that the package version and namespace is set properly. |
static int |
extractPackageVersion(java.lang.String namespace) |
private static PackageInfo |
getPackageInfo(SBase sbase,
java.lang.String packageName,
int packageVersion,
java.lang.String elementNamespace,
java.util.Map<java.lang.String,PackageInfo> prefixMap,
java.util.Map<java.lang.String,PackageInfo> namespaceMap,
boolean silent,
boolean fix) |
public static void checkPackages(SBMLDocument doc)
SBMLDocument
, including all siblings, to make sure
that the package version and namespace is set properly.
It will print warnings or errors when problems are found, nothing will be changed.
doc
- the SBMLDocument
to check.public static void checkPackages(SBMLDocument doc, boolean silent, boolean fix)
SBMLDocument
, including all siblings, to make sure
that the package version and namespace is set properly.
The given boolean parameters will indicate if the method will print warnings or errors when problems are found, and if it will try to fix problems.
doc
- the SBMLDocument
to check.silent
- boolean to indicate if errors and warnings should be shown.fix
- boolean to indicate if encountered problems should be fixed.public static void checkPackages(SBase sbase, java.util.List<java.lang.String> packageNamespaces, boolean silent, boolean fix)
SBase
, including all it's siblings, to make sure
that the package version and namespace is set properly.
The given boolean parameters will indicate if the method will print warnings or errors when problems are found, and if it will try to fix problems.
sbase
- the SBase
to check.packageNamespaces
- the List
of namespaces that are expected to be found SBML L3 packages.silent
- boolean to indicate if errors and warnings should be shown.fix
- boolean to indicate if encountered problems should be fixed.private static void checkPackages(SBase sbase, java.util.Map<java.lang.String,PackageInfo> prefixMap, java.util.Map<java.lang.String,PackageInfo> namespaceMap, boolean silent, boolean fix)
SBase
, including all it's siblings, to make sure
that the package version and namespace is set properly.
The given boolean parameters will indicate if the method will print warnings or errors when problems are found, and if it will try to fix problems.
sbase
- the SBase
to check.prefixMap
- map between package name (or prefix or label) and a PackageInfo
object,
representing the package name, namespace and versionnamespaceMap
- map between package namespace and a PackageInfo
object,
representing the package name, namespace and versionsilent
- boolean to indicate if errors and warnings should be shown.fix
- boolean to indicate if encountered problems should be fixed.public static int extractPackageVersion(java.lang.String namespace)
namespace
- private static PackageInfo getPackageInfo(SBase sbase, java.lang.String packageName, int packageVersion, java.lang.String elementNamespace, java.util.Map<java.lang.String,PackageInfo> prefixMap, java.util.Map<java.lang.String,PackageInfo> namespaceMap, boolean silent, boolean fix)
sbase
- packageName
- packageVersion
- elementNamespace
- prefixMap
- namespaceMap
- silent
- fix
-