facebook

Generationg XSD from Java class

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #299060 Reply

    Douglas M Hurst
    Participant

    Does MyEclipse have any way of building using…

    com.sun.tools.jxc.SchemaGeneratorFacade

    … on the code below, the way the JWSDP 2.0 does using schemagen, to create an .XSD schema file?

    This file has no errors in MyEclipse when using JDK 1.6. I hate to develop the code in MyEclipse, then have to execute schemagen in a dos box.

    package generated;

    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = “address”, propOrder = {“name”,”street”,”city”,”state”,”zip”})
    public class Address {

    @XmlElement(required = true)
    private String name;
    @XmlElement(required = true)
    private String street;
    @XmlElement(required = true)
    private String city;
    @XmlElement(required = true)
    private String state;
    @XmlElement(required = true)
    private short zip;

    public Address() {}

    public Address(String name, String street, String city, String state, short zip) {
    this.name = name;
    this.street = street;
    this.city = city;
    this.state = state;
    this.zip = zip;
    }

    public String getName() {
    return name;
    }

    public void setName(String name) {
    this.name = name;
    }

    public String getStreet() {
    return street;
    }

    public void setStreet(String street) {
    this.street = street;
    }

    public String getCity() {
    return city;
    }

    public void setCity(String city) {
    this.city = city;
    }

    public String getState() {
    return state;
    }

    public void setState(String state) {
    this.state = state;
    }

    public short getZip() {
    return zip;
    }

    public void setZip(short zip) {
    this.zip = zip;
    }

    public String toString() {
    StringBuilder s = new StringBuilder();
    if(name!=null) s.append(name).append(‘\n’);
    s.append(street).append(‘\n’).append(city).append(“, “).append(state).append(” “).append(zip);
    return s.toString();
    }
    }

    #299106 Reply

    Brian Fernandes
    Moderator

    douglas,

    Go to Run > External Tools > External Tools Configurations… Here, double click “Program” and go ahead and name / customize the new configuration created to run schemagen. On the Refresh tab you can set it to refresh your project / workspace on completion. Once you create the configuration, you can launch it repeatedly by selecting it from the External Tools drop down in the toolbar (or just clicking the button if it was your last used external launch).

    Hope this helps, let us know if you require further assitance.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Generationg XSD from Java class

You must be logged in to post in the forum log in