use xml to describe java class

Discussion in 'Java' started by f, Nov 26, 2003.

  1. f

    f Guest

    I am writing a java code generation tool. The tool will take a java
    class description written in xml and translate it to java code using
    xslt. I am looking for samples of xml files that describe java class.
    Any help appreciated.

    ff
    f, Nov 26, 2003
    #1
    1. Advertising

  2. Hi,

    I've successfully used the Eclipse Modelling Framework for this.
    You may want to have a look at this:

    http://www.eclipse.org/emf/
    http://www.omg.org/technology/documents/formal/xmi.htm

    HTH, Michael


    "f" <> schrieb im Newsbeitrag news:...
    > I am writing a java code generation tool. The tool will take a java
    > class description written in xml and translate it to java code using
    > xslt. I am looking for samples of xml files that describe java class.
    > Any help appreciated.
    >
    > ff
    Michael Schwind, Nov 26, 2003
    #2
    1. Advertising

  3. Take a look at JavaML at http://www.cs.washington.edu/homes/gjb/JavaML/

    Flo


    "f" <> schrieb im Newsbeitrag
    news:...
    > I am writing a java code generation tool. The tool will take a java
    > class description written in xml and translate it to java code using
    > xslt. I am looking for samples of xml files that describe java class.
    > Any help appreciated.
    >
    > ff
    Florian Deissenboeck, Nov 27, 2003
    #3
  4. f

    GIMME Guest

    Why can't you use java 1.4's built in code which works on java beans ...

    import java.io.*;
    import java.beans.*;

    public class ENXML
    {

    public static void encode( String FileName , A a )
    throws FileNotFoundException
    {
    XMLEncoder encoder = new XMLEncoder(
    new BufferedOutputStream(
    new FileOutputStream( FileName )));

    encoder.writeObject( a );
    encoder.close();
    }

    public static A decode( String FileName )
    throws FileNotFoundException
    {
    XMLDecoder decoder = new XMLDecoder(
    new BufferedInputStream(
    new FileInputStream( FileName )));

    A a = (A)decoder.readObject();
    decoder.close();
    return a;
    }

    }
    GIMME, Dec 1, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ingmar Seifert
    Replies:
    10
    Views:
    17,011
    swatig29
    Nov 4, 2009
  2. Eric DELAGE
    Replies:
    2
    Views:
    662
  3. Cram TeXeD
    Replies:
    0
    Views:
    339
    Cram TeXeD
    Jun 12, 2004
  4. f
    Replies:
    4
    Views:
    410
    GIMME
    Dec 1, 2003
  5. Manuel
    Replies:
    0
    Views:
    492
    Manuel
    Sep 28, 2005
Loading...

Share This Page