Loading ...
Sorry, an error occurred while loading the content.

File - faq.txt

Expand Messages
  • JSX-ideas@yahoogroups.com
    JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
    Message 1 of 30 , Feb 1 2:11 AM
    • 0 Attachment
      JSX FAQ - 14 November 2001
      =======

      JSX instantly XML-enables applications, by re-implementing the Serialization
      API for XML.

      FAQ Contents:
      (1). Background
      (2). Using the Serialization API
      (3). Using JSX

      If your question is not answered here, please try the homepage:
      http://www.csse.monash.edu.au/~bren/JSX/
      or mailing list:
      http://groups.yahoo.com/group/JSX-ideas/messages

      ------------------------------------------------------------------------------


      (1). Background
      ===============

      (1.1) JSX stands for...?
      Java Serialization to XML

      (1.2) What does JOS stand for?
      Java Object Serialization (sometimes referred to as "Java's own Serialization")

      (1.3) What are the uses of JSX?
      - Long-term persistence - XML can be modified directly.
      - A transparent protocol for communicating between different components,
      that is easy to debug, and able to cope with different objects.
      - Configuration files.
      - A debugging tool - dumping object state.

      (1.4) What are the benefits of JSX?
      - A human-readable form of normally invisible objects
      - A human-edtiable form, for entering and editing objects
      - A human-comprehendible wire/file protocol for object and data exchange
      between other applications and languages

      (1.5) What are the goals of JSX?
      To be able to instantly XML-enable applications, without needing to change
      them at all.
      - to produce a "human comprehendible" XML representation of object graphs,
      that is readable and robust under human edits.
      - in the long-term, to help users handle the inevitable evolution of objects

      - a direct JOS replacement.
      - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
      and so JSX can only add functionality through its constructors, using the
      Config object.





      (2). Using the Serialization API
      ================================

      (2.1). Where's a good tutorial?
      "Advanced Object Serialization", by John Zukowski (August 2001)
      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

      (2.2). How do I write my own readObject() and writeObject() methods?
      Here's the signatures:
      private void readObject(ObjectInputStream ois)
      throws ClassNotFoundException, IOException {
      //your code here
      }
      private writeObject(ObjectOutputStream oos)
      throws IOException {
      //your code here
      }


      (2.3). How do I use GetField?
      It can only be used within a readObject() method that you have coded for your
      class, and is called by the serialization system.

      See example in:
      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
      It's almost halfway through, under the heading: "Using ObjectStreamField"



      (3). Using JSX
      ==============

      (3.1). How do I use Config?

      Config is used to configure JSX for both input and output. You create the
      Config object, set it, and then pass it into the constructor of either an
      ObjIn or ObjOut. For example:

      Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
      ObjectInputStream in = new ObjIn(cfg); //pass it in

      Note that the option setting can be chained. Check the source code
      (Config.java) for more options.

      For the above example, "handler" is used like an event handler. A common
      approach is to subclass the default implementation with your own anonymous
      class:

      NoSuchFieldHandler handler = new NoSuchFieldHandler() {
      public String noSuchField(Class c, String fieldName) {
      if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
      return "theNewFieldName";
      else
      throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
      }
      };
      //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
      //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
      //old fieldnames to new fieldnames.
    • Marti DeMore
      Below is a modified version of Evolve.java. I run this command line to write the object to file outfile: java javax.jifi.builder.Evolve out outfile And then
      Message 2 of 30 , Feb 14 5:07 PM
      • 0 Attachment
        Below is a modified version of Evolve.java.

        I run this command line to write the object to file outfile:

        java javax.jifi.builder.Evolve out outfile

        And then this command line to read the object back:

        java javax.jifi.builder.Evolve in outfile

        I get this exception when reading the object:

        Exception in thread "main" java.lang.NullPointerException
        at JSX.XMLDeserialize.addPrim(XMLDeserialize.java:3099)
        at JSX.XMLDeserialize.createObject(XMLDeserialize.java:1231)
        at JSX.XMLDeserialize.createObject(XMLDeserialize.java:794)
        at JSX.XMLDeserialize.deserialize(XMLDeserialize.java:361)
        at JSX.ObjIn.readObjectOverride(ObjIn.java:141)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at javax.jifi.builder.Evolve.main(Evolve.java:85)

        If I change the "y" member of Evolve to wrapper type Integer rather than
        primitive int, it works. Am I doing something wrong?

        ------------------------------------------------------------------------------------------------------------------------------------
        import JSX.*;

        public class Evolve implements Serializable {

        public static void main(String args[]) throws Exception {

        if (args.length == 0) {
        System.out.println("Evolve out [out-file] or Evolve in [in-file]");
        System.exit(0);
        }
        if (args[0].equals("out")) {
        ObjectOutputStream out;
        out = new JSX.ObjOut(new FileOutputStream(args[1]));
        Object o = new Evolve();
        out.writeObject(o);
        out.flush();
        System.out.println("\n********************************\n" + o);
        } else {
        JSX.ObjIn in = new JSX.ObjIn(new FileInputStream(args[1]));
        Evolve o = (Evolve)in.readObject();
        in.close();
        System.out.println("\n********************************\n" + o);
        }

        }

        static class JOS { //Java's Own Serialization
        public static void main(String args[]) throws Exception {
        ObjectInputStream in = new ObjectInputStream(System.in);
        Object obj = in.readObject();
        ObjectOutputStream out = new ObjectOutputStream(System.out);
        out.writeObject(obj); //so we can see it
        }
        }

        static final long serialVersionUID = 30593813711490L;

        // Serial field names. Add a new one here each time you add a
        // non-transient, non-static member. Never remove them.

        static final String a = "a";
        static final String b = "b";
        static final String c = "c";

        // Members

        String x = "hello";
        int y = 5;
        Link z = new Link();

        // Definitions of serial stream fields. Add a new one here each time
        // you add a non-transient, non-static member. never remove them.

        private static final ObjectStreamField[] serialPersistentFields = {
        new ObjectStreamField(a, String.class),
        new ObjectStreamField(b, Integer.TYPE),
        new ObjectStreamField(c, Link.class),
        };

        public Evolve() {
        z.name = "Link one";
        z.next = new Link();
        z.next.name = "Link two";
        }

        private void writeObject(ObjectOutputStream s) throws IOException {

        // Use writeFields() rather then defaultWriteObject()
        // Put individual members into the serial stream fields

        ObjectOutputStream.PutField fields = s.putFields();
        fields.put(a, x);
        fields.put(b, y);
        fields.put(c, z);
        s.writeFields();
        }
        private void readObject(ObjectInputStream s) throws IOException {

        // Use readFields() rather than defaultReadObject()
        // Assign individual members back from the serial stream fields
        // that are read

        ObjectInputStream.GetField fields = null;
        try {
        fields = s.readFields();
        } catch (Exception ClassNotFoundException) {
        throw new IOException("ClassNotFoundException wrapped");
        }

        // Default value is supplied as the second argument if
        // the field is not found in the serial stream

        x = (String) fields.get(a, "we got nothing!");
        y = fields.get(b, -100);
        z = (Link) fields.get(c, new Link());
        }

        public String toString() {
        return "x = " + x + "\n" +
        "y = " + y + "\n" +
        "z = " + z + "\n";
        }

        }


        class Link implements Serializable {

        // Members

        Link next;
        String name;

        static final long serialVersionUID = 3059381371L;

        // Serial field names

        static final String a = "NEXT";
        static final String b = "next"; //we (hope) we cope with synonyms...
        static final String c = "name";

        // Serial field definitions

        private static final ObjectStreamField[] serialPersistentFields = {
        new ObjectStreamField(a, Link.class),
        new ObjectStreamField(c, String.class),
        };


        private void writeObject(ObjectOutputStream s) throws IOException {

        // Use writeFields() rather than defaultWriteObejct()

        ObjectOutputStream.PutField fields = s.putFields();
        fields.put(a, next);
        fields.put(c, name);
        s.writeFields(); //alt: fields.write(s);
        }

        private void readObject(ObjectInputStream s) throws IOException {

        // Use readFields() rather than defaultReadObject

        ObjectInputStream.GetField fields = null;
        try {
        fields = s.readFields();
        } catch (Exception ClassNotFoundException) {
        throw new IOException("ClassNotFoundException wrapped");
        }
        if (!fields.defaulted(a))
        next = (Link) fields.get(a, null); //default to null
        else if (!fields.defaulted(b))
        next = (Link) fields.get(b, null); //default to null
        name = (String)fields.get(c, "No name - old object stream");
        }

        public String toString() {
        return "{name = " + name + " next = " + next + "}";
        }
        }
      • egroups_yow
        Hi Marti, Thanks for your well-detailed bug report - it made it easy to track down the bug, and fix it. The fix is now available, as JSX0.9.8.3.jar. Your
        Message 3 of 30 , Feb 16 11:18 PM
        • 0 Attachment
          Hi Marti,

          Thanks for your well-detailed bug report - it made it easy to track
          down the bug, and fix it. The fix is now available, as
          JSX0.9.8.3.jar.

          Your inference that it was to do with primitive fields was correct.
          > If I change the "y" member of Evolve to wrapper type Integer
          > rather than primitive int, it works. Am I doing something wrong?

          However: it may be easier to use XSLT to map to different names
          between the Java objects and XML (this requires two XSLT scripts,
          for writing and reading).

          If it is not mapping that you need this
          for, but coping with evolution of classes, you only to write one
          XSLT script, to map from the old version of the XML to the new
          version. This has the advantage of updating the XML in
          accordance with the fieldnames used in the Java code (which is less
          confusing).

          But I'm guessing on what you need it for here! What do you need it
          for? ;-)


          Cheers,
          Brendan
        • Marti DeMore
          Thanks, Brendan. I ll try it. The XSLT suggestion is a possibility for us, to convert old project files to new ones at some point, but will not serve all our
          Message 4 of 30 , Feb 20 10:33 AM
          • 0 Attachment
            Thanks, Brendan. I'll try it.

            The XSLT suggestion is a possibility for us, to convert old project files
            to new ones at some point, but will not serve all our purposes. Also we
            have more faith in developers to update the read/write object method in
            Java while they are editing the object than in their ability to go and
            update the external scripts in XSLT, which they do not know. Either way, BW
            compatibility is hard to maintain, as you probably know.

            -Marti


            At 2/16/2002 11:18 PM, you wrote:
            >Hi Marti,
            >
            >Thanks for your well-detailed bug report - it made it easy to track
            >down the bug, and fix it. The fix is now available, as
            >JSX0.9.8.3.jar.
            >
            >Your inference that it was to do with primitive fields was correct.
            > > If I change the "y" member of Evolve to wrapper type Integer
            > > rather than primitive int, it works. Am I doing something wrong?
            >
            >However: it may be easier to use XSLT to map to different names
            >between the Java objects and XML (this requires two XSLT scripts,
            >for writing and reading).
            >
            >If it is not mapping that you need this
            >for, but coping with evolution of classes, you only to write one
            >XSLT script, to map from the old version of the XML to the new
            >version. This has the advantage of updating the XML in
            >accordance with the fieldnames used in the Java code (which is less
            >confusing).
            >
            >But I'm guessing on what you need it for here! What do you need it
            >for? ;-)
            >
            >
            >Cheers,
            >Brendan
            >
            >
            >To unsubscribe from this group, send an email to:
            >JSX-ideas-unsubscribe@egroups.com
            >
            >
            >
            >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          • egroups_yow
            Hi Marti, ... Yes, localizing the evolutions to where they happen seems like a good idea. It is limited to changes of fieldnames, but this is the most common
            Message 5 of 30 , Feb 20 8:38 PM
            • 0 Attachment
              Hi Marti,

              > Also we have more faith in developers to update the read/write
              > object method in Java while they are editing the object than in
              > their ability to go and update the external scripts in XSLT,
              > which they do not know.
              Yes, localizing the evolutions to where they happen seems like a
              good idea. It is limited to changes of fieldnames, but this is
              the most common evolution (after add/del fields, which serialization
              handles anyway).

              > Either way, BW compatibility is hard to maintain, as you probably
              > know.
              Yes, very tricky. ;-)

              Please keep me posted on any other problems you come across with
              JSX. ;-)


              Cheers,
              Brendan
            • JSX-ideas@yahoogroups.com
              JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
              Message 6 of 30 , Mar 1, 2002
              • 0 Attachment
                JSX FAQ - 14 November 2001
                =======

                JSX instantly XML-enables applications, by re-implementing the Serialization
                API for XML.

                FAQ Contents:
                (1). Background
                (2). Using the Serialization API
                (3). Using JSX

                If your question is not answered here, please try the homepage:
                http://www.csse.monash.edu.au/~bren/JSX/
                or mailing list:
                http://groups.yahoo.com/group/JSX-ideas/messages

                ------------------------------------------------------------------------------


                (1). Background
                ===============

                (1.1) JSX stands for...?
                Java Serialization to XML

                (1.2) What does JOS stand for?
                Java Object Serialization (sometimes referred to as "Java's own Serialization")

                (1.3) What are the uses of JSX?
                - Long-term persistence - XML can be modified directly.
                - A transparent protocol for communicating between different components,
                that is easy to debug, and able to cope with different objects.
                - Configuration files.
                - A debugging tool - dumping object state.

                (1.4) What are the benefits of JSX?
                - A human-readable form of normally invisible objects
                - A human-edtiable form, for entering and editing objects
                - A human-comprehendible wire/file protocol for object and data exchange
                between other applications and languages

                (1.5) What are the goals of JSX?
                To be able to instantly XML-enable applications, without needing to change
                them at all.
                - to produce a "human comprehendible" XML representation of object graphs,
                that is readable and robust under human edits.
                - in the long-term, to help users handle the inevitable evolution of objects

                - a direct JOS replacement.
                - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                and so JSX can only add functionality through its constructors, using the
                Config object.





                (2). Using the Serialization API
                ================================

                (2.1). Where's a good tutorial?
                "Advanced Object Serialization", by John Zukowski (August 2001)
                http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                (2.2). How do I write my own readObject() and writeObject() methods?
                Here's the signatures:
                private void readObject(ObjectInputStream ois)
                throws ClassNotFoundException, IOException {
                //your code here
                }
                private writeObject(ObjectOutputStream oos)
                throws IOException {
                //your code here
                }


                (2.3). How do I use GetField?
                It can only be used within a readObject() method that you have coded for your
                class, and is called by the serialization system.

                See example in:
                http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                It's almost halfway through, under the heading: "Using ObjectStreamField"



                (3). Using JSX
                ==============

                (3.1). How do I use Config?

                Config is used to configure JSX for both input and output. You create the
                Config object, set it, and then pass it into the constructor of either an
                ObjIn or ObjOut. For example:

                Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                ObjectInputStream in = new ObjIn(cfg); //pass it in

                Note that the option setting can be chained. Check the source code
                (Config.java) for more options.

                For the above example, "handler" is used like an event handler. A common
                approach is to subclass the default implementation with your own anonymous
                class:

                NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                public String noSuchField(Class c, String fieldName) {
                if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                return "theNewFieldName";
                else
                throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                }
                };
                //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                //old fieldnames to new fieldnames.
              • JSX-ideas@yahoogroups.com
                JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                Message 7 of 30 , Apr 2, 2002
                • 0 Attachment
                  JSX FAQ - 14 November 2001
                  =======

                  JSX instantly XML-enables applications, by re-implementing the Serialization
                  API for XML.

                  FAQ Contents:
                  (1). Background
                  (2). Using the Serialization API
                  (3). Using JSX

                  If your question is not answered here, please try the homepage:
                  http://www.csse.monash.edu.au/~bren/JSX/
                  or mailing list:
                  http://groups.yahoo.com/group/JSX-ideas/messages

                  ------------------------------------------------------------------------------


                  (1). Background
                  ===============

                  (1.1) JSX stands for...?
                  Java Serialization to XML

                  (1.2) What does JOS stand for?
                  Java Object Serialization (sometimes referred to as "Java's own Serialization")

                  (1.3) What are the uses of JSX?
                  - Long-term persistence - XML can be modified directly.
                  - A transparent protocol for communicating between different components,
                  that is easy to debug, and able to cope with different objects.
                  - Configuration files.
                  - A debugging tool - dumping object state.

                  (1.4) What are the benefits of JSX?
                  - A human-readable form of normally invisible objects
                  - A human-edtiable form, for entering and editing objects
                  - A human-comprehendible wire/file protocol for object and data exchange
                  between other applications and languages

                  (1.5) What are the goals of JSX?
                  To be able to instantly XML-enable applications, without needing to change
                  them at all.
                  - to produce a "human comprehendible" XML representation of object graphs,
                  that is readable and robust under human edits.
                  - in the long-term, to help users handle the inevitable evolution of objects

                  - a direct JOS replacement.
                  - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                  and so JSX can only add functionality through its constructors, using the
                  Config object.





                  (2). Using the Serialization API
                  ================================

                  (2.1). Where's a good tutorial?
                  "Advanced Object Serialization", by John Zukowski (August 2001)
                  http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                  (2.2). How do I write my own readObject() and writeObject() methods?
                  Here's the signatures:
                  private void readObject(ObjectInputStream ois)
                  throws ClassNotFoundException, IOException {
                  //your code here
                  }
                  private writeObject(ObjectOutputStream oos)
                  throws IOException {
                  //your code here
                  }


                  (2.3). How do I use GetField?
                  It can only be used within a readObject() method that you have coded for your
                  class, and is called by the serialization system.

                  See example in:
                  http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                  It's almost halfway through, under the heading: "Using ObjectStreamField"



                  (3). Using JSX
                  ==============

                  (3.1). How do I use Config?

                  Config is used to configure JSX for both input and output. You create the
                  Config object, set it, and then pass it into the constructor of either an
                  ObjIn or ObjOut. For example:

                  Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                  ObjectInputStream in = new ObjIn(cfg); //pass it in

                  Note that the option setting can be chained. Check the source code
                  (Config.java) for more options.

                  For the above example, "handler" is used like an event handler. A common
                  approach is to subclass the default implementation with your own anonymous
                  class:

                  NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                  public String noSuchField(Class c, String fieldName) {
                  if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                  return "theNewFieldName";
                  else
                  throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                  }
                  };
                  //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                  //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                  //old fieldnames to new fieldnames.
                • JSX-ideas@yahoogroups.com
                  JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                  Message 8 of 30 , May 1, 2002
                  • 0 Attachment
                    JSX FAQ - 14 November 2001
                    =======

                    JSX instantly XML-enables applications, by re-implementing the Serialization
                    API for XML.

                    FAQ Contents:
                    (1). Background
                    (2). Using the Serialization API
                    (3). Using JSX

                    If your question is not answered here, please try the homepage:
                    http://www.csse.monash.edu.au/~bren/JSX/
                    or mailing list:
                    http://groups.yahoo.com/group/JSX-ideas/messages

                    ------------------------------------------------------------------------------


                    (1). Background
                    ===============

                    (1.1) JSX stands for...?
                    Java Serialization to XML

                    (1.2) What does JOS stand for?
                    Java Object Serialization (sometimes referred to as "Java's own Serialization")

                    (1.3) What are the uses of JSX?
                    - Long-term persistence - XML can be modified directly.
                    - A transparent protocol for communicating between different components,
                    that is easy to debug, and able to cope with different objects.
                    - Configuration files.
                    - A debugging tool - dumping object state.

                    (1.4) What are the benefits of JSX?
                    - A human-readable form of normally invisible objects
                    - A human-edtiable form, for entering and editing objects
                    - A human-comprehendible wire/file protocol for object and data exchange
                    between other applications and languages

                    (1.5) What are the goals of JSX?
                    To be able to instantly XML-enable applications, without needing to change
                    them at all.
                    - to produce a "human comprehendible" XML representation of object graphs,
                    that is readable and robust under human edits.
                    - in the long-term, to help users handle the inevitable evolution of objects

                    - a direct JOS replacement.
                    - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                    and so JSX can only add functionality through its constructors, using the
                    Config object.





                    (2). Using the Serialization API
                    ================================

                    (2.1). Where's a good tutorial?
                    "Advanced Object Serialization", by John Zukowski (August 2001)
                    http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                    (2.2). How do I write my own readObject() and writeObject() methods?
                    Here's the signatures:
                    private void readObject(ObjectInputStream ois)
                    throws ClassNotFoundException, IOException {
                    //your code here
                    }
                    private writeObject(ObjectOutputStream oos)
                    throws IOException {
                    //your code here
                    }


                    (2.3). How do I use GetField?
                    It can only be used within a readObject() method that you have coded for your
                    class, and is called by the serialization system.

                    See example in:
                    http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                    It's almost halfway through, under the heading: "Using ObjectStreamField"



                    (3). Using JSX
                    ==============

                    (3.1). How do I use Config?

                    Config is used to configure JSX for both input and output. You create the
                    Config object, set it, and then pass it into the constructor of either an
                    ObjIn or ObjOut. For example:

                    Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                    ObjectInputStream in = new ObjIn(cfg); //pass it in

                    Note that the option setting can be chained. Check the source code
                    (Config.java) for more options.

                    For the above example, "handler" is used like an event handler. A common
                    approach is to subclass the default implementation with your own anonymous
                    class:

                    NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                    public String noSuchField(Class c, String fieldName) {
                    if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                    return "theNewFieldName";
                    else
                    throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                    }
                    };
                    //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                    //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                    //old fieldnames to new fieldnames.
                  • JSX-ideas@yahoogroups.com
                    JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                    Message 9 of 30 , Jun 4, 2002
                    • 0 Attachment
                      JSX FAQ - 14 November 2001
                      =======

                      JSX instantly XML-enables applications, by re-implementing the Serialization
                      API for XML.

                      FAQ Contents:
                      (1). Background
                      (2). Using the Serialization API
                      (3). Using JSX

                      If your question is not answered here, please try the homepage:
                      http://www.csse.monash.edu.au/~bren/JSX/
                      or mailing list:
                      http://groups.yahoo.com/group/JSX-ideas/messages

                      ------------------------------------------------------------------------------


                      (1). Background
                      ===============

                      (1.1) JSX stands for...?
                      Java Serialization to XML

                      (1.2) What does JOS stand for?
                      Java Object Serialization (sometimes referred to as "Java's own Serialization")

                      (1.3) What are the uses of JSX?
                      - Long-term persistence - XML can be modified directly.
                      - A transparent protocol for communicating between different components,
                      that is easy to debug, and able to cope with different objects.
                      - Configuration files.
                      - A debugging tool - dumping object state.

                      (1.4) What are the benefits of JSX?
                      - A human-readable form of normally invisible objects
                      - A human-edtiable form, for entering and editing objects
                      - A human-comprehendible wire/file protocol for object and data exchange
                      between other applications and languages

                      (1.5) What are the goals of JSX?
                      To be able to instantly XML-enable applications, without needing to change
                      them at all.
                      - to produce a "human comprehendible" XML representation of object graphs,
                      that is readable and robust under human edits.
                      - in the long-term, to help users handle the inevitable evolution of objects

                      - a direct JOS replacement.
                      - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                      and so JSX can only add functionality through its constructors, using the
                      Config object.





                      (2). Using the Serialization API
                      ================================

                      (2.1). Where's a good tutorial?
                      "Advanced Object Serialization", by John Zukowski (August 2001)
                      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                      (2.2). How do I write my own readObject() and writeObject() methods?
                      Here's the signatures:
                      private void readObject(ObjectInputStream ois)
                      throws ClassNotFoundException, IOException {
                      //your code here
                      }
                      private writeObject(ObjectOutputStream oos)
                      throws IOException {
                      //your code here
                      }


                      (2.3). How do I use GetField?
                      It can only be used within a readObject() method that you have coded for your
                      class, and is called by the serialization system.

                      See example in:
                      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                      It's almost halfway through, under the heading: "Using ObjectStreamField"



                      (3). Using JSX
                      ==============

                      (3.1). How do I use Config?

                      Config is used to configure JSX for both input and output. You create the
                      Config object, set it, and then pass it into the constructor of either an
                      ObjIn or ObjOut. For example:

                      Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                      ObjectInputStream in = new ObjIn(cfg); //pass it in

                      Note that the option setting can be chained. Check the source code
                      (Config.java) for more options.

                      For the above example, "handler" is used like an event handler. A common
                      approach is to subclass the default implementation with your own anonymous
                      class:

                      NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                      public String noSuchField(Class c, String fieldName) {
                      if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                      return "theNewFieldName";
                      else
                      throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                      }
                      };
                      //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                      //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                      //old fieldnames to new fieldnames.
                    • egroups_yow
                      Hi Marti, I m developing an interesting idea for back-compatibility, which ... The idea is to serialize a Memento object that represents the Originating
                      Message 10 of 30 , Jun 16, 2002
                      • 0 Attachment
                        Hi Marti,

                        I'm developing an interesting idea for back-compatibility, which
                        seems to be very powerful, and may suit your needs:

                        > we have more faith in developers to update the read/write
                        > object method in Java while they are editing the object
                        > than in their ability to go and update the external scripts
                        > in XSLT, which they do not know. Either way, BW compatibility
                        > is hard to maintain, as you probably know.

                        The idea is to serialize a "Memento" object that represents the
                        Originating object. This gives you a level of indirection, so that
                        the mapping code between the two representations can change to cope
                        with updates. It gives many of the benefits of
                        serialPersistentFields, but is higher-level and simpler.

                        I intend to write an article for JavaWorld, and would love to be able
                        to use as an example some of your code (or if JPL objects, if you
                        could come up with a similiar "real life" example - you'd be
                        credited, of course).


                        Cheers,
                        Brendan
                        PS: If anyone else is interested, or has comments or ideas on this,
                        please reply. I'll be posting a draft of the article very soon.


                        > >Thanks for your well-detailed bug report - it made it easy to track
                        > >down the bug, and fix it. The fix is now available, as
                        > >JSX0.9.8.3.jar.
                        > >
                        > >Your inference that it was to do with primitive fields was correct.
                        > > > If I change the "y" member of Evolve to wrapper type Integer
                        > > > rather than primitive int, it works. Am I doing something wrong?
                        > >
                        > >However: it may be easier to use XSLT to map to different names
                        > >between the Java objects and XML (this requires two XSLT scripts,
                        > >for writing and reading).
                        > >
                        > >If it is not mapping that you need this
                        > >for, but coping with evolution of classes, you only to write one
                        > >XSLT script, to map from the old version of the XML to the new
                        > >version. This has the advantage of updating the XML in
                        > >accordance with the fieldnames used in the Java code (which is less
                        > >confusing).
                        > >
                        > >But I'm guessing on what you need it for here! What do you need it
                        > >for? ;-)
                        > >
                        > >
                        > >Cheers,
                        > >Brendan
                        > >
                        > >
                        > >To unsubscribe from this group, send an email to:
                        > >JSX-ideas-unsubscribe@e...
                        > >
                        > >
                        > >
                        > >Your use of Yahoo! Groups is subject to
                        http://docs.yahoo.com/info/terms/
                      • JSX-ideas@yahoogroups.com
                        JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                        Message 11 of 30 , Jul 3, 2002
                        • 0 Attachment
                          JSX FAQ - 14 November 2001
                          =======

                          JSX instantly XML-enables applications, by re-implementing the Serialization
                          API for XML.

                          FAQ Contents:
                          (1). Background
                          (2). Using the Serialization API
                          (3). Using JSX

                          If your question is not answered here, please try the homepage:
                          http://www.csse.monash.edu.au/~bren/JSX/
                          or mailing list:
                          http://groups.yahoo.com/group/JSX-ideas/messages

                          ------------------------------------------------------------------------------


                          (1). Background
                          ===============

                          (1.1) JSX stands for...?
                          Java Serialization to XML

                          (1.2) What does JOS stand for?
                          Java Object Serialization (sometimes referred to as "Java's own Serialization")

                          (1.3) What are the uses of JSX?
                          - Long-term persistence - XML can be modified directly.
                          - A transparent protocol for communicating between different components,
                          that is easy to debug, and able to cope with different objects.
                          - Configuration files.
                          - A debugging tool - dumping object state.

                          (1.4) What are the benefits of JSX?
                          - A human-readable form of normally invisible objects
                          - A human-edtiable form, for entering and editing objects
                          - A human-comprehendible wire/file protocol for object and data exchange
                          between other applications and languages

                          (1.5) What are the goals of JSX?
                          To be able to instantly XML-enable applications, without needing to change
                          them at all.
                          - to produce a "human comprehendible" XML representation of object graphs,
                          that is readable and robust under human edits.
                          - in the long-term, to help users handle the inevitable evolution of objects

                          - a direct JOS replacement.
                          - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                          and so JSX can only add functionality through its constructors, using the
                          Config object.





                          (2). Using the Serialization API
                          ================================

                          (2.1). Where's a good tutorial?
                          "Advanced Object Serialization", by John Zukowski (August 2001)
                          http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                          (2.2). How do I write my own readObject() and writeObject() methods?
                          Here's the signatures:
                          private void readObject(ObjectInputStream ois)
                          throws ClassNotFoundException, IOException {
                          //your code here
                          }
                          private writeObject(ObjectOutputStream oos)
                          throws IOException {
                          //your code here
                          }


                          (2.3). How do I use GetField?
                          It can only be used within a readObject() method that you have coded for your
                          class, and is called by the serialization system.

                          See example in:
                          http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                          It's almost halfway through, under the heading: "Using ObjectStreamField"



                          (3). Using JSX
                          ==============

                          (3.1). How do I use Config?

                          Config is used to configure JSX for both input and output. You create the
                          Config object, set it, and then pass it into the constructor of either an
                          ObjIn or ObjOut. For example:

                          Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                          ObjectInputStream in = new ObjIn(cfg); //pass it in

                          Note that the option setting can be chained. Check the source code
                          (Config.java) for more options.

                          For the above example, "handler" is used like an event handler. A common
                          approach is to subclass the default implementation with your own anonymous
                          class:

                          NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                          public String noSuchField(Class c, String fieldName) {
                          if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                          return "theNewFieldName";
                          else
                          throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                          }
                          };
                          //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                          //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                          //old fieldnames to new fieldnames.
                        • JSX-ideas@yahoogroups.com
                          JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                          Message 12 of 30 , Aug 4, 2002
                          • 0 Attachment
                            JSX FAQ - 14 November 2001
                            =======

                            JSX instantly XML-enables applications, by re-implementing the Serialization
                            API for XML.

                            FAQ Contents:
                            (1). Background
                            (2). Using the Serialization API
                            (3). Using JSX

                            If your question is not answered here, please try the homepage:
                            http://www.csse.monash.edu.au/~bren/JSX/
                            or mailing list:
                            http://groups.yahoo.com/group/JSX-ideas/messages

                            ------------------------------------------------------------------------------


                            (1). Background
                            ===============

                            (1.1) JSX stands for...?
                            Java Serialization to XML

                            (1.2) What does JOS stand for?
                            Java Object Serialization (sometimes referred to as "Java's own Serialization")

                            (1.3) What are the uses of JSX?
                            - Long-term persistence - XML can be modified directly.
                            - A transparent protocol for communicating between different components,
                            that is easy to debug, and able to cope with different objects.
                            - Configuration files.
                            - A debugging tool - dumping object state.

                            (1.4) What are the benefits of JSX?
                            - A human-readable form of normally invisible objects
                            - A human-edtiable form, for entering and editing objects
                            - A human-comprehendible wire/file protocol for object and data exchange
                            between other applications and languages

                            (1.5) What are the goals of JSX?
                            To be able to instantly XML-enable applications, without needing to change
                            them at all.
                            - to produce a "human comprehendible" XML representation of object graphs,
                            that is readable and robust under human edits.
                            - in the long-term, to help users handle the inevitable evolution of objects

                            - a direct JOS replacement.
                            - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                            and so JSX can only add functionality through its constructors, using the
                            Config object.





                            (2). Using the Serialization API
                            ================================

                            (2.1). Where's a good tutorial?
                            "Advanced Object Serialization", by John Zukowski (August 2001)
                            http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                            (2.2). How do I write my own readObject() and writeObject() methods?
                            Here's the signatures:
                            private void readObject(ObjectInputStream ois)
                            throws ClassNotFoundException, IOException {
                            //your code here
                            }
                            private writeObject(ObjectOutputStream oos)
                            throws IOException {
                            //your code here
                            }


                            (2.3). How do I use GetField?
                            It can only be used within a readObject() method that you have coded for your
                            class, and is called by the serialization system.

                            See example in:
                            http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                            It's almost halfway through, under the heading: "Using ObjectStreamField"



                            (3). Using JSX
                            ==============

                            (3.1). How do I use Config?

                            Config is used to configure JSX for both input and output. You create the
                            Config object, set it, and then pass it into the constructor of either an
                            ObjIn or ObjOut. For example:

                            Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                            ObjectInputStream in = new ObjIn(cfg); //pass it in

                            Note that the option setting can be chained. Check the source code
                            (Config.java) for more options.

                            For the above example, "handler" is used like an event handler. A common
                            approach is to subclass the default implementation with your own anonymous
                            class:

                            NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                            public String noSuchField(Class c, String fieldName) {
                            if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                            return "theNewFieldName";
                            else
                            throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                            }
                            };
                            //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                            //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                            //old fieldnames to new fieldnames.
                          • JSX-ideas@yahoogroups.com
                            JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                            Message 13 of 30 , Sep 4, 2002
                            • 0 Attachment
                              JSX FAQ - 14 November 2001
                              =======

                              JSX instantly XML-enables applications, by re-implementing the Serialization
                              API for XML.

                              FAQ Contents:
                              (1). Background
                              (2). Using the Serialization API
                              (3). Using JSX

                              If your question is not answered here, please try the homepage:
                              http://www.csse.monash.edu.au/~bren/JSX/
                              or mailing list:
                              http://groups.yahoo.com/group/JSX-ideas/messages

                              ------------------------------------------------------------------------------


                              (1). Background
                              ===============

                              (1.1) JSX stands for...?
                              Java Serialization to XML

                              (1.2) What does JOS stand for?
                              Java Object Serialization (sometimes referred to as "Java's own Serialization")

                              (1.3) What are the uses of JSX?
                              - Long-term persistence - XML can be modified directly.
                              - A transparent protocol for communicating between different components,
                              that is easy to debug, and able to cope with different objects.
                              - Configuration files.
                              - A debugging tool - dumping object state.

                              (1.4) What are the benefits of JSX?
                              - A human-readable form of normally invisible objects
                              - A human-edtiable form, for entering and editing objects
                              - A human-comprehendible wire/file protocol for object and data exchange
                              between other applications and languages

                              (1.5) What are the goals of JSX?
                              To be able to instantly XML-enable applications, without needing to change
                              them at all.
                              - to produce a "human comprehendible" XML representation of object graphs,
                              that is readable and robust under human edits.
                              - in the long-term, to help users handle the inevitable evolution of objects

                              - a direct JOS replacement.
                              - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                              and so JSX can only add functionality through its constructors, using the
                              Config object.





                              (2). Using the Serialization API
                              ================================

                              (2.1). Where's a good tutorial?
                              "Advanced Object Serialization", by John Zukowski (August 2001)
                              http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                              (2.2). How do I write my own readObject() and writeObject() methods?
                              Here's the signatures:
                              private void readObject(ObjectInputStream ois)
                              throws ClassNotFoundException, IOException {
                              //your code here
                              }
                              private writeObject(ObjectOutputStream oos)
                              throws IOException {
                              //your code here
                              }


                              (2.3). How do I use GetField?
                              It can only be used within a readObject() method that you have coded for your
                              class, and is called by the serialization system.

                              See example in:
                              http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                              It's almost halfway through, under the heading: "Using ObjectStreamField"



                              (3). Using JSX
                              ==============

                              (3.1). How do I use Config?

                              Config is used to configure JSX for both input and output. You create the
                              Config object, set it, and then pass it into the constructor of either an
                              ObjIn or ObjOut. For example:

                              Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                              ObjectInputStream in = new ObjIn(cfg); //pass it in

                              Note that the option setting can be chained. Check the source code
                              (Config.java) for more options.

                              For the above example, "handler" is used like an event handler. A common
                              approach is to subclass the default implementation with your own anonymous
                              class:

                              NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                              public String noSuchField(Class c, String fieldName) {
                              if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                              return "theNewFieldName";
                              else
                              throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                              }
                              };
                              //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                              //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                              //old fieldnames to new fieldnames.
                            • JSX-ideas@yahoogroups.com
                              JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                              Message 14 of 30 , Oct 1, 2002
                              • 0 Attachment
                                JSX FAQ - 14 November 2001
                                =======

                                JSX instantly XML-enables applications, by re-implementing the Serialization
                                API for XML.

                                FAQ Contents:
                                (1). Background
                                (2). Using the Serialization API
                                (3). Using JSX

                                If your question is not answered here, please try the homepage:
                                http://www.csse.monash.edu.au/~bren/JSX/
                                or mailing list:
                                http://groups.yahoo.com/group/JSX-ideas/messages

                                ------------------------------------------------------------------------------


                                (1). Background
                                ===============

                                (1.1) JSX stands for...?
                                Java Serialization to XML

                                (1.2) What does JOS stand for?
                                Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                (1.3) What are the uses of JSX?
                                - Long-term persistence - XML can be modified directly.
                                - A transparent protocol for communicating between different components,
                                that is easy to debug, and able to cope with different objects.
                                - Configuration files.
                                - A debugging tool - dumping object state.

                                (1.4) What are the benefits of JSX?
                                - A human-readable form of normally invisible objects
                                - A human-edtiable form, for entering and editing objects
                                - A human-comprehendible wire/file protocol for object and data exchange
                                between other applications and languages

                                (1.5) What are the goals of JSX?
                                To be able to instantly XML-enable applications, without needing to change
                                them at all.
                                - to produce a "human comprehendible" XML representation of object graphs,
                                that is readable and robust under human edits.
                                - in the long-term, to help users handle the inevitable evolution of objects

                                - a direct JOS replacement.
                                - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                and so JSX can only add functionality through its constructors, using the
                                Config object.





                                (2). Using the Serialization API
                                ================================

                                (2.1). Where's a good tutorial?
                                "Advanced Object Serialization", by John Zukowski (August 2001)
                                http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                (2.2). How do I write my own readObject() and writeObject() methods?
                                Here's the signatures:
                                private void readObject(ObjectInputStream ois)
                                throws ClassNotFoundException, IOException {
                                //your code here
                                }
                                private writeObject(ObjectOutputStream oos)
                                throws IOException {
                                //your code here
                                }


                                (2.3). How do I use GetField?
                                It can only be used within a readObject() method that you have coded for your
                                class, and is called by the serialization system.

                                See example in:
                                http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                It's almost halfway through, under the heading: "Using ObjectStreamField"



                                (3). Using JSX
                                ==============

                                (3.1). How do I use Config?

                                Config is used to configure JSX for both input and output. You create the
                                Config object, set it, and then pass it into the constructor of either an
                                ObjIn or ObjOut. For example:

                                Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                ObjectInputStream in = new ObjIn(cfg); //pass it in

                                Note that the option setting can be chained. Check the source code
                                (Config.java) for more options.

                                For the above example, "handler" is used like an event handler. A common
                                approach is to subclass the default implementation with your own anonymous
                                class:

                                NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                public String noSuchField(Class c, String fieldName) {
                                if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                return "theNewFieldName";
                                else
                                throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                }
                                };
                                //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                //old fieldnames to new fieldnames.
                              • JSX-ideas@yahoogroups.com
                                JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                Message 15 of 30 , Nov 1, 2002
                                • 0 Attachment
                                  JSX FAQ - 14 November 2001
                                  =======

                                  JSX instantly XML-enables applications, by re-implementing the Serialization
                                  API for XML.

                                  FAQ Contents:
                                  (1). Background
                                  (2). Using the Serialization API
                                  (3). Using JSX

                                  If your question is not answered here, please try the homepage:
                                  http://www.csse.monash.edu.au/~bren/JSX/
                                  or mailing list:
                                  http://groups.yahoo.com/group/JSX-ideas/messages

                                  ------------------------------------------------------------------------------


                                  (1). Background
                                  ===============

                                  (1.1) JSX stands for...?
                                  Java Serialization to XML

                                  (1.2) What does JOS stand for?
                                  Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                  (1.3) What are the uses of JSX?
                                  - Long-term persistence - XML can be modified directly.
                                  - A transparent protocol for communicating between different components,
                                  that is easy to debug, and able to cope with different objects.
                                  - Configuration files.
                                  - A debugging tool - dumping object state.

                                  (1.4) What are the benefits of JSX?
                                  - A human-readable form of normally invisible objects
                                  - A human-edtiable form, for entering and editing objects
                                  - A human-comprehendible wire/file protocol for object and data exchange
                                  between other applications and languages

                                  (1.5) What are the goals of JSX?
                                  To be able to instantly XML-enable applications, without needing to change
                                  them at all.
                                  - to produce a "human comprehendible" XML representation of object graphs,
                                  that is readable and robust under human edits.
                                  - in the long-term, to help users handle the inevitable evolution of objects

                                  - a direct JOS replacement.
                                  - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                  and so JSX can only add functionality through its constructors, using the
                                  Config object.





                                  (2). Using the Serialization API
                                  ================================

                                  (2.1). Where's a good tutorial?
                                  "Advanced Object Serialization", by John Zukowski (August 2001)
                                  http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                  (2.2). How do I write my own readObject() and writeObject() methods?
                                  Here's the signatures:
                                  private void readObject(ObjectInputStream ois)
                                  throws ClassNotFoundException, IOException {
                                  //your code here
                                  }
                                  private writeObject(ObjectOutputStream oos)
                                  throws IOException {
                                  //your code here
                                  }


                                  (2.3). How do I use GetField?
                                  It can only be used within a readObject() method that you have coded for your
                                  class, and is called by the serialization system.

                                  See example in:
                                  http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                  It's almost halfway through, under the heading: "Using ObjectStreamField"



                                  (3). Using JSX
                                  ==============

                                  (3.1). How do I use Config?

                                  Config is used to configure JSX for both input and output. You create the
                                  Config object, set it, and then pass it into the constructor of either an
                                  ObjIn or ObjOut. For example:

                                  Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                  ObjectInputStream in = new ObjIn(cfg); //pass it in

                                  Note that the option setting can be chained. Check the source code
                                  (Config.java) for more options.

                                  For the above example, "handler" is used like an event handler. A common
                                  approach is to subclass the default implementation with your own anonymous
                                  class:

                                  NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                  public String noSuchField(Class c, String fieldName) {
                                  if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                  return "theNewFieldName";
                                  else
                                  throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                  }
                                  };
                                  //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                  //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                  //old fieldnames to new fieldnames.
                                • JSX-ideas@yahoogroups.com
                                  JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                  Message 16 of 30 , Dec 1, 2002
                                  • 0 Attachment
                                    JSX FAQ - 14 November 2001
                                    =======

                                    JSX instantly XML-enables applications, by re-implementing the Serialization
                                    API for XML.

                                    FAQ Contents:
                                    (1). Background
                                    (2). Using the Serialization API
                                    (3). Using JSX

                                    If your question is not answered here, please try the homepage:
                                    http://www.csse.monash.edu.au/~bren/JSX/
                                    or mailing list:
                                    http://groups.yahoo.com/group/JSX-ideas/messages

                                    ------------------------------------------------------------------------------


                                    (1). Background
                                    ===============

                                    (1.1) JSX stands for...?
                                    Java Serialization to XML

                                    (1.2) What does JOS stand for?
                                    Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                    (1.3) What are the uses of JSX?
                                    - Long-term persistence - XML can be modified directly.
                                    - A transparent protocol for communicating between different components,
                                    that is easy to debug, and able to cope with different objects.
                                    - Configuration files.
                                    - A debugging tool - dumping object state.

                                    (1.4) What are the benefits of JSX?
                                    - A human-readable form of normally invisible objects
                                    - A human-edtiable form, for entering and editing objects
                                    - A human-comprehendible wire/file protocol for object and data exchange
                                    between other applications and languages

                                    (1.5) What are the goals of JSX?
                                    To be able to instantly XML-enable applications, without needing to change
                                    them at all.
                                    - to produce a "human comprehendible" XML representation of object graphs,
                                    that is readable and robust under human edits.
                                    - in the long-term, to help users handle the inevitable evolution of objects

                                    - a direct JOS replacement.
                                    - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                    and so JSX can only add functionality through its constructors, using the
                                    Config object.





                                    (2). Using the Serialization API
                                    ================================

                                    (2.1). Where's a good tutorial?
                                    "Advanced Object Serialization", by John Zukowski (August 2001)
                                    http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                    (2.2). How do I write my own readObject() and writeObject() methods?
                                    Here's the signatures:
                                    private void readObject(ObjectInputStream ois)
                                    throws ClassNotFoundException, IOException {
                                    //your code here
                                    }
                                    private writeObject(ObjectOutputStream oos)
                                    throws IOException {
                                    //your code here
                                    }


                                    (2.3). How do I use GetField?
                                    It can only be used within a readObject() method that you have coded for your
                                    class, and is called by the serialization system.

                                    See example in:
                                    http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                    It's almost halfway through, under the heading: "Using ObjectStreamField"



                                    (3). Using JSX
                                    ==============

                                    (3.1). How do I use Config?

                                    Config is used to configure JSX for both input and output. You create the
                                    Config object, set it, and then pass it into the constructor of either an
                                    ObjIn or ObjOut. For example:

                                    Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                    ObjectInputStream in = new ObjIn(cfg); //pass it in

                                    Note that the option setting can be chained. Check the source code
                                    (Config.java) for more options.

                                    For the above example, "handler" is used like an event handler. A common
                                    approach is to subclass the default implementation with your own anonymous
                                    class:

                                    NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                    public String noSuchField(Class c, String fieldName) {
                                    if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                    return "theNewFieldName";
                                    else
                                    throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                    }
                                    };
                                    //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                    //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                    //old fieldnames to new fieldnames.
                                  • JSX-ideas@yahoogroups.com
                                    JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                    Message 17 of 30 , Jan 1, 2003
                                    • 0 Attachment
                                      JSX FAQ - 14 November 2001
                                      =======

                                      JSX instantly XML-enables applications, by re-implementing the Serialization
                                      API for XML.

                                      FAQ Contents:
                                      (1). Background
                                      (2). Using the Serialization API
                                      (3). Using JSX

                                      If your question is not answered here, please try the homepage:
                                      http://www.csse.monash.edu.au/~bren/JSX/
                                      or mailing list:
                                      http://groups.yahoo.com/group/JSX-ideas/messages

                                      ------------------------------------------------------------------------------


                                      (1). Background
                                      ===============

                                      (1.1) JSX stands for...?
                                      Java Serialization to XML

                                      (1.2) What does JOS stand for?
                                      Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                      (1.3) What are the uses of JSX?
                                      - Long-term persistence - XML can be modified directly.
                                      - A transparent protocol for communicating between different components,
                                      that is easy to debug, and able to cope with different objects.
                                      - Configuration files.
                                      - A debugging tool - dumping object state.

                                      (1.4) What are the benefits of JSX?
                                      - A human-readable form of normally invisible objects
                                      - A human-edtiable form, for entering and editing objects
                                      - A human-comprehendible wire/file protocol for object and data exchange
                                      between other applications and languages

                                      (1.5) What are the goals of JSX?
                                      To be able to instantly XML-enable applications, without needing to change
                                      them at all.
                                      - to produce a "human comprehendible" XML representation of object graphs,
                                      that is readable and robust under human edits.
                                      - in the long-term, to help users handle the inevitable evolution of objects

                                      - a direct JOS replacement.
                                      - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                      and so JSX can only add functionality through its constructors, using the
                                      Config object.





                                      (2). Using the Serialization API
                                      ================================

                                      (2.1). Where's a good tutorial?
                                      "Advanced Object Serialization", by John Zukowski (August 2001)
                                      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                      (2.2). How do I write my own readObject() and writeObject() methods?
                                      Here's the signatures:
                                      private void readObject(ObjectInputStream ois)
                                      throws ClassNotFoundException, IOException {
                                      //your code here
                                      }
                                      private writeObject(ObjectOutputStream oos)
                                      throws IOException {
                                      //your code here
                                      }


                                      (2.3). How do I use GetField?
                                      It can only be used within a readObject() method that you have coded for your
                                      class, and is called by the serialization system.

                                      See example in:
                                      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                      It's almost halfway through, under the heading: "Using ObjectStreamField"



                                      (3). Using JSX
                                      ==============

                                      (3.1). How do I use Config?

                                      Config is used to configure JSX for both input and output. You create the
                                      Config object, set it, and then pass it into the constructor of either an
                                      ObjIn or ObjOut. For example:

                                      Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                      ObjectInputStream in = new ObjIn(cfg); //pass it in

                                      Note that the option setting can be chained. Check the source code
                                      (Config.java) for more options.

                                      For the above example, "handler" is used like an event handler. A common
                                      approach is to subclass the default implementation with your own anonymous
                                      class:

                                      NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                      public String noSuchField(Class c, String fieldName) {
                                      if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                      return "theNewFieldName";
                                      else
                                      throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                      }
                                      };
                                      //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                      //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                      //old fieldnames to new fieldnames.
                                    • JSX-ideas@yahoogroups.com
                                      JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                      Message 18 of 30 , Feb 1 1:24 PM
                                      • 0 Attachment
                                        JSX FAQ - 14 November 2001
                                        =======

                                        JSX instantly XML-enables applications, by re-implementing the Serialization
                                        API for XML.

                                        FAQ Contents:
                                        (1). Background
                                        (2). Using the Serialization API
                                        (3). Using JSX

                                        If your question is not answered here, please try the homepage:
                                        http://www.csse.monash.edu.au/~bren/JSX/
                                        or mailing list:
                                        http://groups.yahoo.com/group/JSX-ideas/messages

                                        ------------------------------------------------------------------------------


                                        (1). Background
                                        ===============

                                        (1.1) JSX stands for...?
                                        Java Serialization to XML

                                        (1.2) What does JOS stand for?
                                        Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                        (1.3) What are the uses of JSX?
                                        - Long-term persistence - XML can be modified directly.
                                        - A transparent protocol for communicating between different components,
                                        that is easy to debug, and able to cope with different objects.
                                        - Configuration files.
                                        - A debugging tool - dumping object state.

                                        (1.4) What are the benefits of JSX?
                                        - A human-readable form of normally invisible objects
                                        - A human-edtiable form, for entering and editing objects
                                        - A human-comprehendible wire/file protocol for object and data exchange
                                        between other applications and languages

                                        (1.5) What are the goals of JSX?
                                        To be able to instantly XML-enable applications, without needing to change
                                        them at all.
                                        - to produce a "human comprehendible" XML representation of object graphs,
                                        that is readable and robust under human edits.
                                        - in the long-term, to help users handle the inevitable evolution of objects

                                        - a direct JOS replacement.
                                        - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                        and so JSX can only add functionality through its constructors, using the
                                        Config object.





                                        (2). Using the Serialization API
                                        ================================

                                        (2.1). Where's a good tutorial?
                                        "Advanced Object Serialization", by John Zukowski (August 2001)
                                        http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                        (2.2). How do I write my own readObject() and writeObject() methods?
                                        Here's the signatures:
                                        private void readObject(ObjectInputStream ois)
                                        throws ClassNotFoundException, IOException {
                                        //your code here
                                        }
                                        private writeObject(ObjectOutputStream oos)
                                        throws IOException {
                                        //your code here
                                        }


                                        (2.3). How do I use GetField?
                                        It can only be used within a readObject() method that you have coded for your
                                        class, and is called by the serialization system.

                                        See example in:
                                        http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                        It's almost halfway through, under the heading: "Using ObjectStreamField"



                                        (3). Using JSX
                                        ==============

                                        (3.1). How do I use Config?

                                        Config is used to configure JSX for both input and output. You create the
                                        Config object, set it, and then pass it into the constructor of either an
                                        ObjIn or ObjOut. For example:

                                        Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                        ObjectInputStream in = new ObjIn(cfg); //pass it in

                                        Note that the option setting can be chained. Check the source code
                                        (Config.java) for more options.

                                        For the above example, "handler" is used like an event handler. A common
                                        approach is to subclass the default implementation with your own anonymous
                                        class:

                                        NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                        public String noSuchField(Class c, String fieldName) {
                                        if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                        return "theNewFieldName";
                                        else
                                        throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                        }
                                        };
                                        //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                        //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                        //old fieldnames to new fieldnames.
                                      • JSX-ideas@yahoogroups.com
                                        JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                        Message 19 of 30 , Mar 1, 2003
                                        • 0 Attachment
                                          JSX FAQ - 14 November 2001
                                          =======

                                          JSX instantly XML-enables applications, by re-implementing the Serialization
                                          API for XML.

                                          FAQ Contents:
                                          (1). Background
                                          (2). Using the Serialization API
                                          (3). Using JSX

                                          If your question is not answered here, please try the homepage:
                                          http://www.csse.monash.edu.au/~bren/JSX/
                                          or mailing list:
                                          http://groups.yahoo.com/group/JSX-ideas/messages

                                          ------------------------------------------------------------------------------


                                          (1). Background
                                          ===============

                                          (1.1) JSX stands for...?
                                          Java Serialization to XML

                                          (1.2) What does JOS stand for?
                                          Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                          (1.3) What are the uses of JSX?
                                          - Long-term persistence - XML can be modified directly.
                                          - A transparent protocol for communicating between different components,
                                          that is easy to debug, and able to cope with different objects.
                                          - Configuration files.
                                          - A debugging tool - dumping object state.

                                          (1.4) What are the benefits of JSX?
                                          - A human-readable form of normally invisible objects
                                          - A human-edtiable form, for entering and editing objects
                                          - A human-comprehendible wire/file protocol for object and data exchange
                                          between other applications and languages

                                          (1.5) What are the goals of JSX?
                                          To be able to instantly XML-enable applications, without needing to change
                                          them at all.
                                          - to produce a "human comprehendible" XML representation of object graphs,
                                          that is readable and robust under human edits.
                                          - in the long-term, to help users handle the inevitable evolution of objects

                                          - a direct JOS replacement.
                                          - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                          and so JSX can only add functionality through its constructors, using the
                                          Config object.





                                          (2). Using the Serialization API
                                          ================================

                                          (2.1). Where's a good tutorial?
                                          "Advanced Object Serialization", by John Zukowski (August 2001)
                                          http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                          (2.2). How do I write my own readObject() and writeObject() methods?
                                          Here's the signatures:
                                          private void readObject(ObjectInputStream ois)
                                          throws ClassNotFoundException, IOException {
                                          //your code here
                                          }
                                          private writeObject(ObjectOutputStream oos)
                                          throws IOException {
                                          //your code here
                                          }


                                          (2.3). How do I use GetField?
                                          It can only be used within a readObject() method that you have coded for your
                                          class, and is called by the serialization system.

                                          See example in:
                                          http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                          It's almost halfway through, under the heading: "Using ObjectStreamField"



                                          (3). Using JSX
                                          ==============

                                          (3.1). How do I use Config?

                                          Config is used to configure JSX for both input and output. You create the
                                          Config object, set it, and then pass it into the constructor of either an
                                          ObjIn or ObjOut. For example:

                                          Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                          ObjectInputStream in = new ObjIn(cfg); //pass it in

                                          Note that the option setting can be chained. Check the source code
                                          (Config.java) for more options.

                                          For the above example, "handler" is used like an event handler. A common
                                          approach is to subclass the default implementation with your own anonymous
                                          class:

                                          NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                          public String noSuchField(Class c, String fieldName) {
                                          if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                          return "theNewFieldName";
                                          else
                                          throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                          }
                                          };
                                          //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                          //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                          //old fieldnames to new fieldnames.
                                        • JSX-ideas@yahoogroups.com
                                          JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                          Message 20 of 30 , Apr 1, 2003
                                          • 0 Attachment
                                            JSX FAQ - 14 November 2001
                                            =======

                                            JSX instantly XML-enables applications, by re-implementing the Serialization
                                            API for XML.

                                            FAQ Contents:
                                            (1). Background
                                            (2). Using the Serialization API
                                            (3). Using JSX

                                            If your question is not answered here, please try the homepage:
                                            http://www.csse.monash.edu.au/~bren/JSX/
                                            or mailing list:
                                            http://groups.yahoo.com/group/JSX-ideas/messages

                                            ------------------------------------------------------------------------------


                                            (1). Background
                                            ===============

                                            (1.1) JSX stands for...?
                                            Java Serialization to XML

                                            (1.2) What does JOS stand for?
                                            Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                            (1.3) What are the uses of JSX?
                                            - Long-term persistence - XML can be modified directly.
                                            - A transparent protocol for communicating between different components,
                                            that is easy to debug, and able to cope with different objects.
                                            - Configuration files.
                                            - A debugging tool - dumping object state.

                                            (1.4) What are the benefits of JSX?
                                            - A human-readable form of normally invisible objects
                                            - A human-edtiable form, for entering and editing objects
                                            - A human-comprehendible wire/file protocol for object and data exchange
                                            between other applications and languages

                                            (1.5) What are the goals of JSX?
                                            To be able to instantly XML-enable applications, without needing to change
                                            them at all.
                                            - to produce a "human comprehendible" XML representation of object graphs,
                                            that is readable and robust under human edits.
                                            - in the long-term, to help users handle the inevitable evolution of objects

                                            - a direct JOS replacement.
                                            - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                            and so JSX can only add functionality through its constructors, using the
                                            Config object.





                                            (2). Using the Serialization API
                                            ================================

                                            (2.1). Where's a good tutorial?
                                            "Advanced Object Serialization", by John Zukowski (August 2001)
                                            http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                            (2.2). How do I write my own readObject() and writeObject() methods?
                                            Here's the signatures:
                                            private void readObject(ObjectInputStream ois)
                                            throws ClassNotFoundException, IOException {
                                            //your code here
                                            }
                                            private writeObject(ObjectOutputStream oos)
                                            throws IOException {
                                            //your code here
                                            }


                                            (2.3). How do I use GetField?
                                            It can only be used within a readObject() method that you have coded for your
                                            class, and is called by the serialization system.

                                            See example in:
                                            http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                            It's almost halfway through, under the heading: "Using ObjectStreamField"



                                            (3). Using JSX
                                            ==============

                                            (3.1). How do I use Config?

                                            Config is used to configure JSX for both input and output. You create the
                                            Config object, set it, and then pass it into the constructor of either an
                                            ObjIn or ObjOut. For example:

                                            Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                            ObjectInputStream in = new ObjIn(cfg); //pass it in

                                            Note that the option setting can be chained. Check the source code
                                            (Config.java) for more options.

                                            For the above example, "handler" is used like an event handler. A common
                                            approach is to subclass the default implementation with your own anonymous
                                            class:

                                            NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                            public String noSuchField(Class c, String fieldName) {
                                            if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                            return "theNewFieldName";
                                            else
                                            throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                            }
                                            };
                                            //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                            //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                            //old fieldnames to new fieldnames.
                                          • JSX-ideas@yahoogroups.com
                                            JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                            Message 21 of 30 , May 1, 2003
                                            • 0 Attachment
                                              JSX FAQ - 14 November 2001
                                              =======

                                              JSX instantly XML-enables applications, by re-implementing the Serialization
                                              API for XML.

                                              FAQ Contents:
                                              (1). Background
                                              (2). Using the Serialization API
                                              (3). Using JSX

                                              If your question is not answered here, please try the homepage:
                                              http://www.csse.monash.edu.au/~bren/JSX/
                                              or mailing list:
                                              http://groups.yahoo.com/group/JSX-ideas/messages

                                              ------------------------------------------------------------------------------


                                              (1). Background
                                              ===============

                                              (1.1) JSX stands for...?
                                              Java Serialization to XML

                                              (1.2) What does JOS stand for?
                                              Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                              (1.3) What are the uses of JSX?
                                              - Long-term persistence - XML can be modified directly.
                                              - A transparent protocol for communicating between different components,
                                              that is easy to debug, and able to cope with different objects.
                                              - Configuration files.
                                              - A debugging tool - dumping object state.

                                              (1.4) What are the benefits of JSX?
                                              - A human-readable form of normally invisible objects
                                              - A human-edtiable form, for entering and editing objects
                                              - A human-comprehendible wire/file protocol for object and data exchange
                                              between other applications and languages

                                              (1.5) What are the goals of JSX?
                                              To be able to instantly XML-enable applications, without needing to change
                                              them at all.
                                              - to produce a "human comprehendible" XML representation of object graphs,
                                              that is readable and robust under human edits.
                                              - in the long-term, to help users handle the inevitable evolution of objects

                                              - a direct JOS replacement.
                                              - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                              and so JSX can only add functionality through its constructors, using the
                                              Config object.





                                              (2). Using the Serialization API
                                              ================================

                                              (2.1). Where's a good tutorial?
                                              "Advanced Object Serialization", by John Zukowski (August 2001)
                                              http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                              (2.2). How do I write my own readObject() and writeObject() methods?
                                              Here's the signatures:
                                              private void readObject(ObjectInputStream ois)
                                              throws ClassNotFoundException, IOException {
                                              //your code here
                                              }
                                              private writeObject(ObjectOutputStream oos)
                                              throws IOException {
                                              //your code here
                                              }


                                              (2.3). How do I use GetField?
                                              It can only be used within a readObject() method that you have coded for your
                                              class, and is called by the serialization system.

                                              See example in:
                                              http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                              It's almost halfway through, under the heading: "Using ObjectStreamField"



                                              (3). Using JSX
                                              ==============

                                              (3.1). How do I use Config?

                                              Config is used to configure JSX for both input and output. You create the
                                              Config object, set it, and then pass it into the constructor of either an
                                              ObjIn or ObjOut. For example:

                                              Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                              ObjectInputStream in = new ObjIn(cfg); //pass it in

                                              Note that the option setting can be chained. Check the source code
                                              (Config.java) for more options.

                                              For the above example, "handler" is used like an event handler. A common
                                              approach is to subclass the default implementation with your own anonymous
                                              class:

                                              NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                              public String noSuchField(Class c, String fieldName) {
                                              if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                              return "theNewFieldName";
                                              else
                                              throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                              }
                                              };
                                              //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                              //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                              //old fieldnames to new fieldnames.
                                            • JSX-ideas@yahoogroups.com
                                              JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                              Message 22 of 30 , Jun 1, 2003
                                              • 0 Attachment
                                                JSX FAQ - 14 November 2001
                                                =======

                                                JSX instantly XML-enables applications, by re-implementing the Serialization
                                                API for XML.

                                                FAQ Contents:
                                                (1). Background
                                                (2). Using the Serialization API
                                                (3). Using JSX

                                                If your question is not answered here, please try the homepage:
                                                http://www.csse.monash.edu.au/~bren/JSX/
                                                or mailing list:
                                                http://groups.yahoo.com/group/JSX-ideas/messages

                                                ------------------------------------------------------------------------------


                                                (1). Background
                                                ===============

                                                (1.1) JSX stands for...?
                                                Java Serialization to XML

                                                (1.2) What does JOS stand for?
                                                Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                                (1.3) What are the uses of JSX?
                                                - Long-term persistence - XML can be modified directly.
                                                - A transparent protocol for communicating between different components,
                                                that is easy to debug, and able to cope with different objects.
                                                - Configuration files.
                                                - A debugging tool - dumping object state.

                                                (1.4) What are the benefits of JSX?
                                                - A human-readable form of normally invisible objects
                                                - A human-edtiable form, for entering and editing objects
                                                - A human-comprehendible wire/file protocol for object and data exchange
                                                between other applications and languages

                                                (1.5) What are the goals of JSX?
                                                To be able to instantly XML-enable applications, without needing to change
                                                them at all.
                                                - to produce a "human comprehendible" XML representation of object graphs,
                                                that is readable and robust under human edits.
                                                - in the long-term, to help users handle the inevitable evolution of objects

                                                - a direct JOS replacement.
                                                - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                                and so JSX can only add functionality through its constructors, using the
                                                Config object.





                                                (2). Using the Serialization API
                                                ================================

                                                (2.1). Where's a good tutorial?
                                                "Advanced Object Serialization", by John Zukowski (August 2001)
                                                http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                                (2.2). How do I write my own readObject() and writeObject() methods?
                                                Here's the signatures:
                                                private void readObject(ObjectInputStream ois)
                                                throws ClassNotFoundException, IOException {
                                                //your code here
                                                }
                                                private writeObject(ObjectOutputStream oos)
                                                throws IOException {
                                                //your code here
                                                }


                                                (2.3). How do I use GetField?
                                                It can only be used within a readObject() method that you have coded for your
                                                class, and is called by the serialization system.

                                                See example in:
                                                http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                                It's almost halfway through, under the heading: "Using ObjectStreamField"



                                                (3). Using JSX
                                                ==============

                                                (3.1). How do I use Config?

                                                Config is used to configure JSX for both input and output. You create the
                                                Config object, set it, and then pass it into the constructor of either an
                                                ObjIn or ObjOut. For example:

                                                Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                                ObjectInputStream in = new ObjIn(cfg); //pass it in

                                                Note that the option setting can be chained. Check the source code
                                                (Config.java) for more options.

                                                For the above example, "handler" is used like an event handler. A common
                                                approach is to subclass the default implementation with your own anonymous
                                                class:

                                                NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                                public String noSuchField(Class c, String fieldName) {
                                                if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                                return "theNewFieldName";
                                                else
                                                throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                                }
                                                };
                                                //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                                //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                                //old fieldnames to new fieldnames.
                                              • JSX-ideas@yahoogroups.com
                                                JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                                Message 23 of 30 , Jul 1, 2003
                                                • 0 Attachment
                                                  JSX FAQ - 14 November 2001
                                                  =======

                                                  JSX instantly XML-enables applications, by re-implementing the Serialization
                                                  API for XML.

                                                  FAQ Contents:
                                                  (1). Background
                                                  (2). Using the Serialization API
                                                  (3). Using JSX

                                                  If your question is not answered here, please try the homepage:
                                                  http://www.csse.monash.edu.au/~bren/JSX/
                                                  or mailing list:
                                                  http://groups.yahoo.com/group/JSX-ideas/messages

                                                  ------------------------------------------------------------------------------


                                                  (1). Background
                                                  ===============

                                                  (1.1) JSX stands for...?
                                                  Java Serialization to XML

                                                  (1.2) What does JOS stand for?
                                                  Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                                  (1.3) What are the uses of JSX?
                                                  - Long-term persistence - XML can be modified directly.
                                                  - A transparent protocol for communicating between different components,
                                                  that is easy to debug, and able to cope with different objects.
                                                  - Configuration files.
                                                  - A debugging tool - dumping object state.

                                                  (1.4) What are the benefits of JSX?
                                                  - A human-readable form of normally invisible objects
                                                  - A human-edtiable form, for entering and editing objects
                                                  - A human-comprehendible wire/file protocol for object and data exchange
                                                  between other applications and languages

                                                  (1.5) What are the goals of JSX?
                                                  To be able to instantly XML-enable applications, without needing to change
                                                  them at all.
                                                  - to produce a "human comprehendible" XML representation of object graphs,
                                                  that is readable and robust under human edits.
                                                  - in the long-term, to help users handle the inevitable evolution of objects

                                                  - a direct JOS replacement.
                                                  - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                                  and so JSX can only add functionality through its constructors, using the
                                                  Config object.





                                                  (2). Using the Serialization API
                                                  ================================

                                                  (2.1). Where's a good tutorial?
                                                  "Advanced Object Serialization", by John Zukowski (August 2001)
                                                  http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                                  (2.2). How do I write my own readObject() and writeObject() methods?
                                                  Here's the signatures:
                                                  private void readObject(ObjectInputStream ois)
                                                  throws ClassNotFoundException, IOException {
                                                  //your code here
                                                  }
                                                  private writeObject(ObjectOutputStream oos)
                                                  throws IOException {
                                                  //your code here
                                                  }


                                                  (2.3). How do I use GetField?
                                                  It can only be used within a readObject() method that you have coded for your
                                                  class, and is called by the serialization system.

                                                  See example in:
                                                  http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                                  It's almost halfway through, under the heading: "Using ObjectStreamField"



                                                  (3). Using JSX
                                                  ==============

                                                  (3.1). How do I use Config?

                                                  Config is used to configure JSX for both input and output. You create the
                                                  Config object, set it, and then pass it into the constructor of either an
                                                  ObjIn or ObjOut. For example:

                                                  Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                                  ObjectInputStream in = new ObjIn(cfg); //pass it in

                                                  Note that the option setting can be chained. Check the source code
                                                  (Config.java) for more options.

                                                  For the above example, "handler" is used like an event handler. A common
                                                  approach is to subclass the default implementation with your own anonymous
                                                  class:

                                                  NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                                  public String noSuchField(Class c, String fieldName) {
                                                  if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                                  return "theNewFieldName";
                                                  else
                                                  throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                                  }
                                                  };
                                                  //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                                  //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                                  //old fieldnames to new fieldnames.
                                                • JSX-ideas@yahoogroups.com
                                                  JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                                  Message 24 of 30 , Aug 1, 2003
                                                  • 0 Attachment
                                                    JSX FAQ - 14 November 2001
                                                    =======

                                                    JSX instantly XML-enables applications, by re-implementing the Serialization
                                                    API for XML.

                                                    FAQ Contents:
                                                    (1). Background
                                                    (2). Using the Serialization API
                                                    (3). Using JSX

                                                    If your question is not answered here, please try the homepage:
                                                    http://www.csse.monash.edu.au/~bren/JSX/
                                                    or mailing list:
                                                    http://groups.yahoo.com/group/JSX-ideas/messages

                                                    ------------------------------------------------------------------------------


                                                    (1). Background
                                                    ===============

                                                    (1.1) JSX stands for...?
                                                    Java Serialization to XML

                                                    (1.2) What does JOS stand for?
                                                    Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                                    (1.3) What are the uses of JSX?
                                                    - Long-term persistence - XML can be modified directly.
                                                    - A transparent protocol for communicating between different components,
                                                    that is easy to debug, and able to cope with different objects.
                                                    - Configuration files.
                                                    - A debugging tool - dumping object state.

                                                    (1.4) What are the benefits of JSX?
                                                    - A human-readable form of normally invisible objects
                                                    - A human-edtiable form, for entering and editing objects
                                                    - A human-comprehendible wire/file protocol for object and data exchange
                                                    between other applications and languages

                                                    (1.5) What are the goals of JSX?
                                                    To be able to instantly XML-enable applications, without needing to change
                                                    them at all.
                                                    - to produce a "human comprehendible" XML representation of object graphs,
                                                    that is readable and robust under human edits.
                                                    - in the long-term, to help users handle the inevitable evolution of objects

                                                    - a direct JOS replacement.
                                                    - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                                    and so JSX can only add functionality through its constructors, using the
                                                    Config object.





                                                    (2). Using the Serialization API
                                                    ================================

                                                    (2.1). Where's a good tutorial?
                                                    "Advanced Object Serialization", by John Zukowski (August 2001)
                                                    http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                                    (2.2). How do I write my own readObject() and writeObject() methods?
                                                    Here's the signatures:
                                                    private void readObject(ObjectInputStream ois)
                                                    throws ClassNotFoundException, IOException {
                                                    //your code here
                                                    }
                                                    private writeObject(ObjectOutputStream oos)
                                                    throws IOException {
                                                    //your code here
                                                    }


                                                    (2.3). How do I use GetField?
                                                    It can only be used within a readObject() method that you have coded for your
                                                    class, and is called by the serialization system.

                                                    See example in:
                                                    http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                                    It's almost halfway through, under the heading: "Using ObjectStreamField"



                                                    (3). Using JSX
                                                    ==============

                                                    (3.1). How do I use Config?

                                                    Config is used to configure JSX for both input and output. You create the
                                                    Config object, set it, and then pass it into the constructor of either an
                                                    ObjIn or ObjOut. For example:

                                                    Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                                    ObjectInputStream in = new ObjIn(cfg); //pass it in

                                                    Note that the option setting can be chained. Check the source code
                                                    (Config.java) for more options.

                                                    For the above example, "handler" is used like an event handler. A common
                                                    approach is to subclass the default implementation with your own anonymous
                                                    class:

                                                    NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                                    public String noSuchField(Class c, String fieldName) {
                                                    if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                                    return "theNewFieldName";
                                                    else
                                                    throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                                    }
                                                    };
                                                    //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                                    //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                                    //old fieldnames to new fieldnames.
                                                  • JSX-ideas@yahoogroups.com
                                                    JSX FAQ - 14 November 2001 ======= JSX instantly XML-enables applications, by re-implementing the Serialization API for XML. FAQ Contents: (1). Background (2).
                                                    Message 25 of 30 , Sep 1, 2003
                                                    • 0 Attachment
                                                      JSX FAQ - 14 November 2001
                                                      =======

                                                      JSX instantly XML-enables applications, by re-implementing the Serialization
                                                      API for XML.

                                                      FAQ Contents:
                                                      (1). Background
                                                      (2). Using the Serialization API
                                                      (3). Using JSX

                                                      If your question is not answered here, please try the homepage:
                                                      http://www.csse.monash.edu.au/~bren/JSX/
                                                      or mailing list:
                                                      http://groups.yahoo.com/group/JSX-ideas/messages

                                                      ------------------------------------------------------------------------------


                                                      (1). Background
                                                      ===============

                                                      (1.1) JSX stands for...?
                                                      Java Serialization to XML

                                                      (1.2) What does JOS stand for?
                                                      Java Object Serialization (sometimes referred to as "Java's own Serialization")

                                                      (1.3) What are the uses of JSX?
                                                      - Long-term persistence - XML can be modified directly.
                                                      - A transparent protocol for communicating between different components,
                                                      that is easy to debug, and able to cope with different objects.
                                                      - Configuration files.
                                                      - A debugging tool - dumping object state.

                                                      (1.4) What are the benefits of JSX?
                                                      - A human-readable form of normally invisible objects
                                                      - A human-edtiable form, for entering and editing objects
                                                      - A human-comprehendible wire/file protocol for object and data exchange
                                                      between other applications and languages

                                                      (1.5) What are the goals of JSX?
                                                      To be able to instantly XML-enable applications, without needing to change
                                                      them at all.
                                                      - to produce a "human comprehendible" XML representation of object graphs,
                                                      that is readable and robust under human edits.
                                                      - in the long-term, to help users handle the inevitable evolution of objects

                                                      - a direct JOS replacement.
                                                      - replaceable *by* JOS. Thus, JSX should not pollute the Serialization API -
                                                      and so JSX can only add functionality through its constructors, using the
                                                      Config object.





                                                      (2). Using the Serialization API
                                                      ================================

                                                      (2.1). Where's a good tutorial?
                                                      "Advanced Object Serialization", by John Zukowski (August 2001)
                                                      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/

                                                      (2.2). How do I write my own readObject() and writeObject() methods?
                                                      Here's the signatures:
                                                      private void readObject(ObjectInputStream ois)
                                                      throws ClassNotFoundException, IOException {
                                                      //your code here
                                                      }
                                                      private writeObject(ObjectOutputStream oos)
                                                      throws IOException {
                                                      //your code here
                                                      }


                                                      (2.3). How do I use GetField?
                                                      It can only be used within a readObject() method that you have coded for your
                                                      class, and is called by the serialization system.

                                                      See example in:
                                                      http://developer.java.sun.com/developer/technicalArticles/ALT/serialization/
                                                      It's almost halfway through, under the heading: "Using ObjectStreamField"



                                                      (3). Using JSX
                                                      ==============

                                                      (3.1). How do I use Config?

                                                      Config is used to configure JSX for both input and output. You create the
                                                      Config object, set it, and then pass it into the constructor of either an
                                                      ObjIn or ObjOut. For example:

                                                      Config cfg = new Config().setNoSuchFieldHandler(handler).setFormatting(false);
                                                      ObjectInputStream in = new ObjIn(cfg); //pass it in

                                                      Note that the option setting can be chained. Check the source code
                                                      (Config.java) for more options.

                                                      For the above example, "handler" is used like an event handler. A common
                                                      approach is to subclass the default implementation with your own anonymous
                                                      class:

                                                      NoSuchFieldHandler handler = new NoSuchFieldHandler() {
                                                      public String noSuchField(Class c, String fieldName) {
                                                      if (c==TheClassName.class && fieldName.equals("theOldFieldName") )
                                                      return "theNewFieldName";
                                                      else
                                                      throw new NoSuchFieldException("No mapping for "+theOldFieldName+" in "+c);
                                                      }
                                                      };
                                                      //NOTE: instead of "if" above, use a Hashtable or HashMap for more complex cases
                                                      //Eg. could use two: first tier maps classes to HashMaps, which in turn maps
                                                      //old fieldnames to new fieldnames.
                                                    Your message has been successfully submitted and would be delivered to recipients shortly.