Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## opencard.opt.database
Class DataObject

    java.lang.Object
      |
      +--opencard.opt.database.DataObject

public class DataObject
extends java.lang.Object
implements DatabaseCardService.Constants

Field Summary
`static char` | `INHIBITOR`
`static char` | `SEPARATOR`

Constructor Summary
`DataObject()`

Method Summary
`static byte[]` | `bodyAPDU(byte[] b)` Builds the body of the APDU command from a byte array. It is similar to the method using a String.
`static byte[]` | `bodyAPDU(java.lang.String c)` Builds the body of the APDU command from a String.
`protected static byte` | `charToHex(char c)` Transforms a char into its hexadecimal value.
`protected static java.lang.String[]` | `dictionaryResponseToString(char systemTableType, opencard.core.terminal.ResponseAPDU resp)`
`static byte[]` | `headerAPDU(byte CLA, byte INS, byte P1, byte P2)` Builds the header of the APDU command.
`static byte[]` | `headerAPDU(byte CLA, byte INS, byte P1, byte P2, byte lc_size)` Builds the header of the APDU command.
`protected static char` | `hexToChar(byte b)` Transforms a hexadecimal value into its char value.
`protected static void` | `isDictionaryIdentifier(java.lang.String s)`
`protected static void` | `isIdentifier(java.lang.String s)`
`protected static boolean` | `isOperator(char c)` Test if the character passed as parameter is an operator of comparison or not.
`protected static byte` | `operator(java.lang.String condition)` This method converts a string value of an operator into its byte value.
`protected static byte` | `parsePrivilege(java.lang.String priv)` This method parses a `String` describing the privileges and builds a corresponding byte value. Privileges must be as follow : "A" stands for "ALL". "I" stands for "INSERT". "S" stands for "SELECT". "U" stands for "UPDATE". "D" stands for "DELETE".
`protected static java.lang.String[]` | `parseString(java.lang.String s)` Allows to parse a string composed of severals parameters into an array of Strings.
`protected static java.lang.String[]` | `responseToString(opencard.core.terminal.ResponseAPDU resp)` Converts a response APDU sent back by the smartcard into a string.

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

Field Detail

### INHIBITOR

    public static final char INHIBITOR

### SEPARATOR

    public static final char SEPARATOR

Constructor Detail

### DataObject

    public DataObject()

Method Detail

### isIdentifier

    protected static void isIdentifier(java.lang.String s)
                                throws opencard.opt.database.WrongIdentifierSyntaxException

### isDictionaryIdentifier

    protected static void isDictionaryIdentifier(java.lang.String s)
                                          throws opencard.opt.database.WrongIdentifierSyntaxException

### isOperator

    protected static boolean isOperator(char c)

  Test if the character passed as parameter is an operator of comparison or not. Returns `True` if the character is an operator and `False` otherwise.
  Parameters:
    `c` - The character to be tested.
  Returns:
    True or False.

### parsePrivilege

    protected static byte parsePrivilege(java.lang.String priv)

  This method parses a `String` describing the privileges and builds a corresponding byte value.
  Privileges must be as follow :
  - "A" stands for "ALL".
  - "I" stands for "INSERT".
  - "S" stands for "SELECT".
  - "U" stands for "UPDATE".
  - "D" stands for "DELETE".
  Parameters:
    `priv` - The list of privileges, each privilege is separated from the next one by a coma.
  Returns:
    the byte value of the privileges.

### operator

    protected static byte operator(java.lang.String condition)

  This method converts a string value of an operator into its byte value.
  Parameters:
    `condition` - The operator to determine the value, coded on 1 or 2 characters.
  Returns:
    The byte value which represents the operator.

### dictionaryResponseToString

    protected static java.lang.String[] dictionaryResponseToString(char systemTableType,
                                                                   opencard.core.terminal.ResponseAPDU resp)

### responseToString

    protected static java.lang.String[] responseToString(opencard.core.terminal.ResponseAPDU resp)

  Converts a response APDU sent back by the smartcard into a string.
  Parameters:
    `resp` - The response APDU to get the string value of.
  Returns:
    The array of strings that contains the parsed resp parameter.

### parseString

    protected static java.lang.String[] parseString(java.lang.String s)

  Allows to parse a string composed of severals parameters into an array of Strings.
  Parameters:
    `s` - The String to be parsed.
  Returns:
    an array which contains the list of the parameters which composed the string s.

### charToHex

    protected static byte charToHex(char c)

  Transforms a char into its hexadecimal value.
  Parameters:
    `c` - The character to transform into its hexadecimal value.
  Returns:
    The Hexadecimal value of the character.

### hexToChar

    protected static char hexToChar(byte b)

  Transforms a hexadecimal value into its char value.
  Parameters:
    `c` - The hexadecimal value to transform into its character value.
  Returns:
    The computed character.

### bodyAPDU

    public static byte[] bodyAPDU(java.lang.String c)

  Builds the body of the APDU command from a String.
  Parameters:
    `c` - The string used to build the ADPU command.
  Returns:
    An array of bytes which represents the body of the APDU command.

### bodyAPDU

    public static byte[] bodyAPDU(byte[] b)

  Builds the body of the APDU command from a byte array.
  It is similar to the method using a String.
  Parameters:
    `b` - The byte array used to build the ADPU command.
  Returns:
    An array of bytes which represents the body of the APDU command.

### headerAPDU

    public static byte[] headerAPDU(byte CLA,
                                    byte INS,
                                    byte P1,
                                    byte P2)

  Builds the header of the APDU command.
  Parameters:
    `CLA` - Represents the CLA byte value of the APDU command.
    `INS` - Represents the INS byte value of the APDU command.
    `P1` - Represents the P1 byte value of the APDU command.
    `P2` - Represents the P2 byte value of the APDU command.
  Returns:
    An array of bytes which represents the header of the APDU command.
  See Also:
    (byte, byte, byte, byte, byte)

### headerAPDU

    public static byte[] headerAPDU(byte CLA,
                                    byte INS,
                                    byte P1,
                                    byte P2,
                                    byte lc_size)

  Builds the header of the APDU command.
  Parameters:
    `CLA` - Represents the CLA byte value of the APDU command.
    `INS` - Represents the INS byte value of the APDU command.
    `P1` - Represents the P1 byte value of the APDU command.
    `P2` - Represents the P2 byte value of the APDU command.
    `le_size` - Represents the Le byte value of the APDU command, i.e. the expected length of returned data.
  Returns:
    An array of bytes which represents the header of the APDU command.
  See Also:
    (byte, byte, byte, byte)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD