use xml to describe java class

Discussion in 'XML' 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

    Guest

    On Thu, 27 Nov 2003 09:27:11 +0100, "Florian Deissenboeck"
    <> wrote:

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


    Cool. That has java-to-xml and xml-to-java (and xml-to-html). How
    about pascal-to-xml, xml-to-pascal. Etc.
    Then we just need a decent xml-editor and some version control system
    to get things really rolling.

    Has anyone done any work on pascal-to-xml?


    -Timo
     
    , Nov 30, 2003
    #4
  5. 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
    #5
    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,094
    swatig29
    Nov 4, 2009
  2. Eric DELAGE
    Replies:
    2
    Views:
    681
  3. f
    Replies:
    3
    Views:
    385
    GIMME
    Dec 1, 2003
  4. Cram TeXeD
    Replies:
    0
    Views:
    352
    Cram TeXeD
    Jun 12, 2004
  5. Manuel
    Replies:
    0
    Views:
    494
    Manuel
    Sep 28, 2005
Loading...

Share This Page