|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jacob.com.VariantUtilities
public final class VariantUtilities
A utility class used to convert between Java objects and Variants
Method Summary | |
---|---|
protected static Variant[] |
objectsToVariants(Object[] arrayOfObjectsToBeConverted)
converts an array of objects into an array of Variants by repeatedly calling obj2Variant(Object) |
protected static Variant |
objectToVariant(Object objectToBeMadeIntoVariant)
Map arguments based on msdn documentation. |
protected static void |
populateVariant(Variant targetVariant,
Object pValueObject,
boolean fByRef)
Populates a variant object from a java object. |
static BigDecimal |
roundToMSDecimal(BigDecimal sourceDecimal)
Rounds the scale and bit length so that it will pass validateDecimalScaleBits(). |
protected static void |
validateDecimalMinMax(BigDecimal in)
Does any validation that couldn't have been fixed by rounding or scale modification. |
protected static void |
validateDecimalScaleAndBits(BigDecimal in)
Verifies that we have a scale 0 <= x <= 28 and now more than 96 bits of data. |
protected static Object |
variantToObject(Variant sourceData)
Convert a JACOB Variant value to a Java object (type conversions). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected static void populateVariant(Variant targetVariant, Object pValueObject, boolean fByRef)
targetVariant
- pValueObject
- fByRef
- protected static Variant objectToVariant(Object objectToBeMadeIntoVariant)
objectToBeMadeIntoVariant
-
protected static Variant[] objectsToVariants(Object[] arrayOfObjectsToBeConverted)
arrayOfObjectsToBeConverted
-
protected static Object variantToObject(Variant sourceData)
Unlike other toXXX() methods, it does not do a type conversion except for special data types (it shouldn't do any!)
Converts Variant.VariantArray types to SafeArrays
IllegalStateException
- if no underlying windows data structure
NotImplementedException
- if unsupported conversion is requested
JacobException
- if the calculated result was a JacobObject usually as a
result of errorprotected static void validateDecimalScaleAndBits(BigDecimal in)
in
-
IllegalArgumentException
- if out of boundsprotected static void validateDecimalMinMax(BigDecimal in)
in
- The BigDecimal to be validated
IllegalArgumentException
- if the number is too large or too small or nullpublic static BigDecimal roundToMSDecimal(BigDecimal sourceDecimal)
Changing the scale on a number that can fit in an MS Decimal can change the number's representation enough that it will round to a number too large to be represented by an MS VT_DECIMAL
sourceDecimal
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |