com.bea.tuxedo.control
Class CoercionUtil

java.lang.Object
  extended by com.bea.tuxedo.control.CoercionUtil

public class CoercionUtil
extends Object

This class provides a bunch of static methods to try and coerce one data type into another if permitted and possible. A lot could probably be done here... From virtually any object, try to get it as one of the following: Boolean Byte Character Decimal Double Float Integer Long Short String


Constructor Summary
CoercionUtil()
           
 
Method Summary
static Boolean toBoolean(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Boolean, depending upon the level of mapping strictness passed in.
static Byte toByte(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Byte, depending upon the level of mapping strictness passed in.
static Character toCharacter(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Character, depending upon the level of mapping strictness passed in.
static weblogic.wtc.jatmi.Decimal toDecimal(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Decimal, depending upon the level of mapping strictness passed in.
static Double toDouble(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Double, depending upon the level of mapping strictness passed in.
static Object toFieldType(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name, int fldType)
          Determine the type of the field and try to coerce if possible and allowed.
static Float toFloat(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Float, depending upon the level of mapping strictness passed in.
static Integer toInteger(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Integer, depending upon the level of mapping strictness passed in.
static Object toJavaType(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name, int typeCode)
          Try to coerce a field into a specific java type
static Long toLong(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Long, depending upon the level of mapping strictness passed in.
static Short toShort(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a Short, depending upon the level of mapping strictness passed in.
static String toString(Object obj, TuxedoControl.MappingStrictness _strict, List _issues, String name)
          Try and coerce the passed object to a String, depending upon the level of mapping strictness passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoercionUtil

public CoercionUtil()
Method Detail

toBoolean

public static Boolean toBoolean(Object obj,
                                TuxedoControl.MappingStrictness _strict,
                                List _issues,
                                String name)
Try and coerce the passed object to a Boolean, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toByte

public static Byte toByte(Object obj,
                          TuxedoControl.MappingStrictness _strict,
                          List _issues,
                          String name)
Try and coerce the passed object to a Byte, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toCharacter

public static Character toCharacter(Object obj,
                                    TuxedoControl.MappingStrictness _strict,
                                    List _issues,
                                    String name)
Try and coerce the passed object to a Character, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toDouble

public static Double toDouble(Object obj,
                              TuxedoControl.MappingStrictness _strict,
                              List _issues,
                              String name)
Try and coerce the passed object to a Double, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toFloat

public static Float toFloat(Object obj,
                            TuxedoControl.MappingStrictness _strict,
                            List _issues,
                            String name)
Try and coerce the passed object to a Float, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toInteger

public static Integer toInteger(Object obj,
                                TuxedoControl.MappingStrictness _strict,
                                List _issues,
                                String name)
Try and coerce the passed object to a Integer, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toLong

public static Long toLong(Object obj,
                          TuxedoControl.MappingStrictness _strict,
                          List _issues,
                          String name)
Try and coerce the passed object to a Long, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toShort

public static Short toShort(Object obj,
                            TuxedoControl.MappingStrictness _strict,
                            List _issues,
                            String name)
Try and coerce the passed object to a Short, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toDecimal

public static weblogic.wtc.jatmi.Decimal toDecimal(Object obj,
                                                   TuxedoControl.MappingStrictness _strict,
                                                   List _issues,
                                                   String name)
Try and coerce the passed object to a Decimal, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toString

public static String toString(Object obj,
                              TuxedoControl.MappingStrictness _strict,
                              List _issues,
                              String name)
Try and coerce the passed object to a String, depending upon the level of mapping strictness passed in. Log any issues as appropriate, and throw any exceptions as determined by the mapping strictness.


toFieldType

public static Object toFieldType(Object obj,
                                 TuxedoControl.MappingStrictness _strict,
                                 List _issues,
                                 String name,
                                 int fldType)
Determine the type of the field and try to coerce if possible and allowed.


toJavaType

public static Object toJavaType(Object obj,
                                TuxedoControl.MappingStrictness _strict,
                                List _issues,
                                String name,
                                int typeCode)
Try to coerce a field into a specific java type