Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OT] Alternative "Properties"



<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.