com.pega.pegarules.pub.clipboard
Class PRStringFormat

java.lang.Object
  extended by com.pega.pegarules.pub.clipboard.PRStringFormat

public class PRStringFormat
extends java.lang.Object

PRStringFormat contains methods that convert between Java types and PegaRULES standard String formats used in conjunction with ClipboardProperty values. These methods may be of use to authors of JavaProperty interfaces to convert between PegaRULES formats and their internal values.

Note that the String to Java type conversions deal exclusively with standard PegaRULES formats and do not apply the heuristics used in conjunction with PegaRULES input processing or ClipboardProperty. validation.

Note that a null value object must never be passed to these methods -- no check for null is made and a NullPointerException will be thrown if a value is missing.

Version:
$Revision: 31 $ $Date: 2009-06-24 09:38:04 -0400 (Wed, 24 Jun 2009) $
Author:
olsok

Field Summary
static java.lang.String COPYRIGHT
           
static java.util.Date oFallbackDate
           
static java.lang.String VERSION
           
 
Constructor Summary
PRStringFormat()
           
 
Method Summary
static java.lang.String bigDecimalToPega(char aType, com.pega.ibm.icu.math.BigDecimal aValue)
          Convert from an ICU BigDecimal value to PegaRULES standard form
static java.lang.String booleanToPega(char aType, boolean aValue)
          Convert from a Java boolean value to PegaRULES standard form
static java.lang.String dateToPega(char aType, java.util.Date aValue)
          Convert from a Java Date value to PegaRULES standard form
static java.lang.String doubleToPega(char aType, double aValue)
          Convert from a Java double value to PegaRULES standard form
static java.lang.String intToPega(char aType, int aValue)
          Convert from a Java int value to PegaRULES standard form
static java.lang.String localizedStringToPega(char aType, java.lang.String aValue, java.lang.String aLocale, int aDecimalDigits)
          Convert from a Java String containing a localized value to PegaRULES standard form
static com.pega.ibm.icu.math.BigDecimal pegaToBigDecimal(char aType, java.lang.String aValue, java.lang.String aName)
          Convert from PegaRULES standard form to ICU BigDecimal
static boolean pegaToBoolean(char aType, java.lang.String aValue, boolean aDefault, java.lang.String aName)
          Convert from PegaRULES standard form to Java boolean
static java.util.Date pegaToDate(char aType, java.lang.String aValue, java.lang.String aName)
          Convert from PegaRULES standard form to Java Date
static double pegaToDouble(char aType, java.lang.String aValue, java.lang.String aName)
          Convert from PegaRULES standard form to Java double
static int pegaToInteger(char aType, java.lang.String aValue, java.lang.String aName)
          Convert from PegaRULES standard form to Java int
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION

oFallbackDate

public static final java.util.Date oFallbackDate
Constructor Detail

PRStringFormat

public PRStringFormat()
Method Detail

bigDecimalToPega

public static final java.lang.String bigDecimalToPega(char aType,
                                                      com.pega.ibm.icu.math.BigDecimal aValue)
Convert from an ICU BigDecimal value to PegaRULES standard form

Parameters:
aType - PropertyInfo type code for target ClipboardProperty
aValue - value to be converted
Returns:
String in standard form

booleanToPega

public static final java.lang.String booleanToPega(char aType,
                                                   boolean aValue)
Convert from a Java boolean value to PegaRULES standard form

Parameters:
aType - PropertyInfo type code for target ClipboardProperty
aValue - value to be converted
Returns:
String in standard form

dateToPega

public static final java.lang.String dateToPega(char aType,
                                                java.util.Date aValue)
Convert from a Java Date value to PegaRULES standard form

Parameters:
aType - PropertyInfo type code for target ClipboardProperty
aValue - value to be converted
Returns:
String in standard form

doubleToPega

public static final java.lang.String doubleToPega(char aType,
                                                  double aValue)
Convert from a Java double value to PegaRULES standard form

Parameters:
aType - PropertyInfo type code for target ClipboardProperty
aValue - value to be converted
Returns:
String in standard form

intToPega

public static final java.lang.String intToPega(char aType,
                                               int aValue)
Convert from a Java int value to PegaRULES standard form

Parameters:
aType - PropertyInfo type code for target ClipboardProperty
aValue - value to be converted
Returns:
String in standard form

localizedStringToPega

public static final java.lang.String localizedStringToPega(char aType,
                                                           java.lang.String aValue,
                                                           java.lang.String aLocale,
                                                           int aDecimalDigits)
Convert from a Java String containing a localized value to PegaRULES standard form

Parameters:
aType - PropertyInfo type code for target ClipboardProperty
aValue - localized value to be converted
aLocale - locale name in which value is to be interpreted
aDecimalDigits - number of digits to right of decimal point, or -1 for "as many as needed"
Returns:
String in standard form

pegaToBigDecimal

public static final com.pega.ibm.icu.math.BigDecimal pegaToBigDecimal(char aType,
                                                                      java.lang.String aValue,
                                                                      java.lang.String aName)
Convert from PegaRULES standard form to ICU BigDecimal

Parameters:
aType - PropertyInfo type code for source ClipboardProperty
aValue - value to be converted
aName - ClipboardProperty name for diagnostics, or null
Returns:
BigDecimal value
Throws:
InvalidValueException

pegaToBoolean

public static final boolean pegaToBoolean(char aType,
                                          java.lang.String aValue,
                                          boolean aDefault,
                                          java.lang.String aName)
Convert from PegaRULES standard form to Java boolean

Parameters:
aType - PropertyInfo type code for source ClipboardProperty
aValue - value to be converted
aDefault - default value if zero-length String supplied
aName - ClipboardProperty name for diagnostics, or null
Returns:
boolean value
Throws:
InvalidValueException

pegaToDate

public static final java.util.Date pegaToDate(char aType,
                                              java.lang.String aValue,
                                              java.lang.String aName)
Convert from PegaRULES standard form to Java Date

Parameters:
aType - PropertyInfo type code for source ClipboardProperty
aValue - value to be converted
aName - ClipboardProperty name for diagnostics, or null
Returns:
Date value
Throws:
InvalidValueException

pegaToDouble

public static final double pegaToDouble(char aType,
                                        java.lang.String aValue,
                                        java.lang.String aName)
Convert from PegaRULES standard form to Java double

Parameters:
aType - PropertyInfo type code for source ClipboardProperty
aValue - value to be converted
aName - ClipboardProperty name for diagnostics, or null
Returns:
double value
Throws:
InvalidValueException

pegaToInteger

public static final int pegaToInteger(char aType,
                                      java.lang.String aValue,
                                      java.lang.String aName)
Convert from PegaRULES standard form to Java int

Parameters:
aType - PropertyInfo type code for source ClipboardProperty
aValue - value to be converted
aName - ClipboardProperty name for diagnostics, or null
Returns:
int value
Throws:
InvalidValueException


Copyright © 2012 Pegasystems Inc. All Rights Reserved.