Beispiel #1
0
  public CReferencePropertyInfo createReferenceProperty(
      String defaultName,
      boolean forConstant,
      XSComponent source,
      RawTypeSet types,
      boolean isMixed,
      boolean dummy,
      boolean content,
      boolean isMixedExtended) {

    if (types
        == null) { // this is a special case where we need to generate content because potential
      // subtypes would need to be able to override what's store inside
      content = true;
    } else {
      if (!types.refs.isEmpty())
        // if this property is empty, don't acknowleedge the customization
        // this allows pointless property customization to be reported as an error
        markAsAcknowledged();
    }
    constantPropertyErrorCheck();

    String name = getPropertyName(forConstant);
    if (name == null) name = defaultName;

    CReferencePropertyInfo prop =
        wrapUp(
            new CReferencePropertyInfo(
                name,
                (types == null) ? true : types.getCollectionMode().isRepeated() || isMixed,
                (types == null) ? false : types.isRequired(),
                isMixed,
                source,
                getCustomizations(source),
                source.getLocator(),
                dummy,
                content,
                isMixedExtended),
            source);
    if (types != null) {
      types.addTo(prop);
    }

    BIInlineBinaryData.handle(source, prop);
    return prop;
  }
Beispiel #2
0
  public CValuePropertyInfo createValueProperty(
      String defaultName, boolean forConstant, XSComponent source, TypeUse tu, QName typeName) {

    markAsAcknowledged();
    constantPropertyErrorCheck();

    String name = getPropertyName(forConstant);
    if (name == null) {
      name = defaultName;
      if (tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode())
        name = JJavaName.getPluralForm(name);
    }

    CValuePropertyInfo prop =
        wrapUp(
            new CValuePropertyInfo(
                name, source, getCustomizations(source), source.getLocator(), tu, typeName),
            source);
    BIInlineBinaryData.handle(source, prop);
    return prop;
  }