首页> 外文期刊>Dr. Dobb's Journal >Creating .INI Classes in Java
【24h】

Creating .INI Classes in Java

机译:用Java创建.INI类

获取原文
获取原文并翻译 | 示例

摘要

I recently worked on a project that required reading standard Microsoft-style .ini files in Java. Although the JDK 1.4 does not specifically provide an .ini class, I thought that either the JDK 1.4 java.util.Properties or the Preferences API would do the job. I quickly discovered, however, that neither cleanly translates to the standard .ini file format. By "standard" .ini file format, I mean a format similar to Microsoft's .ini file format, where text entries are organized by sections, each section with corresponding key/value pairs separated by an equals sign (=), and comments that use semicolons (;) and pound signs (#); see Example 1. With this in mind, I created IniFile, a lightweight Java class that reads standard .ini text files into memory, lets you manipulate their contents, and store the various sections with their corresponding key/value pairs in memory.
机译:我最近从事的项目需要读取Java中的标准Microsoft样式.ini文件。尽管JDK 1.4并未专门提供.ini类,但我认为JDK 1.4 java.util.Properties或Preferences API都能胜任。但是我很快发现,这两种格式都不能完全转换为标准的.ini文件格式。 “标准” .ini文件格式是指类似于Microsoft .ini文件格式的格式,其中文本条目是按节组织的,每个节具有对应的键/值对,并由等号(=)分隔,并使用分号(;)和井号(#);请参见示例1。考虑到这一点,我创建了IniFile,这是一个轻量级的Java类,可将标准.ini文本文件读取到内存中,让您操作它们的内容,并将各个部分及其相应的键/值对存储在内存中。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号