public class SyntaxChecker
extends java.lang.Object
This utility class provides static methods for checking the syntax of
identifiers and other text used in an SBMLDocument
.
The methods allow callers to verify that String
s such as SBML
identifiers and XHTML notes text conform to the SBML specifications.
In order to save memory, all patterns in this class are only initialized upon their first use.
Modifier and Type | Method | Description |
---|---|---|
static boolean |
isValidChemicalFormula(java.lang.String chemicalFormula) |
|
static boolean |
isValidEmailAddress(java.lang.String email) |
Definition of valid e-mail address
String s. |
static boolean |
isValidId(java.lang.String idCandidate,
int level,
int version) |
Checks whether the given idCandidate is a valid identifier according to
the SBML specifications.
|
static boolean |
isValidMetaId(java.lang.String idCandidate) |
Checks if the given identifier candidate satisfies the requirements for a
valid meta identifier (see SBML L2V4 p. 12 for details).
|
static boolean |
isValidMetaId(java.lang.String idCandidate,
int level,
int version) |
Checks if the given identifier candidate satisfies the requirements for a
valid meta identifier (for any version and level).
|
public static boolean isValidChemicalFormula(java.lang.String chemicalFormula)
chemicalFormula
- public static boolean isValidEmailAddress(java.lang.String email)
String
s.
Pattern | Explanation |
---|---|
^ | start of the line |
[_A-Za-z0-9-]+ | must start with string in the bracket [ ], must contains one or more (+) |
( | start of group #1 |
\\.[_A-Za-z0-9-]+ | follow by a dot "." and string in the bracket [ ], must contains one or more (+) |
)* | end of group #1, this group is optional (*) |
@ | must contains a "@" symbol |
[A-Za-z0-9-]+ | follow by string in the bracket [ ], must contains one or more (+) |
( | start of group #2 - first level TLD checking |
\\.[A-Za-z0-9-]+ | follow by a dot "." and string in the bracket [ ], must contains one or more (+) |
)* | end of group #2, this group is optional (*) |
( | start of group #3 - second level TLD checking |
\\.[A-Za-z]{2,} | follow by a dot "." and string in the bracket [ ], with minimum length of 2 |
) | end of group #3 |
$ | end of the line |
email
- public static final boolean isValidId(java.lang.String idCandidate, int level, int version)
idCandidate
- The String
to be tested.level
- Level of the SBML to be used.version
- Version of the SBML to be used.public static final boolean isValidMetaId(java.lang.String idCandidate)
idCandidate
- true
if the given argument is a valid meta identifier
String
, false
otherwise.public static final boolean isValidMetaId(java.lang.String idCandidate, int level, int version)
idCandidate
- , level, versiontrue
if the given argument is a valid meta identifier
String
, false
otherwise.