当前位置: 首页>>代码示例>>Java>>正文


Java VM.getManifestProperty方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:15,代码来源:Utils.java

示例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];
        }
    }
 
开发者ID:tomatsu,项目名称:squawk,代码行数:48,代码来源:RecordStoreManager.java


注:本文中的com.sun.squawk.VM.getManifestProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。