Esempio n. 1
0
  protected QName createCollectionQName(TypeClassInfo info, AegisType type) {
    String ns;

    if (type.isComplex()) {
      ns = type.getSchemaType().getNamespaceURI();
    } else {
      ns = tm.getMappingIdentifierURI();
    }
    if (WSDLConstants.NS_SCHEMA_XSD.equals(ns)) {
      ns = HTTP_CXF_APACHE_ORG_ARRAYS;
    }

    String first = type.getSchemaType().getLocalPart().substring(0, 1);
    String last = type.getSchemaType().getLocalPart().substring(1);
    String localName = "ArrayOf" + first.toUpperCase() + last;
    if (info.nonDefaultAttributes()) {
      localName += "-";
      if (info.getMinOccurs() >= 0) {
        localName += info.getMinOccurs();
      }
      localName += "-";
      if (info.getMaxOccurs() >= 0) {
        localName += info.getMaxOccurs();
      }
      if (info.isFlat()) {
        localName += "Flat";
      }
    }

    return new QName(ns, localName);
  }
Esempio n. 2
0
  protected AegisType createCollectionTypeFromGeneric(TypeClassInfo info) {
    AegisType component = getOrCreateGenericType(info);

    CollectionType type = new CollectionType(component);
    type.setTypeMapping(getTypeMapping());

    QName name = info.getTypeName();
    if (name == null) {
      name = createCollectionQName(info, component);
    }

    type.setSchemaType(name);

    type.setTypeClass(info.getType());

    if (info.getMinOccurs() != -1) {
      type.setMinOccurs(info.getMinOccurs());
    }
    if (info.getMaxOccurs() != -1) {
      type.setMaxOccurs(info.getMaxOccurs());
    }

    type.setFlat(info.isFlat());

    return type;
  }
  protected Type createArrayType(TypeClassInfo info) {
    ArrayType type = new ArrayType();
    type.setTypeMapping(getTypeMapping());
    type.setTypeClass(info.getTypeClass());
    type.setSchemaType(createCollectionQName(info, type.getComponentType()));

    if (info.getMinOccurs() != -1) type.setMinOccurs(info.getMinOccurs());
    if (info.getMaxOccurs() != -1) type.setMaxOccurs(info.getMaxOccurs());

    type.setFlat(info.isFlat());

    return type;
  }
Esempio n. 4
0
  protected AegisType createArrayType(TypeClassInfo info) {
    ArrayType type = new ArrayType();
    type.setTypeMapping(getTypeMapping());
    type.setTypeClass(info.getType());
    type.setSchemaType(createCollectionQName(info, type.getComponentType()));

    if (info.getMinOccurs() != -1) {
      type.setMinOccurs(info.getMinOccurs());
    } else {
      type.setMinOccurs(typeConfiguration.getDefaultMinOccurs());
    }

    if (info.getMaxOccurs() != -1) {
      type.setMaxOccurs(info.getMaxOccurs());
    }

    type.setFlat(info.isFlat());

    return type;
  }