コード例 #1
0
ファイル: Generator.java プロジェクト: vitkin/sfdc-wsc
  protected void generateComplexTypeClass(Types types, Schema schema, File dir) throws IOException {
    for (ComplexType complexType : schema.getComplexTypes()) {

      if (!typeMapper.isWellKnownType(
          complexType.getSchema().getTargetNamespace(), complexType.getName())) {
        generateClassFromComplexType(types, schema, complexType, dir);
      }
    }
  }
コード例 #2
0
  public String xsiType() {
    if (complexType.getBase() == null) {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    sb.append("__typeMapper.writeXsiType(__out, \"");
    sb.append(complexType.getSchema().getTargetNamespace());
    sb.append("\", \"");
    sb.append(complexType.getName());
    sb.append("\");");
    return sb.toString();
  }
コード例 #3
0
  public String baseClass() {
    StringBuilder sb = new StringBuilder();

    if (complexType.getBase() == null) {
      if (complexType.isHeader()) {
        sb.append("extends com.sforce.ws.bind.SoapHeaderObject ");
      } else if (getClassName().endsWith("Fault")) {
        sb.append("extends com.sforce.ws.SoapFaultException ");
      }
      sb.append("implements com.sforce.ws.bind.XMLizable");
    } else {
      sb.append("extends ").append(localJavaType(complexType.getBase(), 1, false));
    }
    return sb.toString();
  }
コード例 #4
0
  public String superToString() {
    if (!complexType.hasBaseClass()) {
      return "";
    }

    return "sb.append(super.toString());";
  }
コード例 #5
0
  public String superWrite() {
    if (!complexType.hasBaseClass()) {
      return "";
    }

    return "super.writeFields(__out, __typeMapper);";
  }
コード例 #6
0
  public String superLoad() {
    if (!complexType.hasBaseClass()) {
      return "";
    }

    return "super.loadFields(__in, __typeMapper);";
  }
コード例 #7
0
 public ComplexTypeGenerator(
     Types types,
     Schema schema,
     ComplexType complexType,
     File tempDir,
     TypeMapper typeMapper,
     boolean laxMinOccursMode) {
   super(types, schema, complexType.getName(), tempDir, typeMapper);
   this.complexType = complexType;
   this.laxMinOccursMode = laxMinOccursMode;
 }
コード例 #8
0
  public Iterator<Element> getElements() {
    Collection sequence = complexType.getContent();
    Iterator<Element> it;

    if (sequence == null) {
      it = Collections.<Element>emptyList().iterator();
    } else {
      it = sequence.getElements();
    }

    return it;
  }