org.sbml.jsbml.xml.parsers
public class ParserManager extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private org.apache.log4j.Logger |
logger
A
Logger for this class. |
private static ParserManager |
manager |
private java.util.Map<java.lang.String,java.lang.String> |
namespaceToNameMap
Map between the
PackageParser namespace and package short name. |
private java.util.Map<java.lang.String,PackageParser> |
packageParsers |
java.util.Map<java.lang.String,ReadingParser> |
readingParsers |
private java.util.Map<java.lang.String,WritingParser> |
writingParsers |
Modifier | Constructor and Description |
---|---|
private |
ParserManager()
Private constructor to make sure that we have only one
ParserManager per JVM. |
Modifier and Type | Method and Description |
---|---|
static ParserManager |
getManager()
Returns the
ParserManager . |
java.lang.String |
getNamespaceFor(int level,
int version,
int packageVersion,
java.lang.String packageName)
Gets the namespace for the given package name that correspond to the SBML level, version
and package version.
|
java.lang.String |
getPackageName(java.lang.String namespace)
Returns the name of the SBML package corresponding to the given namespace URI.
|
PackageParser |
getPackageParser(java.lang.String nameOrURI)
Returns the
PackageParser corresponding to the given name or namespace. |
boolean |
getPackageRequired(java.lang.String nameOrURI)
Returns the required attribute corresponding to the given name or namespace.
|
java.util.Map<java.lang.String,ReadingParser> |
getReadingParsers()
Gets a copy of the registered
ReadingParser s map. |
java.util.Map<java.lang.String,WritingParser> |
getWritingParsers()
Gets a copy of the registered
WritingParser s map. |
private void |
init() |
static void |
main(java.lang.String[] args)
For testing purposes.
|
private static ParserManager manager
public java.util.Map<java.lang.String,ReadingParser> readingParsers
private java.util.Map<java.lang.String,WritingParser> writingParsers
private java.util.Map<java.lang.String,PackageParser> packageParsers
private java.util.Map<java.lang.String,java.lang.String> namespaceToNameMap
PackageParser
namespace and package short name.private org.apache.log4j.Logger logger
Logger
for this class.private ParserManager()
ParserManager
per JVM.public static ParserManager getManager()
ParserManager
.ParserManager
.private void init()
public java.lang.String getPackageName(java.lang.String namespace)
namespace
- - the namespace URI of a SBML package.public boolean getPackageRequired(java.lang.String nameOrURI)
nameOrURI
- - the name or namespace of a SBML package.PackageParser
was found.java.lang.IllegalArgumentException
- if the name or namespace is not recognized by JSBML.public PackageParser getPackageParser(java.lang.String nameOrURI)
PackageParser
corresponding to the given name or namespace.nameOrURI
- - the name or namespace of a SBML package.PackageParser
corresponding to the given name or namespace or null.public java.util.Map<java.lang.String,ReadingParser> getReadingParsers()
ReadingParser
s map.ReadingParser
s map.public java.util.Map<java.lang.String,WritingParser> getWritingParsers()
WritingParser
s map.WritingParser
s map.public java.lang.String getNamespaceFor(int level, int version, int packageVersion, java.lang.String packageName)
Returns null
if the combined level, version and packageVersion is
invalid or not known for this package.
level
- - the SBML levelversion
- - the SBML versionpackageVersion
- - the package versionpackageName
- - the package namepublic static void main(java.lang.String[] args)
args
-