[OT] Alternative "Properties"
Subject : [OT] Alternative "Properties"
From: PA <email@hidden >
Date: Thu, 9 Dec 2004 18:29:37 +0100
Delivered-to: email@hidden
Delivered-to: email@hidden
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:return-path:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=qt8cfzTdlTW8K/zqFcG4HThA18ZGj5/3eywLMpi2Rtdys7jS7bLSUQXc2+g4wgYKJrPWeu9y9KoH/uPrUgqV3DsNAXgLHHs1565pwFmExIMXNq9Jc0ud83BQMIRVnQ4AV10JOYZ8R3kkTQcTfqy2iagffo2Gm460aeTY1en4MvI=
<argh>That's it. I had it with java.util.Properties...</argh>
Back to basic "plist":
WHAT
More or less equivalent to java.util.Properties.
Uses "plist" serialization format instead of Sun's one:
http://docs.sun.com/app/docs/doc/802-2112/6i63mn65o?a=view
http://www.gnustep.org/resources/documentation/Developer/Base/
Reference/NSPropertyList.html
http://developer.apple.com/documentation/Cocoa/Conceptual/
PropertyLists/Concepts/OldStylePListsConcept.html
Notable differences from traditional property list:
- UTF-8 encoding
- Only supports java.util.Collection and java.util.Map
- Everything else is converted to java.lang.String
- Mandatory quotation marks around java.lang.String
EXAMPLE
Object anObject = SZPropertiesReader.readObject( anInputStream );
SZPropertiesWriter.writeObject( anObject, anOutputStream );
// Alternatively
SZProperties someProperties = new SZProperties();
someProperties.load( anInputStream );
someProperties.store( anOutputStream );
If you feel adventurous, you can find a compiled jar as well as what
could be construed as "source code" at the following location:
http://zoe.nu/misc/SZProperties.tgz
Licensed under a zlib/libpng type license:
http://www.opensource.org/licenses/zlib-license.php
Bugs report very much appreciated :)
PA.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.