public class Separator
extends java.lang.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 java.lang.String |
DEFAULT
Deprecated.
The default namespace is
null . |
static java.lang.String |
NAME
This constant defines the separator between an identifier and
its version.
|
static java.lang.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 java.lang.String |
VERSION
This constant defines the separator that denotes a version range.
|
Constructor and Description |
---|
Separator() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
combine(java.lang.String namespace,
java.lang.String name,
java.lang.String version)
Combines the three components that constitute a fully-qualified
definition identifier into a single string.
|
static java.lang.String |
combine(java.lang.String namespace,
java.lang.String name,
java.lang.String min,
java.lang.String max)
Combines the four components that reference a fully-qualified
definition identifier into a single string.
|
static java.lang.String[] |
split(java.lang.String fqdn)
Splits a fully-qualified identifier into its components.
|
static java.lang.String[] |
splitFQDI(java.lang.String fqdi)
Splits a fully-qualified definition identifier into separate
namespace, name and version.
|
public static final java.lang.String NAMESPACE
public static final java.lang.String NAME
public static final java.lang.String VERSION
public static final java.lang.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 java.lang.String combine(java.lang.String namespace, java.lang.String name, java.lang.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.java.lang.NullPointerException
- will be thrown on an empty or null
name, as no such identifier can be constructed.public static java.lang.String combine(java.lang.String namespace, java.lang.String name, java.lang.String min, java.lang.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.java.lang.NullPointerException
- will be thrown on an empty or null
name, as no such identifier can be constructed.public static java.lang.String[] splitFQDI(java.lang.String fqdi) throws java.lang.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.java.lang.IllegalArgumentException
public static java.lang.String[] split(java.lang.String fqdn) throws java.lang.IllegalArgumentException
fqdn
- is the string to split into components.IllegalArgumentException,
- if the identifier cannot
be parsed correctly.java.lang.IllegalArgumentException