Nice TWiki > Doc > JavaIntegration TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Doc . { Changes | Index | Search | Go }
This page is about the use of Nice on the Java platform and with Java tools. Nice is not yet mainstream, so not supported natively by most tools. Luckilly, Nice is also designed to integrate very well with the Java platform, so in most cases you can use Nice without changing your existing tools and libraries.

Serialization

Nice classes can be made serializable be implementing the java.io.Serializable interface. If needed, you can specifiy their version UID by declaring a field final long serialVersionUID = 123456789L;. You can also implement the methods readObject, writeObject, readResolve and writeReplace to customize the way the class is serialized. In short, serialization in Nice is compatible with Java (you can serialize Nice and Java classes together), and it is done in a very similar way. See the documentation of the Serializable class for more information about java serialization.

Getters and setters

Many tools and frameworks rely on your classes possessing getter and setter methods to access its fields. Examples include Java Beans, JXPath, ...

The Nice compiler automatically generates these getter and setter methods for public fields, so you do not need to write them, and your classes should work with these tools.

Other situations

If you run into a situation where you need to integrate your Nice source code with existing libraries or tools, and you are not sure how to make it work, please feel free to ask on the NiceInfo mailing list for advice. On the other hand, if you do find a good way to make things work, please document it here, so that other users can benefit from your experience!

-- DanielBonniot - 19 Feb 2004

Topic JavaIntegration . { Edit | Attach | Ref-By | Printable | Diffs | r1.4 | > | r1.3 | > | r1.2 | More }
Revision r1.4 - 28 Apr 2005 - 11:53 GMT - TWikiGuest
Parents: WebHome
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.