Example #1
0
 /**
  * If the given component has {@link BIInlineBinaryData} customization, reflect that to the
  * specified property.
  */
 public static void handle(XSComponent source, CPropertyInfo prop) {
   BIInlineBinaryData inline =
       Ring.get(BGMBuilder.class).getBindInfo(source).get(BIInlineBinaryData.class);
   if (inline != null) {
     prop.inlineBinaryData = true;
     inline.markAsAcknowledged();
   }
 }
Example #2
0
  /**
   * @param defaultName If the name is not customized, this name will be used as the default. Note
   *     that the name conversion <b>MUST</b> be applied before this method is called if necessary.
   * @param source Source schema component from which a field is built.
   */
  public CElementPropertyInfo createElementProperty(
      String defaultName, boolean forConstant, XSParticle source, RawTypeSet types) {

    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;

    CElementPropertyInfo prop =
        wrapUp(
            new CElementPropertyInfo(
                name,
                types.getCollectionMode(),
                types.id(),
                types.getExpectedMimeType(),
                source,
                getCustomizations(source),
                source.getLocator(),
                types.isRequired()),
            source);

    types.addTo(prop);

    BIInlineBinaryData.handle(source.getTerm(), prop);
    return prop;
  }
Example #3
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;
  }
Example #4
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;
  }