aspose file tools
The moose likes Java in General and the fly likes Serializable marker interface Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Serializable marker interface" Watch "Serializable marker interface" New topic
Author

Serializable marker interface

deepakagarwal agarwal
Greenhorn

Joined: Jan 14, 2008
Posts: 2
how can i create a interface that can be implemented just like serilaizable interface.
I don't wan either to implement Serializable interface or extend any class.
by my interface.
Marker interface doesnotconatins any method declaration.
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Your question is not very clear (is your space-bar broken?!), but I suspect it does not belong in Advanced forum.

Are you just asking how to create a marker interface? If so, that's just a question of creating an interface with no members.

Identifying whether an object supports a marker interface is a trivial application of "instanceof" operator.

It sounds as if you want to duplicate the serialisation mechanism - why? The serialisation mechanism has, I believe, a few "magic" hooks into the JVM, which you'd struggle to replicate in your own code. Most of it is just pure Java, though, and you can look at it in the JDK source.

If you want to do something like serialisation, but with more control, you could read up on Externalizable interface. This is part of the serialisation mechanism, but more of the implementation is up to you.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Serializable marker interface
 
Similar Threads
Null Interface
Core java related
What exactly is a Marker Interface?
Marker Inerface
Hi this is vinay i have small doubt