SoftLayer Data Type Java class generator
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

SoftLayer Java Data Type Generator

What this does

Generates a Java class based on the webpage of a SoftLayer Data Type reference API. (E.G.


  1. git clone this repository.
  2. pip install -r requirements.txt (May want to create a virtualenv first)
  3. python -p <package name> <URL to SoftLayer Data Type API reference>
  4. See python --help for full usage options.


python -p

The command above will generate a file named in the current folder with the following contents:


import java.util.Date;

public class Account {
  private Integer accountStatusId;
  private String address1;
  private String address2;
  private Integer allowedPptpVpnQuantity;
  private String alternatePhone;
  private Integer brandId;
  private String city;
  private Boolean claimedTaxExemptTxFlag;
  private String companyName;
  private String country;
  private Date createDate;
  private String email;
  private String faxPhone;
  private String firstName;
  private Integer id;
  private Integer isReseller;
  private String lastName;
  private Boolean lateFeeProtectionFlag;
  private Date modifyDate;
  private String officePhone;
  private String postalCode;
  private String state;
  private Date statusDate;



  • Relational and Count properties are not included.
  • Getters/setters aren't implemented. Your IDE can do this task for you and you can choose how to do it.
  • Wrapper types are used instead of primitives; this makes it easier to discern when a property was missing from an unmarshalling operation, rather than being present but set to its default value.
  • Classes should be ready to be used by Jackson without any field annotations (once the getters/setters are defined) as the field names match 1-1 with the property names.


The SoftLayer APIs are pretty well documented. Unfortunately, there doesn't appear to be an XSD for their REST API, meaning you can't auto-generate Java classes using xjc. However, this is a problem for me as I'm lazy and don't like copying and pasting a bunch of field names to make a Java class.

Python to rescue

Thankfully, the SoftLayer Data Types are fairly well-documented and using BeautifulSoup made it easy to extract the property names and their types in order to convert the result into a Java class.