Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


oracle.rules.sdk.store.util
Class HexCodec

java.lang.Object
  extended byoracle.rules.sdk.store.util.HexCodec


public class HexCodec
extends java.lang.Object

Utility methods for a simple encoding of non-ascii Unicode. Intended for encoding/decoding DocumentID components if the underlying store requires it.


Constructor Summary
HexCodec()
           

 

Method Summary
static java.lang.String decode(java.lang.String s)
          Returns the decoded hex string.
static java.lang.String decodeIfNeeded(java.lang.String s)
          If the first two characters of the specified string are "__", it is assumed to have been hex encoded by encodeIfNeeded.
static java.lang.String encode(java.lang.String s)
          Returns the hex encoding of the specified string.
static java.lang.String encodeIfNeeded(java.lang.String s)
          If the specified string contains any non-ascii Unicode characters, then a hex encoding of the string prepended with "__" is returned.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

HexCodec

public HexCodec()

Method Detail

encode

public static java.lang.String encode(java.lang.String s)
Returns the hex encoding of the specified string.
Parameters:
s - the string to encode.
Returns:
the encoded string.

decode

public static java.lang.String decode(java.lang.String s)
Returns the decoded hex string.
Parameters:
s - the string to decode.
Returns:
the decoded string.

encodeIfNeeded

public static java.lang.String encodeIfNeeded(java.lang.String s)
If the specified string contains any non-ascii Unicode characters, then a hex encoding of the string prepended with "__" is returned. Otherwise the original string is returned.
Parameters:
s - the string to encode if needed.
Returns:
the resulting string.
See Also:
decodeIfNeeded(java.lang.String)

decodeIfNeeded

public static java.lang.String decodeIfNeeded(java.lang.String s)
If the first two characters of the specified string are "__", it is assumed to have been hex encoded by encodeIfNeeded. The leading "__" is stripped and the decoded remaining string is returned. Otherwise the specified string is returned.
Parameters:
s - the string to decode.
Returns:
the resulting string.
See Also:
encodeIfNeeded(java.lang.String)

Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


Copyright © 2006, Oracle. All rights reserved.