Ejemplo n.º 1
0
  /** Fill-in the contents of each classes. */
  private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for (XSSchema s : Ring.get(XSSchemaSet.class).getSchemas()) {
      BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

      if (sb != null && !sb.map) {
        sb.markAsAcknowledged();
        continue; // no mapping for this package
      }

      getClassSelector()
          .pushClassScope(
              new CClassInfoParent.Package(getClassSelector().getPackage(s.getTargetNamespace())));

      checkMultipleSchemaBindings(s);
      processPackageJavadoc(s);
      populate(s.getAttGroupDecls(), s);
      populate(s.getAttributeDecls(), s);
      populate(s.getElementDecls(), s);
      populate(s.getModelGroupDecls(), s);

      // fill in typeUses
      for (XSType t : s.getTypes().values()) {
        stb.refererStack.push(t);
        model.typeUses().put(getName(t), cs.bindToType(t, s));
        stb.refererStack.pop();
      }

      getClassSelector().popClassScope();
    }
  }
Ejemplo n.º 2
0
 /**
  * Calls {@link ClassSelector} for each item in the iterator to populate class items if there is
  * any.
  */
 private void populate(Map<String, ? extends XSComponent> col, XSSchema schema) {
   ClassSelector cs = getClassSelector();
   for (XSComponent sc : col.values()) cs.bindToType(sc, schema);
 }