|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jp.protection.priv.pro.SerialNumberBase
public abstract class SerialNumberBase
| Nested Class Summary | |
|---|---|
static class |
SerialNumberBase.KeyCharsGenerator
Utility class that allows generation of the key characters |
| Field Summary | |
|---|---|
protected char[] |
fKeyChars
|
protected int |
fKeyCharsStartOffset
|
static int |
N_A
|
static java.lang.String |
PATTERN
|
static char |
PATTERN_CHAR
|
static java.lang.String |
PATTERN_DELIMITER
|
| Constructor Summary | |
|---|---|
protected |
SerialNumberBase()
Creates a new instance of the SerialNumberBase |
protected |
SerialNumberBase(char[] aKeyChars)
Creates a new instance of the SerialNumberBase and assigns key characters to it |
| Method Summary | |
|---|---|
protected static void |
checkValidChars(char[] aKeyChars,
java.lang.String aNumber)
|
protected static boolean |
contains(char[] aKeyChars,
char aChar)
|
protected static java.lang.String |
decode(char[] aKeyChars,
java.lang.String aNumber)
|
abstract void |
decode(java.lang.String aSerialNumber)
Parses textual representation of the Serial Number |
abstract java.lang.String |
encode()
Generates textual representation of the Serial Number |
protected static java.lang.String |
encode(char[] aKeyChars,
int aKeyCharsStartOffset,
byte[] aNumber,
boolean isSkipLength)
|
protected static java.lang.String |
encode(char[] aKeyChars,
int aKeyCharsStartOffset,
java.lang.String aNumber,
boolean isSkipLength)
|
protected long |
generateCRC(java.lang.String aValue)
|
char[] |
getKeyChars()
Return key characters used to encode/decode serial numbers |
protected static int |
getOffset(char[] aKeyChars)
|
protected static void |
invalidSerialNumberError(java.lang.String aSerialNumber)
|
protected void |
keyCharsNotSpecifiedError()
|
void |
setKeyChars(char[] aKeyChars)
Specifies key characters used to encode/decode serial numbers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int N_A
protected int fKeyCharsStartOffset
protected char[] fKeyChars
public static final java.lang.String PATTERN
public static final char PATTERN_CHAR
public static final java.lang.String PATTERN_DELIMITER
| Constructor Detail |
|---|
protected SerialNumberBase(char[] aKeyChars)
SerialNumberBase and assigns key characters to it
aKeyChars - key charactersprotected SerialNumberBase()
SerialNumberBase
| Method Detail |
|---|
public abstract java.lang.String encode()
throws SerialNumberException
SerialNumberException - on any errors
public abstract void decode(java.lang.String aSerialNumber)
throws SerialNumberException
aSerialNumber - textual representation of the Serial Number
SerialNumberException - if provided textual representation of the Serial Number is invalidpublic char[] getKeyChars()
protected long generateCRC(java.lang.String aValue)
protected static void invalidSerialNumberError(java.lang.String aSerialNumber)
throws SerialNumberException
SerialNumberException
protected void keyCharsNotSpecifiedError()
throws SerialNumberException
SerialNumberExceptionpublic void setKeyChars(char[] aKeyChars)
aKeyChars - char[] key charactersprotected static int getOffset(char[] aKeyChars)
protected static boolean contains(char[] aKeyChars,
char aChar)
protected static void checkValidChars(char[] aKeyChars,
java.lang.String aNumber)
protected static java.lang.String decode(char[] aKeyChars,
java.lang.String aNumber)
throws SerialNumberException
SerialNumberException
protected static java.lang.String encode(char[] aKeyChars,
int aKeyCharsStartOffset,
java.lang.String aNumber,
boolean isSkipLength)
protected static java.lang.String encode(char[] aKeyChars,
int aKeyCharsStartOffset,
byte[] aNumber,
boolean isSkipLength)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||