org.jsqltool.utils
Class Options

java.lang.Object
  |
  +--org.jsqltool.utils.Options

public class Options
extends java.lang.Object

Title: JSqlTool Project

Description: This is a singleton class used to store application properties.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of JSqlTool project. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it


Method Summary
 java.lang.String decode(java.lang.String text)
          Decrypt text.
 java.lang.String decodeFromBytes(byte[] text)
          Decrypt text.
 java.lang.String encode(java.lang.String text)
          Encrypt text.
 byte[] encodeToBytes(java.lang.String text)
          Encrypt text.
 java.lang.String getDateFormat()
           
static Options getInstance()
           
 java.lang.String getLanguage()
           
 java.lang.String getOracleExplainPlanTable()
           
 java.lang.String getResource(java.lang.String key)
           
 boolean isUpdateWhenNoPK()
           
 void setDateFormat(java.lang.String dateFormat)
          Set date format.
 void setLanguage(java.lang.String language)
          Set language id to be used inside the application.
 void setOracleExplainPlanTable(java.lang.String oracleExplainPlanTable)
          Set Oracle PLAN table, used to execute query explain.
 void setUpdateWhenNoPK(boolean updateWhenNoPK)
          Allow record updating when no pk is defined
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Options getInstance()
Returns:
unique instance of the class

getDateFormat

public java.lang.String getDateFormat()
Returns:
date format

getOracleExplainPlanTable

public final java.lang.String getOracleExplainPlanTable()
Returns:
Oracle PLAN table, used to execute query explain

isUpdateWhenNoPK

public final boolean isUpdateWhenNoPK()
Returns:
allow record updating when no pk is defined

setUpdateWhenNoPK

public final void setUpdateWhenNoPK(boolean updateWhenNoPK)
Allow record updating when no pk is defined

Parameters:
updateWhenNoPK - allow record updating when no pk is defined

setOracleExplainPlanTable

public final void setOracleExplainPlanTable(java.lang.String oracleExplainPlanTable)
Set Oracle PLAN table, used to execute query explain.

Parameters:
oracleExplainPlanTable - Oracle PLAN table, used to execute query explain

setDateFormat

public final void setDateFormat(java.lang.String dateFormat)
Set date format.

Parameters:
dateFormat - date format

getLanguage

public final java.lang.String getLanguage()
Returns:
language id to be used inside the application

setLanguage

public final void setLanguage(java.lang.String language)
Set language id to be used inside the application.

Parameters:
language - language id to be used inside the application

getResource

public final java.lang.String getResource(java.lang.String key)
Parameters:
key - key to translate
Returns:
key translation

encode

public final java.lang.String encode(java.lang.String text)
                              throws javax.crypto.IllegalBlockSizeException,
                                     javax.crypto.BadPaddingException,
                                     java.security.InvalidKeyException,
                                     java.security.InvalidAlgorithmParameterException
Encrypt text.

Parameters:
text - text to encrypt
Returns:
encrypted text
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

decode

public final java.lang.String decode(java.lang.String text)
                              throws javax.crypto.IllegalBlockSizeException,
                                     javax.crypto.BadPaddingException,
                                     java.security.InvalidKeyException,
                                     java.security.InvalidAlgorithmParameterException
Decrypt text.

Parameters:
text - text to decrypt
Returns:
decrypted text
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

encodeToBytes

public final byte[] encodeToBytes(java.lang.String text)
                           throws javax.crypto.IllegalBlockSizeException,
                                  javax.crypto.BadPaddingException,
                                  java.security.InvalidKeyException,
                                  java.security.InvalidAlgorithmParameterException
Encrypt text.

Parameters:
text - text to encrypt
Returns:
encrypted text
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException

decodeFromBytes

public final java.lang.String decodeFromBytes(byte[] text)
                                       throws javax.crypto.IllegalBlockSizeException,
                                              javax.crypto.BadPaddingException,
                                              java.security.InvalidKeyException,
                                              java.security.InvalidAlgorithmParameterException
Decrypt text.

Parameters:
text - text to decrypt
Returns:
decrypted text
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException