edu.isi.pegasus.common.util
public class Separator extends Object
Definition| Modifier and Type | Field and Description |
|---|---|
private static int[][] |
actionmap
Maps the action associated with a state and a character class.
|
private static short[][] |
actionmap2
Maps the action associated with a state and char class.
|
static String |
DEFAULT
Deprecated.
The default namespace is
null. |
static String |
NAME
This constant defines the separator between an identifier and
its version.
|
static String |
NAMESPACE
This constant defines the separator between a namespace and
the identifier.
|
private static short[][] |
statemap
Maps the state and character class to the follow-up state.
|
private static short[][] |
statemap2
Maps the new state from current state and character class.
|
static String |
VERSION
This constant defines the separator that denotes a version range.
|
| Constructor and Description |
|---|
Separator() |
| Modifier and Type | Method and Description |
|---|---|
static String |
combine(String namespace,
String name,
String version)
Combines the three components that constitute a fully-qualified
definition identifier into a single string.
|
static String |
combine(String namespace,
String name,
String min,
String max)
Combines the four components that reference a fully-qualified
definition identifier into a single string.
|
static String[] |
split(String fqdn)
Splits a fully-qualified identifier into its components.
|
static String[] |
splitFQDI(String fqdi)
Splits a fully-qualified definition identifier into separate
namespace, name and version.
|
public static final String NAMESPACE
public static final String NAME
public static final String VERSION
public static final String DEFAULT
null.private static short[][] actionmap2
| 0 | no operation |
|---|---|
| 1 | save character |
| 2 | empty save into ns |
| 3 | empty save into id |
| 4 | empty save into vs |
| 5 | empty save into id, save |
private static short[][] statemap2
| 0 | EOS |
|---|---|
| 1 | colon (:) |
| 2 | other (*) |
private static int[][] actionmap
| 0 | no operation |
|---|---|
| 1 | save character |
| 2 | empty save into ns |
| 3 | empty save into name |
| 4 | empty save into vs |
| 5 | empty save into vs, 4args |
| 6 | empty save into max |
| 7 | empty save into max, 4args |
| 8 | empty save into name, save |
private static short[][] statemap
Four character classes are distinguished:
| 0 | end of string (EOS) |
|---|---|
| 1 | colon (:) |
| 2 | comma (,) |
| 3 | any other |
public static String combine(String namespace, String name, String version)
namespace - is the namespace, may be empty or null.name - is the name to use, must not be empty nor null.version - is the version to attach, may be empty or null.NullPointerException - will be thrown on an empty or null
name, as no such identifier can be constructed.public static String combine(String namespace, String name, String min, String max)
namespace - is the namespace, may be empty or null.name - is the name to use, must not be empty nor null.min - is the lower version to attach, may be empty or null.max - is the upper version to attach, may be empty or null.NullPointerException - will be thrown on an empty or null
name, as no such identifier can be constructed.public static String[] splitFQDI(String fqdi) throws IllegalArgumentException
There is a subtle distinction between a null value and an empty value for the namespace and version. A null value is usually taken as a wildcard match. An empty string however is an exact match of a definition without the namespace or version.
In order to enable the DAX generation function to distinguish these cases when specifying user input, the following convention is supported, where * stands in for wild-card matches, and (-) for a match of an empty element:
| INPUT | NS | ID | VS |
|---|---|---|---|
| id | * | id | * |
| ::id | (-) | id | * |
| ::id: | (-) | id | (-) |
| id: | * | id | (-) |
| id:vs | * | id | vs |
| n::id | n | id | * |
| n::id: | n | id | (-) |
| n::i:v | n | i | v |
| ::i:v | (-) | i | v |
fqdi - is the fully-qualified definition identifier.IllegalArgumentExceptionpublic static String[] split(String fqdn) throws IllegalArgumentException
fqdn - is the string to split into components.IllegalArgumentException, - if the identifier cannot
be parsed correctly.IllegalArgumentException