本文整理汇总了Java中com.jacob.com.Variant.getDispatch方法的典型用法代码示例。如果您正苦于以下问题:Java Variant.getDispatch方法的具体用法?Java Variant.getDispatch怎么用?Java Variant.getDispatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jacob.com.Variant
的用法示例。
在下文中一共展示了Variant.getDispatch方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReferencedFieldAsIntArray
import com.jacob.com.Variant; //导入方法依赖的package包/类
public Integer[] getReferencedFieldAsIntArray(String fieldName,
String subFieldName) {
List<Integer> result = new ArrayList<Integer>();
Variant res = Dispatch.call(this, "Field", fieldName);
if (!res.isNull()) {
assert (res.getvt() == Variant.VariantDispatch);
Dispatch list = res.getDispatch();
Variant listSize = Dispatch.call(list, "Count");
assert (listSize.getvt() == Variant.VariantInt);
int numItems = listSize.getInt();
for (int i = 1; i <= numItems; i++) {
Variant itemObj = Dispatch.call(list, "Item", i);
assert (itemObj.getvt() == Variant.VariantDispatch);
Dispatch subfield = itemObj.getDispatch();
Variant subFieldVal = Dispatch.call(subfield, subFieldName);
assert (subFieldVal.getvt() == Variant.VariantInt);
if (!subFieldVal.isNull()) {
result.add(subFieldVal.getInt());
}
}
}
return result.toArray(new Integer[] {});
}
示例2: getReferencedFieldAsStringArray
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String[] getReferencedFieldAsStringArray(String fieldName,
String subFieldName) {
List<String> result = new ArrayList<String>();
Variant res = Dispatch.call(this, "Field", fieldName);
if (!res.isNull()) {
assert (res.getvt() == Variant.VariantDispatch);
Dispatch list = res.getDispatch();
Variant listSize = Dispatch.call(list, "Count");
assert (listSize.getvt() == Variant.VariantInt);
int numItems = listSize.getInt();
for (int i = 1; i <= numItems; i++) {
Variant itemObj = Dispatch.call(list, "Item", i);
assert (itemObj.getvt() == Variant.VariantDispatch);
Dispatch subfield = itemObj.getDispatch();
Variant subFieldVal = Dispatch.call(subfield, subFieldName);
assert (subFieldVal.getvt() == Variant.VariantString);
if (!subFieldVal.isNull()) {
result.add(subFieldVal.getString());
}
}
}
return result.toArray(new String[] {});
}
示例3: getVersionControlObject
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IVersionControl getVersionControlObject() {
Variant result = null;
try {
result = getProperty("VC");
} catch (Exception e) {
; // do nothing
}
if (result == null || result.getvt() != Variant.VariantDispatch) {
return null;
} else {
Dispatch dispatch = result.getDispatch();
return new VersionControl(dispatch);
}
}
示例4: addItem
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IBug addItem(String item) {
Variant var = new Variant();
var.putNull();
Variant res = Dispatch.call(this, "AddItem", var);
Bug bug = new Bug(res.getDispatch());
return bug;
}
示例5: getReferencedFieldAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
/**
* Support for values that are not directly contained in this Bug, but are
* instead determined via a separate, referenced object (i.e. a joined table
* at the DB level). Values for these fields must be indirectly obtained by
* first obtaining a separate COM object for the referenced field, and then
* calling a direct property-get on that object. Concrete example: Bug
* release and cycle info
*
* @param fieldName
* name of the referenced field (e.g. BG_DETECTED_IN_REL)
* @param subFieldName
* (sub) field in the referenced field whose value you want
* @return value from the referenced object as a String
*/
public String getReferencedFieldAsString(String fieldName,
String subFieldName) {
String val = null;
Variant res = Dispatch.call(this, "Field", fieldName);
if (!res.isNull()) {
Dispatch subfield = res.getDispatch();
Variant subfieldVal = Dispatch.call(subfield, subFieldName);
if (!subfieldVal.isNull()) {
// NOTE: assuming that getString works for datetimes/numbers too
val = subfieldVal.getString();
}
}
return val;
}
示例6: addItem
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IAttachment addItem() {
Variant var = new Variant();
var.putNull();
Variant res = Dispatch.call(this, "AddItem", var);
return new Attachment(res.getDispatch());
}
示例7: addItem
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IRequirement addItem(String item) {
Variant res = Dispatch.call(this, "AddItem", item);
return new Requirement(res.getDispatch());
}
示例8: getItem
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IRequirement getItem(String key) {
Variant res = Dispatch.call(this, "Item", key);
return new Requirement(res.getDispatch());
}
示例9: getItem
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IBug getItem(String key) {
Variant res = Dispatch.call(this, "Item", key);
Bug bug = new Bug(res.getDispatch());
return bug;
}
示例10: getItem
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IAttachment getItem(String key) {
Variant res = Dispatch.call(this, "Item", key);
return new Attachment(res.getDispatch());
}
示例11: execute
import com.jacob.com.Variant; //导入方法依赖的package包/类
public IRecordSet execute() {
Variant rsv = Dispatch.call(this, "Execute");
return new RecordSet(rsv.getDispatch());
}
示例12: getReferencedFieldAsInt
import com.jacob.com.Variant; //导入方法依赖的package包/类
/**
* Support for values that are not directly contained in this Bug, but are
* instead determined via a separate, referenced object (i.e. a joined table
* at the DB level). Values for these fields must be indirectly obtained by
* first obtaining a separate COM object for the referenced field, and then
* calling a direct property-get on that object. Concrete example: Bug
* release and cycle info
*
* @param fieldName
* name of the referenced field (e.g. BG_DETECTED_IN_REL)
* @param subFieldName
* (sub) field in the referenced field whose value you want
* @return value from the referenced object as an Integer
*/
public Integer getReferencedFieldAsInt(String fieldName, String subFieldName) {
Integer val = null;
Variant res = Dispatch.call(this, "Field", fieldName);
if (!res.isNull()) {
Dispatch subfield = res.getDispatch();
Variant subfieldVal = Dispatch.call(subfield, subFieldName);
if (!subfieldVal.isNull()) {
// NOTE: assuming that getString works for datetimes/numbers too
val = subfieldVal.getInt();
}
}
return val;
}