diff --git a/README.md b/README.md index cc58a50..4e0263e 100644 --- a/README.md +++ b/README.md @@ -64,4 +64,3 @@ See [ReleaseNotes](docs/ReleaseNotes.md) for a full history. | | | | **Feature Requests** | | | none | none | - diff --git a/docs/BuildingJacobFromSource.md b/docs/BuildingJacobFromSource.md index aba4325..f45a70f 100644 --- a/docs/BuildingJacobFromSource.md +++ b/docs/BuildingJacobFromSource.md @@ -64,7 +64,7 @@ The simplest build environment includes MS Visual Studio 16.0 (Studio 2019), Ecl | 1.18 | VS 2013 (12) Windows SDK 7.1A | 1.6.0 (50) | 1.8.4 Eclipse Embedded | Eclipse 4.3 | 32 and 64 bit | | 1.19 | VS 2013 (12) Windows SDK 7.1A | 1.8.0 (52) | 1.10.1 Eclipse Provided | Eclipse 4.7 | 32 and 64 bit | | 1.20 | VS 2019 (16) Windows SDK 10 | 1.8.0 (52) | 1.10.8 Eclipse Provided | Eclipse 2020 09 | 32 and 64 bit | -| 1.21 | VS 2022 (17) Windows SDK 11 10.0.22621.0 | 17 | VSCode provided | VSCode | 32 and 64 bit | +| 1.21 | VS 2022 (17) Windows SDK 11 10.0.22621.0 | 1.8.0 (52) | VSCode provided | VSCode | 32 and 64 bit | Microsoft Visual Studio 2019 supports 64 bit builds. so no additional tools are required. diff --git a/src/main/com/jacob/activeX/ActiveXComponent.java b/src/main/com/jacob/activeX/ActiveXComponent.java index 4d0096b..8567352 100644 --- a/src/main/com/jacob/activeX/ActiveXComponent.java +++ b/src/main/com/jacob/activeX/ActiveXComponent.java @@ -47,12 +47,12 @@ public class ActiveXComponent extends Dispatch { * This constructor causes a new Windows object of the requested type to be * created. The windows CoCreate() function gets called to create the * underlying windows object. - * + * *
 	 * new ActiveXComponent("ScriptControl");
 	 * 
- * - * @param programId + * + * @param programId the registry identifer for the target */ public ActiveXComponent(String programId) { super(programId); @@ -62,8 +62,8 @@ public ActiveXComponent(String programId) { * Creates an active X component that is built on top of the COM pointers * held in the passed in dispatch. This widens the Dispatch object to pick * up the ActiveXComponent API - * - * @param dispatchToBeWrapped + * + * @param dispatchToBeWrapped - can wrap an ActiveXComponent around a dispatch */ public ActiveXComponent(Dispatch dispatchToBeWrapped) { super(dispatchToBeWrapped); @@ -71,7 +71,7 @@ public ActiveXComponent(Dispatch dispatchToBeWrapped) { /** * only used by the factories - * + * */ private ActiveXComponent() { super(); @@ -80,7 +80,7 @@ private ActiveXComponent() { /** * Probably was a cover for something else in the past. Should be * deprecated. - * + * * @return Now it actually returns this exact same object. */ public Dispatch getObject() { @@ -97,8 +97,8 @@ public Dispatch getObject() { * throws no exceptions and returns null on failure. *

* This will fail for any prog id with a ":" in it. - * - * @param pRequestedProgramId + * + * @param pRequestedProgramId the program id from the registry * @return Dispatch pointer to the COM object or null if couldn't create */ public static ActiveXComponent createNewInstance(String pRequestedProgramId) { @@ -126,8 +126,8 @@ public static ActiveXComponent createNewInstance(String pRequestedProgramId) { * that it throws no exceptions and returns null on failure. *

* This will fail for any prog id with a ":" in it - * - * @param pRequestedProgramId + * + * @param pRequestedProgramId the regsistry program id * @return Dispatch pointer to a COM object or null if wasn't already * running */ @@ -157,15 +157,15 @@ protected void finalize() { /* * ============================================================ - * + * * start of instance based calls to the COM layer * =========================================================== */ /** * retrieves a property and returns it as a Variant - * - * @param propertyName + * + * @param propertyName the property name * @return variant value of property */ public Variant getProperty(String propertyName) { @@ -174,8 +174,8 @@ public Variant getProperty(String propertyName) { /** * retrieves a property and returns it as an ActiveX component - * - * @param propertyName + * + * @param propertyName the property name * @return Dispatch representing the object under the property name */ public ActiveXComponent getPropertyAsComponent(String propertyName) { @@ -186,9 +186,9 @@ public ActiveXComponent getPropertyAsComponent(String propertyName) { /** * retrieves a property and returns it as a Boolean - * - * @param propertyName - * property we are looking up + * + * @param propertyName the property name + * property we are looking up * @return boolean value of property */ public boolean getPropertyAsBoolean(String propertyName) { @@ -197,9 +197,9 @@ public boolean getPropertyAsBoolean(String propertyName) { /** * retrieves a property and returns it as a byte - * - * @param propertyName - * property we are looking up + * + * @param propertyName the property name + * property we are looking up * @return byte value of property */ public byte getPropertyAsByte(String propertyName) { @@ -208,8 +208,8 @@ public byte getPropertyAsByte(String propertyName) { /** * retrieves a property and returns it as a String - * - * @param propertyName + * + * @param propertyName the property name * @return String value of property */ public String getPropertyAsString(String propertyName) { @@ -219,8 +219,8 @@ public String getPropertyAsString(String propertyName) { /** * retrieves a property and returns it as a int - * - * @param propertyName + * + * @param propertyName the property name * @return the property value as an int */ public int getPropertyAsInt(String propertyName) { @@ -229,11 +229,9 @@ public int getPropertyAsInt(String propertyName) { /** * sets a property on this object - * - * @param propertyName - * property name - * @param arg - * variant value to be set + * + * @param propertyName property name + * @param arg variant value to be set */ public void setProperty(String propertyName, Variant arg) { Dispatch.put(this, propertyName, arg); @@ -241,11 +239,9 @@ public void setProperty(String propertyName, Variant arg) { /** * sets a property on this object - * - * @param propertyName - * property name - * @param arg - * variant value to be set + * + * @param propertyName property name + * @param arg variant value to be set */ public void setProperty(String propertyName, Dispatch arg) { Dispatch.put(this, propertyName, arg); @@ -253,9 +249,9 @@ public void setProperty(String propertyName, Dispatch arg) { /** * sets a property to be the value of the string - * - * @param propertyName - * @param propertyValue + * + * @param propertyName the property name + * @param propertyValue the new value */ public void setProperty(String propertyName, String propertyValue) { this.setProperty(propertyName, new Variant(propertyValue)); @@ -263,10 +259,9 @@ public void setProperty(String propertyName, String propertyValue) { /** * sets a property as a boolean value - * - * @param propertyName - * @param propValue - * the boolean value we want the prop set to + * + * @param propertyName the property name + * @param propValue the boolean value we want the prop set to */ public void setProperty(String propertyName, boolean propValue) { this.setProperty(propertyName, new Variant(propValue)); @@ -274,10 +269,9 @@ public void setProperty(String propertyName, boolean propValue) { /** * sets a property as a boolean value - * - * @param propertyName - * @param propValue - * the boolean value we want the prop set to + * + * @param propertyName the property value + * @param propValue the boolean value we want the prop set to */ public void setProperty(String propertyName, byte propValue) { this.setProperty(propertyName, new Variant(propValue)); @@ -285,10 +279,9 @@ public void setProperty(String propertyName, byte propValue) { /** * sets the property as an int value - * - * @param propertyName - * @param propValue - * the int value we want the prop to be set to. + * + * @param propertyName the property name + * @param propValue the int value we want the prop to be set to. */ public void setProperty(String propertyName, int propValue) { this.setProperty(propertyName, new Variant(propValue)); @@ -306,12 +299,10 @@ public void setProperty(String propertyName, int propValue) { /** * used by the doc and application listeners to get intelligent logging - * - * @param description - * event description - * @param args - * args passed in (variants) - * + * + * @param description event description + * @param args args passed in (variants) + * */ public void logCallbackEvent(String description, Variant[] args) { String argString = ""; @@ -364,15 +355,15 @@ public void logCallbackEvent(String description, Variant[] args) { /* * ============================================================== - * + * * covers for dispatch call methods * ============================================================= */ /** * makes a dispatch call for the passed in action and no parameter - * - * @param callAction + * + * @param callAction the action to be called * @return ActiveXComponent representing the results of the call */ public ActiveXComponent invokeGetComponent(String callAction) { @@ -381,9 +372,9 @@ public ActiveXComponent invokeGetComponent(String callAction) { /** * makes a dispatch call for the passed in action and single parameter - * - * @param callAction - * @param parameters + * + * @param callAction the action to be passed in + * @param parameters this looks plural.. * @return ActiveXComponent representing the results of the call */ public ActiveXComponent invokeGetComponent(String callAction, @@ -393,9 +384,9 @@ public ActiveXComponent invokeGetComponent(String callAction, /** * invokes a single parameter call on this dispatch that returns no value - * - * @param actionCommand - * @param parameter + * + * @param actionCommand the call name + * @param parameter the String parameter * @return a Variant but that may be null for some calls */ public Variant invoke(String actionCommand, String parameter) { @@ -405,9 +396,9 @@ public Variant invoke(String actionCommand, String parameter) { /** * makes a dispatch call to the passed in action with a single boolean * parameter - * - * @param actionCommand - * @param parameter + * + * @param actionCommand the call name + * @param parameter the boolean parameter * @return Variant result */ public Variant invoke(String actionCommand, boolean parameter) { @@ -416,9 +407,9 @@ public Variant invoke(String actionCommand, boolean parameter) { /** * makes a dispatch call to the passed in action with a single int parameter - * - * @param actionCommand - * @param parameter + * + * @param actionCommand the command + * @param parameter the int parameter * @return Variant result of the invoke (Dispatch.call) */ public Variant invoke(String actionCommand, int parameter) { @@ -428,10 +419,10 @@ public Variant invoke(String actionCommand, int parameter) { /** * makes a dispatch call to the passed in action with a string and integer * parameter (this was put in for some application) - * - * @param actionCommand - * @param parameter1 - * @param parameter2 + * + * @param actionCommand command that requires a string and int vlaues + * @param parameter1 the string parameter + * @param parameter2 the int parameter * @return Variant result */ public Variant invoke(String actionCommand, String parameter1, @@ -443,10 +434,10 @@ public Variant invoke(String actionCommand, String parameter1, /** * makes a dispatch call to the passed in action with two integer parameters * (this was put in for some application) - * - * @param actionCommand - * @param parameter1 - * @param parameter2 + * + * @param actionCommand the action that accepts 2 int parmaeters + * @param parameter1 first of two int parameters + * @param parameter2 the second of two int parameters * @return a Variant but that may be null for some calls */ public Variant invoke(String actionCommand, int parameter1, int parameter2) { @@ -456,8 +447,8 @@ public Variant invoke(String actionCommand, int parameter1, int parameter2) { /** * makes a dispatch call for the passed in action and no parameter - * - * @param callAction + * + * @param callAction action name that requires zero parameters * @return a Variant but that may be null for some calls */ public Variant invoke(String callAction) { @@ -467,9 +458,9 @@ public Variant invoke(String callAction) { /** * This is really a cover for call(String,Variant[]) that should be * eliminated call with a variable number of args mainly used for quit. - * - * @param name - * @param args + * + * @param name the name we are invoking + * @param args a single arg * @return Variant returned by the invoke (Dispatch.callN) */ public Variant invoke(String name, Variant... args) { diff --git a/src/main/com/jacob/activeX/ActiveXDispatchEvents.java b/src/main/com/jacob/activeX/ActiveXDispatchEvents.java index 16bb649..c723e45 100644 --- a/src/main/com/jacob/activeX/ActiveXDispatchEvents.java +++ b/src/main/com/jacob/activeX/ActiveXDispatchEvents.java @@ -30,8 +30,8 @@ * ActiveXInvocationProxy instead of an InvocationProxy. It is the * ActiveXInvocationProxy that implements the reflection calls and invoke the * found java event callbacks. See ActiveXInvocationProxy for details. - * - * + * + * */ public class ActiveXDispatchEvents extends DispatchEvents { @@ -41,11 +41,9 @@ public class ActiveXDispatchEvents extends DispatchEvents { * Creates the event callback linkage between the the MS program represented * by the Dispatch object and the Java object that will receive the * callback. - * - * @param sourceOfEvent - * Dispatch object who's MS app will generate callbacks - * @param eventSink - * Java object that wants to receive the events + * + * @param sourceOfEvent Dispatch object who's MS app will generate callbacks + * @param eventSink Java object that wants to receive the events */ public ActiveXDispatchEvents(Dispatch sourceOfEvent, Object eventSink) { super(sourceOfEvent, eventSink, null); @@ -57,13 +55,13 @@ public ActiveXDispatchEvents(Dispatch sourceOfEvent, Object eventSink) { * Creates the event callback linkage between the the MS program represented * by the Dispatch object and the Java object that will receive the * callback. - * + * * @param sourceOfEvent - * Dispatch object who's MS app will generate callbacks + * Dispatch object who's MS app will generate callbacks * @param eventSink - * Java object that wants to receive the events + * Java object that wants to receive the events * @param progId - * ??? + * ??? */ public ActiveXDispatchEvents(Dispatch sourceOfEvent, Object eventSink, String progId) { @@ -74,18 +72,18 @@ public ActiveXDispatchEvents(Dispatch sourceOfEvent, Object eventSink, * Creates the event callback linkage between the the MS program represented * by the Dispatch object and the Java object that will receive the * callback. - * + * *

-	 * >ActiveXDispatchEvents de = 
-	 * 			new ActiveXDispatchEvents(someDispatch,someEventHAndler,
-	 * 				"Excel.Application",
-	 * 				"C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE");
-	 * 
+	 * ActiveXDispatchEvents de = new ActiveXDispatchEvents(someDispatch, someEventHAndler,
+	 * 		"Excel.Application",
+	 * 		"C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE");
+	 * 
+ * * @param sourceOfEvent Dispatch object who's MS app will generate callbacks - * @param eventSink Java object that wants to receive the events - * @param progId , mandatory if the typelib is specified - * @param typeLib The location of the typelib to use - * + * @param eventSink Java object that wants to receive the events + * @param progId , mandatory if the typelib is specified + * @param typeLib The location of the typelib to use + * */ public ActiveXDispatchEvents(Dispatch sourceOfEvent, Object eventSink, String progId, String typeLib) { @@ -94,7 +92,7 @@ public ActiveXDispatchEvents(Dispatch sourceOfEvent, Object eventSink, /* * (non-Javadoc) - * + * * @see com.jacob.com.DispatchEvents#getInvocationProxy(java.lang.Object) */ protected InvocationProxy getInvocationProxy(Object pTargetObject) { diff --git a/src/main/com/jacob/com/DateUtilities.java b/src/main/com/jacob/com/DateUtilities.java index 195ba33..2a7849b 100644 --- a/src/main/com/jacob/com/DateUtilities.java +++ b/src/main/com/jacob/com/DateUtilities.java @@ -24,16 +24,16 @@ /** * java / windows date conversion utilities - * + * * @author joe - * + * */ public class DateUtilities { /** * converts a windows time to a Java Date Object - * - * @param comTime + * + * @param comTime time in windows format * @return Date object representing the windows time as specified in comTime */ static public Date convertWindowsTimeToDate(double comTime) { @@ -45,13 +45,12 @@ static public Date convertWindowsTimeToDate(double comTime) { * (milliseconds). Visual Basic time values are based to 30.12.1899, Java * time values are based to 1.1.1970 (= 0 milliseconds). The difference is * added to the Visual Basic value to get the corresponding Java value. The - * Visual Basic double value reads: .<1 - * day percentage fraction>, e.g. "38100.6453" means: 38100 days since + * Visual Basic double value reads: <day count delta since 30.12.1899>. + * <1 day percentage fraction >, e.g. "38100.6453" means: 38100 days since * 30.12.1899 plus (24 hours * 0.6453). Example usage: * Date javaDate = new Date(toMilliseconds (vbDate));. - * - * @param comTime - * COM time. + * + * @param comTime COM time. * @return Java time. */ static public long convertWindowsTimeToMilliseconds(double comTime) { @@ -70,9 +69,9 @@ static public long convertWindowsTimeToMilliseconds(double comTime) { /** * converts a java date to a windows time object (is this timezone safe?) - * + * * @param javaDate - * the java date to be converted to windows time + * the java date to be converted to windows time * @return the double representing the date in a form windows understands */ static public double convertDateToWindowsTime(Date javaDate) { @@ -85,9 +84,8 @@ static public double convertDateToWindowsTime(Date javaDate) { /** * Convert a Java time to a COM time. - * - * @param milliseconds - * Java time. + * + * @param milliseconds Java time. * @return COM time. */ static public double convertMillisecondsToWindowsTime(long milliseconds) { diff --git a/src/main/com/jacob/com/LibraryLoader.java b/src/main/com/jacob/com/LibraryLoader.java index 4fd2740..ec0f29d 100644 --- a/src/main/com/jacob/com/LibraryLoader.java +++ b/src/main/com/jacob/com/LibraryLoader.java @@ -29,36 +29,36 @@ /** * Utility class to centralize the way in which the jacob JNI library is loaded. *

- * + * * This supports defining the path or library name using system properties or a * custom resource file. If desired, jacob can auto-detect the correct version * of the DLL for 32 or 64 bit windows, as long as you have named them * differently. - * + * *

    - *
  1. If system property {@link #JACOB_DLL_PATH} is defined, the file located - * there will be loaded as the jacob dll using System.load().
  2. - * - *
  3. If system property {@link #JACOB_DLL_NAME} is defined, the file located - * there will be loaded as the jacob dll.
  4. - *
  5. If system property {@link #JACOB_DLL_NAME_X86} and + *
  6. If system property {@link #JACOB_DLL_PATH} is defined, the file located + * there will be loaded as the jacob dll using System.load().
  7. + * + *
  8. If system property {@link #JACOB_DLL_NAME} is defined, the file located + * there will be loaded as the jacob dll.
  9. + *
  10. If system property {@link #JACOB_DLL_NAME_X86} and * {@link #JACOB_DLL_NAME_X64} are defined, the file located there will be - * loaded as the jacob dll, depending on the version of Windows.
  11. - * - *
  12. If {@link #JACOB_DLL_NAME} is defined in the + * loaded as the jacob dll, depending on the version of Windows.
  13. + * + *
  14. If {@link #JACOB_DLL_NAME} is defined in the * {@code com.jacob.com.JacobLibraryLoader} resource file, the specified dll - * will be loaded from the {@code java.library.path}.
  15. - *
  16. If {@link #JACOB_DLL_NAME_X86} and {@link #JACOB_DLL_NAME_X64} are + * will be loaded from the {@code java.library.path}.
  17. + *
  18. If {@link #JACOB_DLL_NAME_X86} and {@link #JACOB_DLL_NAME_X64} are * defined in the {@code com.jacob.com.JacobLibraryLoader} resource file, the * specified dll will be loaded from the {@code java.library.path}, depending - * on the version of Windows.
  19. - * - *
  20. If none of the above are true, the default is to load the library named - * "jacob-<version>-<arch>" (or - * "jacob-<version>-<arch&rt;.dll") from the {@code java.library.path}. + * on the version of Windows.
  21. + * + *
  22. If none of the above are true, the default is to load the library named + * "jacob-<version>-<arch>" (or + * "jacob-<version>-<arch>.dll") from the {@code java.library.path}. *
  23. *
- * + * * The standard behavior for most applications is that {@code LoadLibrary()} * will be called to load the dll. {@code LoadLibary()} searches directories * specified in the variable {@code java.library.path}. This is why most test @@ -67,7 +67,7 @@ * JACOB_DLL_PATH submitted sourceforge ticket 1493647 Added 1.11
* JACOB_DLL_NAME, JACOB_DLL_NAME_32, JACOB_DLL_NAME_64 submitted sourceforge * ticket 1845039 Added 1.14M7 - * + * * @author Scott Dickerson (sjd78) * @author Jason Smith */ @@ -112,9 +112,8 @@ public final class LibraryLoader { /** * Load the jacob dll either from an absolute path or by a library name, * both of which may be defined in various ways. - * - * @throws UnsatisfiedLinkError - * if the library does not exist. + * + * @throws UnsatisfiedLinkError if the library does not exist. */ public static void loadJacobLibrary() { // In some cases, a library that uses Jacob won't be able to set system @@ -189,8 +188,8 @@ && shouldLoad32Bit()) { * Developer note: This method MUST be synchronized with the DLL names * created as part of the build process in build.xml *

- * The DLL name is "jacob\.release" - * + * The DLL name is "jacob <PLATFORM> .release" + * * @return the preferred name of the DLL adjusted for this platform and * version without the ".dll" extension */ @@ -206,7 +205,7 @@ public static String getPreferredDLLName() { /** * Detects whether this is a 32-bit JVM. - * + * * @return {@code true} if this is a 32-bit JVM. */ protected static boolean shouldLoad32Bit() { diff --git a/src/main/com/jacob/com/Variant.java b/src/main/com/jacob/com/Variant.java index ba4bc1c..68aeba6 100644 --- a/src/main/com/jacob/com/Variant.java +++ b/src/main/com/jacob/com/Variant.java @@ -137,7 +137,7 @@ public class Variant extends JacobObject { // VT_CARRARY = 28 // VT_USERDEFINED = 29 - /** what is this? VT_TYPEMASK && VT_BSTR_BLOB 0xfff */ + /** what is this? VT_TYPEMASK && VT_BSTR_BLOB 0xfff */ public static final short VariantTypeMask = 4095; /** variant's type is array VT_ARRAY 0x2000 */ @@ -172,7 +172,7 @@ public Variant() { /** * Constructor that accepts a primitive rather than an object - * + * * @param in */ public Variant(boolean in) { @@ -181,7 +181,7 @@ public Variant(boolean in) { /** * Constructor that accepts a primitive rather than an object - * + * * @param in */ public Variant(byte in) { @@ -190,7 +190,7 @@ public Variant(byte in) { /** * Constructor that accepts a primitive rather than an object - * + * * @param in */ public Variant(double in) { @@ -199,7 +199,7 @@ public Variant(double in) { /** * Constructor that accepts a primitive rather than an object - * + * * @param in */ public Variant(float in) { @@ -208,7 +208,7 @@ public Variant(float in) { /** * Constructor that accepts a primitive rather than an object - * + * * @param in */ public Variant(int in) { @@ -217,7 +217,7 @@ public Variant(int in) { /** * Constructor that accepts a primitive rather than an object - * + * * @param in */ public Variant(long in) { @@ -227,9 +227,9 @@ public Variant(long in) { /** * Convenience constructor that calls the main one with a byRef value of * false - * + * * @param in - * object to be made into variant + * object to be made into variant */ public Variant(Object in) { this(in, false); @@ -239,10 +239,10 @@ public Variant(Object in) { * Constructor that accepts the data object and information about whether * this is by reference or not. It calls the JavaVariantConverter to * actually push the data into the newly created Variant. - * + * * @param pValueObject - * The value object that will pushed down into windows memory. A - * null object sets this to "empty" + * The value object that will pushed down into windows + * memory. A null object sets this to "empty" * @param fByRef */ public Variant(Object pValueObject, boolean fByRef) { @@ -252,7 +252,7 @@ public Variant(Object pValueObject, boolean fByRef) { /** * Constructor that accepts a primitive rather than an object - * + * * @param in */ public Variant(short in) { @@ -264,9 +264,8 @@ public Variant(short in) { *

* This cannot convert an object to a byRef. It can convert from byref to * not byref - * - * @param in - * type to convert this variant too + * + * @param in type to convert this variant too * @return Variant returns this same object so folks can change when * replacing calls toXXX() with changeType().getXXX() */ @@ -278,15 +277,14 @@ public Variant changeType(short in) { /** * Converts variant to the passed in type by converting the underlying * windows variant structure. private so folks use public java method - * - * @param in - * the desired resulting type + * + * @param in the desired resulting type */ private native void changeVariantType(short in); /** * this returns null - * + * * @return ?? comment says null? */ @Override @@ -301,7 +299,7 @@ public Variant changeType(short in) { /* * (non-Javadoc) - * + * * @see java.lang.Object#finalize() */ @Override @@ -310,10 +308,10 @@ protected void finalize() { } /** - * + * * @return returns the value as a boolean, throws an exception if its not. * @throws IllegalStateException - * if variant is not of the requested type + * if variant is not of the requested type */ public boolean getBoolean() { if (this.getvt() == VariantBoolean) { @@ -327,10 +325,9 @@ public boolean getBoolean() { /** * public cover for native method - * + * * @return the boolean from a booleanRef - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public boolean getBooleanRef() { if ((this.getvt() & VariantTypeMask) == VariantBoolean @@ -344,10 +341,9 @@ public boolean getBooleanRef() { } /** - * + * * @return returns the value as a boolean, throws an exception if its not. - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public byte getByte() { if (this.getvt() == VariantByte) { @@ -361,10 +357,9 @@ public byte getByte() { /** * public cover for native method - * + * * @return the byte from a booleanRef - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public byte getByteRef() { if ((this.getvt() & VariantTypeMask) == VariantByte @@ -380,11 +375,10 @@ public byte getByteRef() { /** * MS Currency objects are 64 bit fixed point numbers with 15 digits to the * left and 4 to the right of the decimal place. - * + * * @return returns the currency value as a long, throws exception if not a * currency type.. - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public Currency getCurrency() { if (this.getvt() == VariantCurrency) { @@ -399,11 +393,10 @@ public Currency getCurrency() { /** * MS Currency objects are 64 bit fixed point numbers with 15 digits to the * left and 4 to the right of the decimal place. - * + * * @return returns the currency value as a long, throws exception if not a * currency type - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public Currency getCurrencyRef() { if ((this.getvt() & VariantTypeMask) == VariantCurrency @@ -419,8 +412,7 @@ public Currency getCurrencyRef() { /** * @return double return the date (as a double) value held in this variant * (fails on other types?) - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public double getDate() { if (this.getvt() == VariantDate) { @@ -433,11 +425,10 @@ public double getDate() { } /** - * + * * @return returns the date value as a double, throws exception if not a * date type - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public double getDateRef() { if ((this.getvt() & VariantTypeMask) == VariantDate @@ -452,10 +443,9 @@ public double getDateRef() { /** * return the BigDecimal value held in this variant (fails on other types) - * + * * @return BigDecimal - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public BigDecimal getDecimal() { if (this.getvt() == VariantDecimal) { @@ -469,10 +459,9 @@ public BigDecimal getDecimal() { /** * return the BigDecimal value held in this variant (fails on other types) - * + * * @return BigDecimal - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public BigDecimal getDecimalRef() { if ((this.getvt() & VariantTypeMask) == VariantDecimal @@ -489,10 +478,9 @@ public BigDecimal getDecimalRef() { * cover for {@link #toDispatch()} This method now matches other getXXX() * methods. It throws an IllegalStateException if the object is not of type * VariantDispatch - * + * * @return this object as a dispatch - * @throws IllegalStateException - * if wrong variant type + * @throws IllegalStateException if wrong variant type */ public Dispatch getDispatch() { if (this.getvt() == VariantDispatch) { @@ -507,10 +495,9 @@ public Dispatch getDispatch() { /** * Dispatch and dispatchRef are treated the same This is just a cover for * toDispatch() with a flag check - * + * * @return the results of toDispatch() - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public Dispatch getDispatchRef() { if ((this.getvt() & VariantTypeMask) == VariantDispatch @@ -526,8 +513,7 @@ public Dispatch getDispatchRef() { /** * @return double return the double value held in this variant (fails on * other types?) - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public double getDouble() { if (this.getvt() == VariantDouble) { @@ -540,10 +526,9 @@ public double getDouble() { } /** - * + * * @return returns the double value, throws exception if not a Double type - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public double getDoubleRef() { if ((this.getvt() & VariantTypeMask) == VariantDouble @@ -560,7 +545,7 @@ public double getDoubleRef() { * Pointless method that was put here so that putEmpty() has a get method. * This would have returned null if the value was VT_EMPTY or if it wasn't * so it would have always returned the same value. - * + * * @deprecated method never did anything */ @Deprecated @@ -570,8 +555,7 @@ public void getEmpty() { /** * @return double return the error value held in this variant (fails on * other types?) - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public int getError() { if (this.getvt() == VariantError) { @@ -584,11 +568,10 @@ public int getError() { } /** - * + * * @return returns the error value as an int, throws exception if not a * Error type - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public int getErrorRef() { if ((this.getvt() & VariantTypeMask) == VariantError @@ -603,8 +586,7 @@ public int getErrorRef() { /** * @return returns the value as a float if the type is of type float - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public float getFloat() { if (this.getvt() == VariantFloat) { @@ -617,10 +599,9 @@ public float getFloat() { } /** - * + * * @return returns the float value, throws exception if not a Float type - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public float getFloatRef() { if ((this.getvt() & VariantTypeMask) == VariantFloat @@ -636,10 +617,9 @@ public float getFloatRef() { /** * return the int value held in this variant if it is an int or a short. * Throws for other types. - * + * * @return int contents of the windows memory - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public int getInt() { if (this.getvt() == VariantInt) { @@ -655,10 +635,9 @@ public int getInt() { /** * get the content of this variant as an int - * + * * @return int - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public int getIntRef() { if ((this.getvt() & VariantTypeMask) == VariantInt @@ -674,12 +653,11 @@ public int getIntRef() { /** * returns the windows time contained in this Variant to a Java Date. should * return null if this is not a date Variant SF 959382 - * + * * @return java.util.Date returns the date if this is a VariantDate != 0, * null if it is a VariantDate == 0 and throws an * IllegalStateException if this isn't a date. - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public Date getJavaDate() { Date returnDate = null; @@ -699,7 +677,7 @@ public Date getJavaDate() { /** * returns the windows time contained in this Variant to a Java Date should * return null if this is not a date reference Variant SF 959382 - * + * * @return java.util.Date */ public Date getJavaDateRef() { @@ -713,11 +691,10 @@ public Date getJavaDateRef() { /** * 64 bit Longs only available on x64. 64 bit long support added 1.14 - * + * * @return returns the value as a long, throws exception if not a Long * type.. - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public long getLong() { if (this.getvt() == VariantLongInt) { @@ -731,10 +708,9 @@ public long getLong() { /** * 64 bit Longs only available on x64. 64 bit long support added 1.14 - * + * * @return returns the value as a long, throws exception if not a long type - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public long getLongRef() { if ((this.getvt() & VariantTypeMask) == VariantLongInt @@ -751,7 +727,7 @@ public long getLongRef() { * This method would have returned null if the type was VT_NULL. But because * we return null if the data is not of the right type, this method should * have always returned null - * + * * @deprecated method never did anything */ @Deprecated @@ -760,10 +736,9 @@ public void getNull() { /** * return the int value held in this variant (fails on other types?) - * + * * @return int - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public short getShort() { if (this.getvt() == VariantShort) { @@ -777,10 +752,9 @@ public short getShort() { /** * get the content of this variant as an int - * + * * @return int - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public short getShortRef() { if ((this.getvt() & VariantTypeMask) == VariantShort @@ -794,10 +768,9 @@ public short getShortRef() { } /** - * + * * @return string contents of the variant, null if is of type null or empty - * @throws IllegalStateException - * if this variant is not of type String + * @throws IllegalStateException if this variant is not of type String */ public String getString() { if (getvt() == Variant.VariantString) { @@ -815,10 +788,9 @@ public String getString() { /** * gets the content of the variant as a string ref - * + * * @return String retrieved from the COM area. - * @throws IllegalStateException - * if variant is not of the requested type + * @throws IllegalStateException if variant is not of the requested type */ public String getStringRef() { if ((this.getvt() & VariantTypeMask) == VariantString @@ -835,7 +807,7 @@ public String getStringRef() { * Used to get the value from a windows type of VT_VARIANT or a jacob * Variant type of VariantVariant. Added 1.12 pre 6 - VT_VARIANT support is * at an alpha level - * + * * @return Object a java Object that represents the content of the enclosed * Variant */ @@ -888,7 +860,7 @@ public Variant[] getVariantArrayRef() { } /** - * + * * @return the value in this Variant as a boolean, null if not a boolean */ private native boolean getVariantBoolean(); @@ -923,7 +895,7 @@ public Variant[] getVariantArrayRef() { /** * get the content of this variant as a double representing a date - * + * * @return double */ private native double getVariantDateRef(); @@ -985,7 +957,7 @@ public Variant[] getVariantArrayRef() { /** * get the content of this variant as a short - * + * * @return short */ private native short getVariantShort(); @@ -997,7 +969,7 @@ public Variant[] getVariantArrayRef() { /** * Native method that actually extracts a string value from the variant - * + * * @return */ private native String getVariantString(); @@ -1009,7 +981,7 @@ public Variant[] getVariantArrayRef() { /** * Returns the variant type via a native method call - * + * * @return short one of the VT_xx types */ private native short getVariantType(); @@ -1017,19 +989,19 @@ public Variant[] getVariantArrayRef() { /** * Returns the variant type via a native method call. Added 1.12 pre 6 - * VT_VARIANT support is at an alpha level - * + * * @return Variant one of the VT_Variant types */ private native long getVariantVariant(); /** * Reports the type of the underlying Variant object - * + * * @return returns the variant type as a short, one of the Variantxxx values * defined as statics in this class. returns VariantNull if not * initialized - * @throws IllegalStateException - * if there is no underlying windows data structure + * @throws IllegalStateException if there is no underlying windows data + * structure */ public short getvt() { if (m_pVariant != 0) { @@ -1045,10 +1017,9 @@ public short getvt() { protected native void init(); /** - * + * * @return returns true if the variant is considered null - * @throws IllegalStateException - * if there is no underlying windows memory + * @throws IllegalStateException if there is no underlying windows memory */ public boolean isNull() { getvt(); @@ -1057,14 +1028,14 @@ public boolean isNull() { /** * is the variant null or empty or error or null dispatch - * + * * @return true if it is null or false if not */ private native boolean isVariantConsideredNull(); /** * sets the type to VT_ERROR and the error message to DISP_E_PARAMNOTFOIUND - * + * * @deprecated replaced by putNoParam() */ @Deprecated @@ -1075,7 +1046,7 @@ public void noParam() { /** * returns true if the passed in Variant is a constant that should not be * freed - * + * * @param pVariant * @return boolean that is true if Variant is a type of constant, VT_FALSE, * VT_TRUE, VT_MISSING, DEFAULT @@ -1092,9 +1063,8 @@ protected boolean objectIsAConstant(Variant pVariant) { /** * puts a boolean into the variant and sets it's type - * - * @param in - * the new value + * + * @param in the new value */ public void putBoolean(boolean in) { // verify we aren't released yet @@ -1105,7 +1075,7 @@ public void putBoolean(boolean in) { /** * pushes a boolean into the variant by ref and sets the type of the variant * to boolean - * + * * @param in */ public void putBooleanRef(boolean in) { @@ -1116,7 +1086,7 @@ public void putBooleanRef(boolean in) { /** * pushes a byte into the varaint and sets the type - * + * * @param in */ public void putByte(byte in) { @@ -1127,8 +1097,7 @@ public void putByte(byte in) { /** * @deprecated superseded by SafeArray - * @param in - * doesn't matter because this method does nothing + * @param in doesn't matter because this method does nothing * @throws com.jacob.com.NotImplementedException */ @Deprecated @@ -1138,7 +1107,7 @@ public void putByteArray(Object in) { /** * pushes a byte into the variant by ref and sets the type - * + * * @param in */ public void putByteRef(byte in) { @@ -1148,9 +1117,8 @@ public void putByteRef(byte in) { } /** - * @param in - * the object that would be wrapped by the Variant if this method - * was implemented + * @param in the object that would be wrapped by the Variant if this method was + * implemented * @deprecated superseded by SafeArray * @throws com.jacob.com.NotImplementedException */ @@ -1163,9 +1131,8 @@ public void putCharArray(Object in) { * Puts a value in as a currency and sets the variant type. MS Currency * objects are 64 bit fixed point numbers with 15 digits to the left and 4 * to the right of the decimal place. - * - * @param in - * the long that will be put into the 64 bit currency object. + * + * @param in the long that will be put into the 64 bit currency object. */ public void putCurrency(Currency in) { // verify we aren't released yet @@ -1177,9 +1144,8 @@ public void putCurrency(Currency in) { * Pushes a long into the variant as currency and sets the type. MS Currency * objects are 64 bit fixed point numbers with 15 digits to the left and 4 * to the right of the decimal place. - * - * @param in - * the long that will be put into the 64 bit currency object + * + * @param in the long that will be put into the 64 bit currency object */ public void putCurrencyRef(Currency in) { // verify we aren't released yet @@ -1190,11 +1156,9 @@ public void putCurrencyRef(Currency in) { /** * converts a java date to a windows time and calls putDate(double) SF * 959382 - * - * @param inDate - * a Java date to be converted - * @throws IllegalArgumentException - * if inDate = null + * + * @param inDate a Java date to be converted + * @throws IllegalArgumentException if inDate = null */ public void putDate(Date inDate) { if (inDate == null) { @@ -1208,7 +1172,7 @@ public void putDate(Date inDate) { /** * puts a windows date double into the variant and sets the type - * + * * @param in */ public void putDate(double in) { @@ -1220,11 +1184,9 @@ public void putDate(double in) { /** * converts a java date to a windows time and calls putDateRef(double) SF * 959382 - * - * @param inDate - * a Java date to be converted - * @throws IllegalArgumentException - * if inDate = null + * + * @param inDate a Java date to be converted + * @throws IllegalArgumentException if inDate = null */ public void putDateRef(Date inDate) { if (inDate == null) { @@ -1238,7 +1200,7 @@ public void putDateRef(Date inDate) { /** * set the content of this variant to a date (VT_DATE|VT_BYREF) - * + * * @param in */ public void putDateRef(double in) { @@ -1250,14 +1212,12 @@ public void putDateRef(double in) { /** * This actual does all the validating and massaging of the BigDecimalValues * when converting them to MS Decimal types - * - * @param in - * number to be made into VT_DECIMAL - * @param byRef - * store by reference or not - * @param roundingBehavior - * one of the BigDecimal ROUND_xxx methods. Any method other than - * ROUND_UNECESSARY means that the value will be rounded to fit + * + * @param in number to be made into VT_DECIMAL + * @param byRef store by reference or not + * @param roundingBehavior one of the BigDecimal ROUND_xxx methods. Any method + * other than ROUND_UNECESSARY means that the value will + * be rounded to fit */ private void putDecimal(BigDecimal in, boolean byRef) { // verify we aren't released @@ -1304,12 +1264,12 @@ private void putDecimal(BigDecimal in, boolean byRef) { * There are 12 bytes available for the integer number. *

* There is 1 byte for the scale. - * + * * @param in - * the BigDecimal that will be converted to VT_DECIMAL - * @throws IllegalArgumentException - * if the scale is > 28, the maximum for VT_DECIMAL or if there - * are more than 12 bytes worth the digits + * the BigDecimal that will be converted to VT_DECIMAL + * @throws IllegalArgumentException if the scale is > 28, the maximum for + * VT_DECIMAL or if there are more than 12 + * bytes worth the digits */ public void putDecimal(BigDecimal in) { putDecimal(in, false); @@ -1326,12 +1286,12 @@ public void putDecimal(BigDecimal in) { * There are 12 bytes available for the integer number. *

* There is 1 byte for the scale. - * + * * @param in - * the BigDecimal that will be converted to VT_DECIMAL - * @throws IllegalArgumentException - * if the scale is > 28, the maximum for VT_DECIMAL or if there - * are more than 12 bytes worth the digits + * the BigDecimal that will be converted to VT_DECIMAL + * @throws IllegalArgumentException if the scale is > 28, the maximum for + * VT_DECIMAL or if there + * are more than 12 bytes worth the digits */ public void putDecimalRef(BigDecimal in) { putDecimal(in, true); @@ -1339,9 +1299,8 @@ public void putDecimalRef(BigDecimal in) { /** * This acts a cover for putVariant Dispatch. - * - * @param in - * the Dispatch we're putting down in the COM variant space. + * + * @param in the Dispatch we're putting down in the COM variant space. */ public void putDispatch(Dispatch in) { putVariantDispatch(in); @@ -1351,9 +1310,8 @@ public void putDispatch(Dispatch in) { * Dispatch and dispatchRef are treated the same This is a cover for * putVariantDispatch(). putDispatch and putDispatchRef are treated the same * because no one has written the COM code for putDispatchRef. - * - * @param in - * the Dispatch we're putting down in the COM variant space. + * + * @param in the Dispatch we're putting down in the COM variant space. */ public void putDispatchRef(Dispatch in) { putVariantDispatch(in); @@ -1361,7 +1319,7 @@ public void putDispatchRef(Dispatch in) { /** * wraps this Variant around the passed in double. - * + * * @param in */ public void putDouble(double in) { @@ -1372,7 +1330,7 @@ public void putDouble(double in) { /** * set the content of this variant to a double (VT_R8|VT_BYREF) - * + * * @param in */ public void putDoubleRef(double in) { @@ -1383,7 +1341,7 @@ public void putDoubleRef(double in) { /** * sets the type to VariantEmpty - * + * */ public void putEmpty() { // verify we aren't released yet @@ -1393,7 +1351,7 @@ public void putEmpty() { /** * puts an error code (I think) into the variant and sets the type - * + * * @param in */ public void putError(int in) { @@ -1404,7 +1362,7 @@ public void putError(int in) { /** * pushes an error code into the variant by ref and sets the type - * + * * @param in */ public void putErrorRef(int in) { @@ -1415,7 +1373,7 @@ public void putErrorRef(int in) { /** * fills the Variant with a float and sets the type to float - * + * * @param in */ public void putFloat(float in) { @@ -1426,7 +1384,7 @@ public void putFloat(float in) { /** * pushes a float into the variant and sets the type - * + * * @param in */ public void putFloatRef(float in) { @@ -1437,7 +1395,7 @@ public void putFloatRef(float in) { /** * set the value of this variant and set the type - * + * * @param in */ public void putInt(int in) { @@ -1448,7 +1406,7 @@ public void putInt(int in) { /** * set the content of this variant to an int (VT_I4|VT_BYREF) - * + * * @param in */ public void putIntRef(int in) { @@ -1460,9 +1418,8 @@ public void putIntRef(int in) { /** * Puts a 64 bit Java Long into a 64 bit Variant Long. Only works on x64 * systems otherwise throws an error. 64 bit long support added 1.14 - * - * @param in - * the long that will be put into the 64 bit Long object. + * + * @param in the long that will be put into the 64 bit Long object. */ public void putLong(long in) { // verify we aren't released yet @@ -1473,9 +1430,8 @@ public void putLong(long in) { /** * Puts a 64 bit Java Long into a 64 bit Variant Long. Only works on x64 * systems otherwise throws an error. 64 bit long support added 1.14 - * - * @param in - * the long that will be put into the 64 bit Long object. + * + * @param in the long that will be put into the 64 bit Long object. */ public void putLongRef(long in) { // verify we aren't released yet @@ -1515,9 +1471,8 @@ public void putNull() { * Puts an object into the Variant -- converts to Dispatch. Acts as a cover * for putVariantDispatch(); This primarily exists to support jacobgen. This * should be deprecated. - * - * @param in - * the object we are putting into the Variant, assumes a + * + * @param in the object we are putting into the Variant, assumes a * @see Variant#putDispatch(Dispatch) * @deprecated should use putDispatch() */ @@ -1530,7 +1485,7 @@ public void putObject(Object in) { /** * Just a cover for putObject(). We shouldn't accept any old random object. * This has been left in to support jacobgen. This should be deprecated. - * + * * @param in * @deprecated */ @@ -1541,7 +1496,7 @@ public void putObjectRef(Object in) { /** * have no idea... - * + * * @param in */ public void putSafeArray(SafeArray in) { @@ -1552,7 +1507,7 @@ public void putSafeArray(SafeArray in) { /** * have no idea... - * + * * @param in */ public void putSafeArrayRef(SafeArray in) { @@ -1563,7 +1518,7 @@ public void putSafeArrayRef(SafeArray in) { /** * set the content of this variant to a short (VT_I2) - * + * * @param in */ public void putShort(short in) { @@ -1574,7 +1529,7 @@ public void putShort(short in) { /** * set the content of this variant to a short (VT_I2|VT_BYREF) - * + * * @param in */ public void putShortRef(short in) { @@ -1585,7 +1540,7 @@ public void putShortRef(short in) { /** * put a string into the variant and set its type - * + * * @param in */ public void putString(String in) { @@ -1596,7 +1551,7 @@ public void putString(String in) { /** * set the content of this variant to a string (VT_BSTR|VT_BYREF) - * + * * @param in */ public void putStringRef(String in) { @@ -1608,15 +1563,16 @@ public void putStringRef(String in) { /** * Puts a variant into this variant making it type VT_VARIANT. Added 1.12 * pre 6 - * - * @param objectToBeWrapped - * A object that is to be referenced by this variant. If - * objectToBeWrapped is already of type Variant, then it is used. - * If objectToBeWrapped is not Variant then - * new Variant(objectToBeWrapped) is called and the - * result is passed into the com layer + * + * @param objectToBeWrapped A object that is to be referenced by this variant. + * If objectToBeWrapped is already of type Variant, + * then it is used. If objectToBeWrapped is not Variant + * then + * new Variant(objectToBeWrapped) is + * called and the result is passed into the com layer * @throws IllegalArgumentException - * if inVariant = null or if inVariant is a Varint + * if inVariant = null or if inVariant is a + * Varint */ public void putVariant(Object objectToBeWrapped) { if (objectToBeWrapped == null) { @@ -1639,8 +1595,7 @@ public void putVariant(Object objectToBeWrapped) { /** * @deprecated superseded by SafeArray - * @param in - * doesn't matter because this method does nothing + * @param in doesn't matter because this method does nothing * @throws com.jacob.com.NotImplementedException */ @Deprecated @@ -1649,9 +1604,8 @@ public void putVariantArray(Variant[] in) { } /** - * @param in - * the thing that would be come an array if this method was - * implemented + * @param in the thing that would be come an array if this method was + * implemented * @deprecated superseded by SafeArray * @throws com.jacob.com.NotImplementedException */ @@ -1662,96 +1616,80 @@ public void putVariantArrayRef(Variant[] in) { /** * puts a boolean into the variant and sets it's type - * - * @param in - * the new value + * + * @param in the new value */ private native void putVariantBoolean(boolean in); /** * puts a boolean into the variant and sets it's type - * - * @param in - * the new value + * + * @param in the new value */ private native void putVariantBooleanRef(boolean in); /** * puts a byte into the variant and sets it's type - * - * @param in - * the new value + * + * @param in the new value */ private native void putVariantByte(byte in); /** * puts a byte into the variant and sets it's type - * - * @param in - * the new value + * + * @param in the new value */ private native void putVariantByteRef(byte in); /** * puts a Currency into the variant and sets it's type - * - * @param in - * the new value + * + * @param in the new value */ private native void putVariantCurrency(long in); /** * puts a Currency into the variant and sets it's type - * - * @param in - * the new value + * + * @param in the new value */ private native void putVariantCurrencyRef(long in); /** * set the value of this variant - * + * * @param in */ private native void putVariantDate(double in); /** * set the content of this variant to a date (VT_DATE|VT_BYREF) - * + * * @param in */ private native void putVariantDateRef(double in); /** * private JNI method called by putDecimal - * - * @param signum - * sign - * @param scale - * BigDecimal's scale - * @param lo - * low 32 bits - * @param mid - * middle 32 bits - * @param hi - * high 32 bits + * + * @param signum sign + * @param scale BigDecimal's scale + * @param lo low 32 bits + * @param mid middle 32 bits + * @param hi high 32 bits */ private native void putVariantDec(int signum, byte scale, int lo, int mid, int hi); /** * private JNI method called by putDecimalRef - * - * @param signum - * sign - * @param scale - * BigDecimal's scale - * @param lo - * low 32 bits - * @param mid - * middle 32 bits - * @param hi - * high 32 bits + * + * @param signum sign + * @param scale BigDecimal's scale + * @param lo low 32 bits + * @param mid middle 32 bits + * @param hi high 32 bits */ private native void putVariantDecRef(int signum, byte scale, int lo, int mid, int hi); @@ -1759,9 +1697,8 @@ private native void putVariantDecRef(int signum, byte scale, int lo, /** * the JNI implementation for putDispatch() so that we can screen the * incoming dispatches in putDispatch() before this is invoked - * - * @param in - * should be a dispatch object + * + * @param in should be a dispatch object */ private native void putVariantDispatch(Object in); @@ -1769,7 +1706,7 @@ private native void putVariantDecRef(int signum, byte scale, int lo, /** * set the content of this variant to a double (VT_R8|VT_BYREF) - * + * * @param in */ private native void putVariantDoubleRef(double in); @@ -1785,7 +1722,7 @@ private native void putVariantDecRef(int signum, byte scale, int lo, /** * fills the Variant with a float and sets the type to float - * + * * @param in */ private native void putVariantFloat(float in); @@ -1794,14 +1731,14 @@ private native void putVariantDecRef(int signum, byte scale, int lo, /** * set the value of this variant and set the type - * + * * @param in */ private native void putVariantInt(int in); /** * set the content of this variant to an int (VT_I4|VT_BYREF) - * + * * @param in */ private native void putVariantIntRef(int in); @@ -1832,14 +1769,14 @@ private native void putVariantDecRef(int signum, byte scale, int lo, /** * set the content of this variant to a short (VT_I2) - * + * * @param in */ private native void putVariantShort(short in); /** * set the content of this variant to a short (VT_I2|VT_BYREF) - * + * * @param in */ private native void putVariantShortRef(short in); @@ -1848,28 +1785,27 @@ private native void putVariantDecRef(int signum, byte scale, int lo, /** * set the content of this variant to a string (VT_BSTR|VT_BYREF) - * + * * @param in */ private native void putVariantStringRef(String in); /** * All VariantVariant type variants are BYREF. - * + * * Set the content of this variant to a string (VT_VARIANT|VT_BYREF). - * + * * Added 1.12 pre 6 - VT_VARIANT support is at an alpha level - * - * @param in - * variant to be wrapped - * + * + * @param in variant to be wrapped + * */ private native void putVariantVariant(Variant in); /** * now private so only this object can access was: call this to explicitly * release the com object before gc - * + * */ private native void release(); @@ -1877,7 +1813,7 @@ private native void putVariantDecRef(int signum, byte scale, int lo, * This will release the "C" memory for the Variant unless this Variant is * one of the constants in which case we don't want to release the memory. *

- * + * * @see com.jacob.com.JacobObject#safeRelease() */ @Override @@ -1919,7 +1855,7 @@ public void safeRelease() { /** * this is supposed to cause the underlying variant object struct to be * rebuilt from a previously serialized byte array. - * + * * @param ba */ protected native void SerializationReadFromBytes(byte[] ba); @@ -1943,7 +1879,7 @@ public boolean toBoolean() { /** * attempts to return the content of this variant as a double (after * possible conversion) - * + * * @deprecated should be replaced by changeType() followed by getByte() * @return byte */ @@ -2019,7 +1955,7 @@ public double toDouble() { /** * converts to an error type and returns the error - * + * * @deprecated should use changeType() followed by getError() * @return the error as an int (after conversion) */ @@ -2032,7 +1968,7 @@ public int toError() { /** * attempts to return the contents of this variant as a float (after * possible conversion) - * + * * @deprecated should use changeType() and getFloat() instead * @return float */ @@ -2060,11 +1996,11 @@ public int toInt() { * conversion code *

* This does not convert the data - * + * * @deprecated callers should use getDate() * @return java.util.Date version of this variant if it is a date, otherwise * null - * + * */ @Deprecated public Date toJavaDate() { @@ -2077,15 +2013,12 @@ public Date toJavaDate() { * provided in Sourceforge feature request 959381. See * JavaVariantConverter..convertVariantTJavaObject(Variant) for more * information. - * + * * @return Corresponding Java object of the type matching the Variant type. - * @throws IllegalStateException - * if no underlying windows data structure - * @throws NotImplementedException - * if unsupported conversion is requested - * @throws JacobException - * if the calculated result was a JacobObject usually as a - * result of error + * @throws IllegalStateException if no underlying windows data structure + * @throws NotImplementedException if unsupported conversion is requested + * @throws JacobException if the calculated result was a JacobObject + * usually as a result of error */ public Object toJavaObject() throws JacobException { return VariantUtilities.variantToObject(this); @@ -2093,7 +2026,7 @@ public Object toJavaObject() throws JacobException { /** * Acts a a cover for toDispatch. This primarily exists to support jacobgen. - * + * * @deprecated this is a cover for toDispatch(); * @return Object returned by toDispatch() * @see Variant#toDispatch() instead @@ -2107,7 +2040,7 @@ public Object toObject() { * By default toSafeArray makes a deep copy due to the fact that this * Variant owns the embedded SafeArray and will destroy it when it gc's * calls toSafeArray(true). - * + * * @return the object converted to a SafeArray */ public SafeArray toSafeArray() { @@ -2119,7 +2052,7 @@ public SafeArray toSafeArray() { /** * This lets folk turn into a safe array without a deep copy. Should this * API be public? - * + * * @param deepCopy * @return SafeArray constructed */ @@ -2131,7 +2064,7 @@ public SafeArray toSafeArray(boolean deepCopy) { /** * I don't know what this is. Is it some legacy (pre 1.8) thing? - * + * * @deprecated * @return this object as a dispatch object by calling toDispatch() */ @@ -2143,7 +2076,7 @@ public Object toScriptObject() { /** * attempts to return the contents of this Variant as a short (after * possible conversion) - * + * * @deprecated callers should use changeType() followed by getShort() * @return short */ @@ -2165,10 +2098,11 @@ public short toShort() { * conversions where the returned value was 0. *

  • the value if we know how to describe one of that type *
  • three question marks if can't convert - * + * + * * @return String value conversion, - * @throws IllegalStateException - * if there is no underlying windows data structure + * @throws IllegalStateException if there is no underlying windows data + * structure */ @Override public String toString() { @@ -2202,7 +2136,7 @@ public String toString() { /** * Exists to support jacobgen. This would be deprecated if it weren't for * jacobgen - * + * * @deprecated superseded by "this" * @return this same object */ @@ -2223,7 +2157,7 @@ public Variant[] toVariantArray() { /** * native method used by toDispatch() - * + * * @return */ private native Dispatch toVariantDispatch(); @@ -2232,8 +2166,8 @@ public Variant[] toVariantArray() { /* * ===================================================================== - * - * + * + * * ===================================================================== */ diff --git a/src/main/com/jacob/com/VariantUtilities.java b/src/main/com/jacob/com/VariantUtilities.java index 1ac652a..8264cca 100644 --- a/src/main/com/jacob/com/VariantUtilities.java +++ b/src/main/com/jacob/com/VariantUtilities.java @@ -1,5 +1,5 @@ /** - * + * */ package com.jacob.com; @@ -20,7 +20,7 @@ private VariantUtilities() { /** * Populates a variant object from a java object. This method attempts to * figure out the appropriate Variant type - * + * * @param targetVariant * @param pValueObject * @param fByRef @@ -125,7 +125,7 @@ protected static void populateVariant(Variant targetVariant, /** * Map arguments based on msdn documentation. This method relies on the * variant constructor except for arrays. - * + * * @param objectToBeMadeIntoVariant * @return Variant that represents the object */ @@ -207,7 +207,7 @@ protected static Variant objectToVariant(Object objectToBeMadeIntoVariant) { /** * converts an array of objects into an array of Variants by repeatedly * calling obj2Variant(Object) - * + * * @param arrayOfObjectsToBeConverted * @return Variant[] */ @@ -234,15 +234,12 @@ protected static Variant[] objectsToVariants( * special data types (it shouldn't do any!) *

    * Converts Variant.VariantArray types to SafeArrays - * + * * @return Corresponding Java object of the type matching the Variant type. - * @throws IllegalStateException - * if no underlying windows data structure - * @throws NotImplementedException - * if unsupported conversion is requested - * @throws JacobException - * if the calculated result was a JacobObject usually as a - * result of error + * @throws IllegalStateException if no underlying windows data structure + * @throws NotImplementedException if unsupported conversion is requested + * @throws JacobException if the calculated result was a JacobObject + * usually as a result of error */ protected static Object variantToObject(Variant sourceData) { Object result = null; @@ -263,115 +260,115 @@ protected static Object variantToObject(Variant sourceData) { result = array; } else { // non-array object returned switch (type) { - case Variant.VariantEmpty: // 0 - case Variant.VariantNull: // 1 - break; - case Variant.VariantShort: // 2 - result = new Short(sourceData.getShort()); - break; - case Variant.VariantShort | Variant.VariantByref: // 2 - result = new Short(sourceData.getShortRef()); - break; - case Variant.VariantInt: // 3 - result = new Integer(sourceData.getInt()); - break; - case Variant.VariantInt | Variant.VariantByref: // 3 - result = new Integer(sourceData.getIntRef()); - break; - case Variant.VariantFloat: // 4 - result = new Float(sourceData.getFloat()); - break; - case Variant.VariantFloat | Variant.VariantByref: // 4 - result = new Float(sourceData.getFloatRef()); - break; - case Variant.VariantDouble: // 5 - result = new Double(sourceData.getDouble()); - break; - case Variant.VariantDouble | Variant.VariantByref: // 5 - result = new Double(sourceData.getDoubleRef()); - break; - case Variant.VariantCurrency: // 6 - result = sourceData.getCurrency(); - break; - case Variant.VariantCurrency | Variant.VariantByref: // 6 - result = sourceData.getCurrencyRef(); - break; - case Variant.VariantDate: // 7 - result = sourceData.getJavaDate(); - break; - case Variant.VariantDate | Variant.VariantByref: // 7 - result = sourceData.getJavaDateRef(); - break; - case Variant.VariantString: // 8 - result = sourceData.getString(); - break; - case Variant.VariantString | Variant.VariantByref: // 8 - result = sourceData.getStringRef(); - break; - case Variant.VariantDispatch: // 9 - result = sourceData.getDispatch(); - break; - case Variant.VariantDispatch | Variant.VariantByref: // 9 - result = sourceData.getDispatchRef(); // Can dispatches even - // be byRef? - break; - case Variant.VariantError: // 10 - result = new NotImplementedException( - "toJavaObject() Not implemented for VariantError"); - break; - case Variant.VariantBoolean: // 11 - result = new Boolean(sourceData.getBoolean()); - break; - case Variant.VariantBoolean | Variant.VariantByref: // 11 - result = new Boolean(sourceData.getBooleanRef()); - break; - case Variant.VariantVariant: // 12 they are always by ref - result = new NotImplementedException( - "toJavaObject() Not implemented for VariantVariant without ByRef"); - break; - case Variant.VariantVariant | Variant.VariantByref: // 12 - result = sourceData.getVariant(); - break; - case Variant.VariantObject: // 13 - result = new NotImplementedException( - "toJavaObject() Not implemented for VariantObject"); - break; - case Variant.VariantDecimal: // 14 - result = sourceData.getDecimal(); - break; - case Variant.VariantDecimal | Variant.VariantByref: // 14 - result = sourceData.getDecimalRef(); - break; - case Variant.VariantByte: // 17 - result = new Byte(sourceData.getByte()); - break; - case Variant.VariantByte | Variant.VariantByref: // 17 - result = new Byte(sourceData.getByteRef()); - break; - case Variant.VariantLongInt: // 20 - result = new Long(sourceData.getLong()); - break; - case Variant.VariantLongInt | Variant.VariantByref: // 20 - result = new Long(sourceData.getLongRef()); - break; - case Variant.VariantTypeMask: // 4095 - result = new NotImplementedException( - "toJavaObject() Not implemented for VariantBstrBlob/VariantTypeMask"); - break; - case Variant.VariantArray: // 8192 - result = new NotImplementedException( - "toJavaObject() Not implemented for VariantArray"); - break; - case Variant.VariantByref: // 16384 - result = new NotImplementedException( - "toJavaObject() Not implemented for VariantByref"); - break; - default: - result = new NotImplementedException("Unknown return type: " - + type); - // there was a "return result" here that caused defect 1602118 - // so it was removed - break; + case Variant.VariantEmpty: // 0 + case Variant.VariantNull: // 1 + break; + case Variant.VariantShort: // 2 + result = new Short(sourceData.getShort()); + break; + case Variant.VariantShort | Variant.VariantByref: // 2 + result = new Short(sourceData.getShortRef()); + break; + case Variant.VariantInt: // 3 + result = new Integer(sourceData.getInt()); + break; + case Variant.VariantInt | Variant.VariantByref: // 3 + result = new Integer(sourceData.getIntRef()); + break; + case Variant.VariantFloat: // 4 + result = new Float(sourceData.getFloat()); + break; + case Variant.VariantFloat | Variant.VariantByref: // 4 + result = new Float(sourceData.getFloatRef()); + break; + case Variant.VariantDouble: // 5 + result = new Double(sourceData.getDouble()); + break; + case Variant.VariantDouble | Variant.VariantByref: // 5 + result = new Double(sourceData.getDoubleRef()); + break; + case Variant.VariantCurrency: // 6 + result = sourceData.getCurrency(); + break; + case Variant.VariantCurrency | Variant.VariantByref: // 6 + result = sourceData.getCurrencyRef(); + break; + case Variant.VariantDate: // 7 + result = sourceData.getJavaDate(); + break; + case Variant.VariantDate | Variant.VariantByref: // 7 + result = sourceData.getJavaDateRef(); + break; + case Variant.VariantString: // 8 + result = sourceData.getString(); + break; + case Variant.VariantString | Variant.VariantByref: // 8 + result = sourceData.getStringRef(); + break; + case Variant.VariantDispatch: // 9 + result = sourceData.getDispatch(); + break; + case Variant.VariantDispatch | Variant.VariantByref: // 9 + result = sourceData.getDispatchRef(); // Can dispatches even + // be byRef? + break; + case Variant.VariantError: // 10 + result = new NotImplementedException( + "toJavaObject() Not implemented for VariantError"); + break; + case Variant.VariantBoolean: // 11 + result = new Boolean(sourceData.getBoolean()); + break; + case Variant.VariantBoolean | Variant.VariantByref: // 11 + result = new Boolean(sourceData.getBooleanRef()); + break; + case Variant.VariantVariant: // 12 they are always by ref + result = new NotImplementedException( + "toJavaObject() Not implemented for VariantVariant without ByRef"); + break; + case Variant.VariantVariant | Variant.VariantByref: // 12 + result = sourceData.getVariant(); + break; + case Variant.VariantObject: // 13 + result = new NotImplementedException( + "toJavaObject() Not implemented for VariantObject"); + break; + case Variant.VariantDecimal: // 14 + result = sourceData.getDecimal(); + break; + case Variant.VariantDecimal | Variant.VariantByref: // 14 + result = sourceData.getDecimalRef(); + break; + case Variant.VariantByte: // 17 + result = new Byte(sourceData.getByte()); + break; + case Variant.VariantByte | Variant.VariantByref: // 17 + result = new Byte(sourceData.getByteRef()); + break; + case Variant.VariantLongInt: // 20 + result = new Long(sourceData.getLong()); + break; + case Variant.VariantLongInt | Variant.VariantByref: // 20 + result = new Long(sourceData.getLongRef()); + break; + case Variant.VariantTypeMask: // 4095 + result = new NotImplementedException( + "toJavaObject() Not implemented for VariantBstrBlob/VariantTypeMask"); + break; + case Variant.VariantArray: // 8192 + result = new NotImplementedException( + "toJavaObject() Not implemented for VariantArray"); + break; + case Variant.VariantByref: // 16384 + result = new NotImplementedException( + "toJavaObject() Not implemented for VariantByref"); + break; + default: + result = new NotImplementedException("Unknown return type: " + + type); + // there was a "return result" here that caused defect 1602118 + // so it was removed + break; }// switch (type) if (result instanceof JacobException) { @@ -383,13 +380,12 @@ protected static Object variantToObject(Variant sourceData) { }// toJava() /** - * Verifies that we have a scale 0 <= x <= 28 and now more than 96 bits of + * Verifies that we have a scale 0 <= x <= 28 and now more than 96 bits of * data. The roundToMSDecimal method will attempt to adjust a BigDecimal to * pass this set of tests - * + * * @param in - * @throws IllegalArgumentException - * if out of bounds + * @throws IllegalArgumentException if out of bounds */ protected static void validateDecimalScaleAndBits(BigDecimal in) { BigInteger allWordBigInt = in.unscaledValue(); @@ -407,7 +403,7 @@ protected static void validateDecimalScaleAndBits(BigDecimal in) { throw new IllegalArgumentException( "VT_DECIMAL supports a maximum of " + 12 - * 8 + * 8 + " bits not counting scale and the number passed in has " + allWordBigInt.bitLength()); @@ -432,11 +428,10 @@ protected static void validateDecimalScaleAndBits(BigDecimal in) { /** * Does any validation that couldn't have been fixed by rounding or scale * modification. - * - * @param in - * The BigDecimal to be validated - * @throws IllegalArgumentException - * if the number is too large or too small or null + * + * @param in The BigDecimal to be validated + * @throws IllegalArgumentException if the number is too large or too small or + * null */ protected static void validateDecimalMinMax(BigDecimal in) { if (in == null) { @@ -464,7 +459,7 @@ protected static void validateDecimalMinMax(BigDecimal in) { * 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 - * + * * @param sourceDecimal * @return BigDecimal a new big decimal that was rounded to fit in an MS * VT_DECIMAL