本文整理汇总了Java中com.jacob.com.Variant.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Variant.getString方法的具体用法?Java Variant.getString怎么用?Java Variant.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jacob.com.Variant
的用法示例。
在下文中一共展示了Variant.getString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getFieldAsString(String field) {
Variant res = Dispatch.call(this, "Field", field);
if (res.isNull()) {
return null;
} else if (res.getvt() == Variant.VariantInt) {
int val = res.getInt();
return Integer.toString(val);
} else if (res.getvt() == Variant.VariantDate) {
logger.warn("Field " + field
+ " should have contained a string but contained a date: "
+ res.getDate());
return null;
} else {
return res.getString();
}
}
示例2: getResultCodeDescription
import com.jacob.com.Variant; //导入方法依赖的package包/类
/**
* Описание Результата
* @return Описание Результата
*/
@Override
public synchronized String getResultCodeDescription(){
Variant v = drv.getProperty("ResultCodeDescription");
String str = v.getString();
logFiner("getResultCodeDescription {0}", str);
return str;
}
示例3: getColNameAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getColNameAsString(int index) {
Variant res = Dispatch.call(this, "ColName", index);
if (res.getvt() != 8 && res.getvt() != 0)
System.err.println("Col Name is not a String type index:" + index
+ " " + res.getvt());
return res.getString();
}
示例4: getFieldValueAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getFieldValueAsString(String field) {
Variant res = getFieldValueAsVariant(field);
if (res != null) {
if (res.getvt() != Variant.VariantString)
System.err.println("Field is not a String type " + field + " "
+ res.getvt());
if (res.isNull()) {
return null;
}
return res.getString();
}
return null;
}
示例5: getFieldAsString
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getFieldAsString(String field) {
Variant res = Dispatch.call(this, "Field", field);
if (res.isNull()) {
return null;
} else if (res.getvt() == Variant.VariantInt) {
int val = res.getInt();
return Integer.toString(val);
} else {
return res.getString();
}
}
示例6: 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;
}
示例7: getVersion
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getVersion() {
Variant vResult = dAmiBroker.getProperty("Version");
return vResult.getString();
}
示例8: getDatabasePath
import com.jacob.com.Variant; //导入方法依赖的package包/类
public String getDatabasePath() {
Variant vResult = dAmiBroker.getProperty("DatabasePath");
return vResult.getString();
}