Package org.hippoecm.repository.api
Class StringCodecFactory.ISO9075Helper
- java.lang.Object
-
- org.hippoecm.repository.api.StringCodecFactory.ISO9075Helper
-
- All Implemented Interfaces:
StringCodec
- Enclosing class:
- StringCodecFactory
public static class StringCodecFactory.ISO9075Helper extends Object implements StringCodec
Usage of this class discouraged. If should only be used by frameworks to initialize the StringCodecFactory instance. Performs encoding and decoding (the localname of) Qualified namesImplements the encode and decode routines based on ISO 9075-14:2003.
If a characterc
is not valid in the localname of a QName it is encoded in the form: '_x' + hexValueOf(c) + '_' (UTF-16)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 XML Name *) string ::= char | string char char ::= nonspace | ' ' nonspace ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *)
In addition to the prefixed JCR name format, a qualified name can also be represented using the format "
{namespaceURI}localPart
".
-
-
Constructor Summary
Constructors Constructor Description ISO9075Helper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
decode(String encoded)
Decodes a string of characters.static String
decodeColon(String name)
static String
decodeLocalName(String name)
String
encode(String plain)
Encodes a string of characters.static String
encodeColon(String name)
static String
encodeLocalName(String name)
-
-
-
Method Detail
-
encode
public String encode(String plain)
Description copied from interface:StringCodec
Encodes a string of characters.- Specified by:
encode
in interfaceStringCodec
- Parameters:
plain
- the string to encode- Returns:
- the encoded string
-
decode
public String decode(String encoded)
Description copied from interface:StringCodec
Decodes a string of characters. Some encoding strategies are one-way, in which case the decoding might return null.- Specified by:
decode
in interfaceStringCodec
- Parameters:
encoded
- the previously encoded string- Returns:
- the decoded string or null if no decoding is possible
-
encodeLocalName
public static String encodeLocalName(String name)
- See Also:
StringCodec.encode(String)
-
decodeLocalName
public static String decodeLocalName(String name)
- See Also:
StringCodec.decode(String)
-
-