Helper class for encoding and decoding node names
Implements the encode and decode routines based on ISO 9075-14:2003 for
node names.It encodes and decode the minimal set to garanty the node names
are jcr valid.
If a character c
is not valid in the node name it is encoded
in the form: '_x' + hexValueOf(c) + '_' (UTF-16). It only
If a node name string is encoded twice or decoded twice it should return the
same string. If a node name string doesn't contain invalid characters the
encode functions should return the string itself. If a string doesn't contain
any encoded chars it should return the string itself. Eg:
- decode(encode(x)) = x
- encode(decode(x)) = x
- encode(encode(x)) = encode(x)
- decode(decode(x)) = decode(x)
- encode(valid_chars) = valid_chars
Qualified name: a qualified name is a combination of a namespace URI
and a local part. Instances of this class are used to internally represent
the names of JCR content items and other objects within a content repository.
The prefixed JCR name format of a qualified name is specified by
section 4.6 of the the JCR 1.0 specification (JSR 170) as follows:
name ::= simplename | prefixedname
simplename ::= onecharsimplename |
twocharsimplename |
threeormorecharname
prefixedname ::= prefix ':' localname
localname ::= onecharlocalname |
twocharlocalname |
threeormorecharname
onecharsimplename ::= (* Any Unicode character except:
'.', '/', ':', '[', ']', '*',
''', '"', '|' or any whitespace
character *)
twocharsimplename ::= '.' onecharsimplename |
onecharsimplename '.' |
onecharsimplename onecharsimplename
onecharlocalname ::= nonspace
twocharlocalname ::= nonspace nonspace
threeormorecharname ::= nonspace string nonspace
prefix ::= (* Any valid non-empty XML NCName *)
string ::= char | string char
char ::= nonspace | ' '
nonspace ::= (* Any Unicode character except:
'/', ':', '[', ']', '*',
''', '"', '|' or any whitespace
character *)