本文整理汇总了Java中com.sun.squawk.VM.getManifestProperty方法的典型用法代码示例。如果您正苦于以下问题:Java VM.getManifestProperty方法的具体用法?Java VM.getManifestProperty怎么用?Java VM.getManifestProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.VM
的用法示例。
在下文中一共展示了VM.getManifestProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getManifestProperty
import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
* Get the value of a property from this suite's manifest (or the manifest of a parent suite).
* @param manifestPropertyName the name of the property
* @param valueIfNotInManifest the value to return if not found
* @return the value
*/
public static String getManifestProperty(String manifestPropertyName, String valueIfNotInManifest) {
String value = VM.getManifestProperty(manifestPropertyName);
if (value != null) {
return value;
} else {
return valueIfNotInManifest;
}
}
示例2: init
import com.sun.squawk.VM; //导入方法依赖的package包/类
private void init() throws RecordStoreException {
currentRecordStores = new IRecordStoreEntry[4];
if (scanVisitor == null) {
scanVisitor = new RecordStoreManagerScanVisitor(this);
}
if (reScanVisitor == null) {
reScanVisitor = new RecordStoreManagerReScanVisitor(this);
}
memoryHeap.scanBlocks(memoryHeapScanner);
// Done scanning sectors, now check post conditions
String installedMidletName = VM.getManifestProperty(ApplicationDescriptorEntry.PROPERTY_MIDLET_NAME);
String installedMidletVendor = VM.getManifestProperty(ApplicationDescriptorEntry.PROPERTY_MIDLET_VENDOR);
String installedMidletVersion = VM.getManifestProperty(ApplicationDescriptorEntry.PROPERTY_MIDLET_VERSION);
if (installedMidletName == null || installedMidletVendor == null || installedMidletVersion == null) {
throw new RecordStoreException("No MIDlet suite installed.");
}
String eraseRmsReason = checkMIDletVersion(installedMidletName, installedMidletVendor, installedMidletVersion);
if (eraseRmsReason != null) {
/*if[ENABLE_VERBOSE]*/
if (VM.isVerbose()) {
System.out.println(eraseRmsReason);
}
/*end[ENABLE_VERBOSE]*/
if (currentApplicationDescriptor != null) {
invalidateEntryAt(currentApplicationDescriptor.getAddress());
}
// TODO This is a down side to my optimization of scanning, where only valid entries are
// ever present, we need to delete all stores and their records in this case, can I come up
// with an optimization for this ?
// This is where timestamps might come in handy, think about it
// TODO Write a test for this case
for (int i=0; i < currentRecordStores.length; i++) {
IRecordStoreEntry store = currentRecordStores[i];
if (store == null) {
continue;
}
store.deleteRecords();
invalidateEntryAt(store.getAddress());
}
currentApplicationDescriptor = new ApplicationDescriptorEntry();
currentApplicationDescriptor.setMidletName(installedMidletName);
currentApplicationDescriptor.setMidletVendor(installedMidletVendor);
currentApplicationDescriptor.setMidletVersion(installedMidletVersion);
logEntry(currentApplicationDescriptor);
currentRecordStores = new IRecordStoreEntry[4];
}
}