Examples of JSObjectLiteral


Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    return options;
  }

  public JSObjectLiteral visitAttributePropertyInfo(
      MAttributePropertyInfo<T, C> info) {
    JSObjectLiteral options = this.codeModel.object();
    createPropertyInfoOptions(info, options);
    createTypedOptions(info, options);
    options.append("attributeName",
        module.createAttributeNameExpression(info.getAttributeName()));
    options.append("type", this.codeModel.string("attribute"));
    return options;
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    return options;
  }

  public JSObjectLiteral visitAnyAttributePropertyInfo(
      MAnyAttributePropertyInfo<T, C> info) {
    JSObjectLiteral options = this.codeModel.object();
    createPropertyInfoOptions(info, options);
    options.append("type", this.codeModel.string("anyAttribute"));
    return options;
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    options.append("type", this.codeModel.string("anyAttribute"));
    return options;
  }

  public JSObjectLiteral visitValuePropertyInfo(MValuePropertyInfo<T, C> info) {
    JSObjectLiteral options = this.codeModel.object();
    createPropertyInfoOptions(info, options);
    createTypedOptions(info, options);
    options.append("type", this.codeModel.string("value"));
    return options;
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    return options;
  }

  public JSObjectLiteral visitElementRefPropertyInfo(
      MElementRefPropertyInfo<T, C> info) {
    JSObjectLiteral options = this.codeModel.object();
    createPropertyInfoOptions(info, options);
    createMixableOptions(info, options);
    createWrappableOptions(info, options);
    createWildcardOptions(info, options);
    createElementTypeInfoOptions(info, options);
    options.append("type", this.codeModel.string("elementRef"));
    return options;
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    return options;
  }

  public JSObjectLiteral visitElementRefsPropertyInfo(
      MElementRefsPropertyInfo<T, C> info) {
    JSObjectLiteral options = this.codeModel.object();
    createPropertyInfoOptions(info, options);
    createMixableOptions(info, options);
    createWrappableOptions(info, options);
    createWildcardOptions(info, options);
    createElementTypeInfosOptions(info, options);
    options.append("type", this.codeModel.string("elementRefs"));
    return options;
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    return classInfoMappings;
  }

  public JSObjectLiteral compileClassInfo(MClassInfo<T, C> classInfo) {
    final JsonixModule module = getModule(classInfo);
    final JSObjectLiteral classInfoMapping = this.codeModel.object();
    classInfoMapping.append("type", this.codeModel.string("classInfo"));
    classInfoMapping.append("localName",
        this.codeModel.string(classInfo.getLocalName()));

    final MClassInfo<T, C> baseTypeInfo = classInfo.getBaseTypeInfo();
    if (baseTypeInfo != null) {
      classInfoMapping.append("baseTypeInfo",
          getTypeInfoDeclaration(baseTypeInfo));
    }
    classInfoMapping.append("propertyInfos",
        compilePropertyInfos(classInfo));
    module.registerTypeInfo(classInfoMapping);
    return classInfoMapping;
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    JsonixModule module = getModule(elementInfo);
    MTypeInfo<T, C> typeInfo = elementInfo.getTypeInfo();
    MTypeInfo<T, C> scope = elementInfo.getScope();
    QName substitutionHead = elementInfo.getSubstitutionHead();

    final JSObjectLiteral value = this.codeModel.object();
    module.registerElementInfo(value);
    JSAssignmentExpression typeInfoDeclaration = getTypeInfoDeclaration(typeInfo);
    QName elementName = elementInfo.getElementName();
    value.append("elementName",
        module.createElementNameExpression(elementName));
    // TODO
    if (typeInfoDeclaration != null) {
      value.append("typeInfo", typeInfoDeclaration);
    }

    if (scope != null) {
      value.append("scope", getTypeInfoDeclaration(scope));
    }
    if (substitutionHead != null) {
      value.append("substitutionHead",
          module.createElementNameExpression(substitutionHead));
    }
    return value;
  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    this.outputPackageName = packageMapping.getOutputPackageName();
    this.spaceName = packageMapping.getSpaceName();

    this.directory = packageMapping.getDirectory();
    this.fileName = packageMapping.getFileName();
    final JSObjectLiteral spaceBody = codeModel.object();

    spaceBody.append("name", codeModel.string(this.spaceName));

    this.defaultElementNamespaceURI = packageMapping
        .getDefaultElementNamespaceURI();
    if (this.defaultElementNamespaceURI != null) {
      spaceBody.append("defaultElementNamespaceURI",
          codeModel.string(this.defaultElementNamespaceURI));
    }

    this.defaultAttributeNamespaceURI = packageMapping
        .getDefaultAttributeNamespaceURI();
    if (this.defaultAttributeNamespaceURI != null) {
      spaceBody.append("defaultAttributeNamespaceURI",
          codeModel.string(this.defaultAttributeNamespaceURI));
    }

    this.space = this.declarations.var(this.spaceName, spaceBody);

    this.exportDeclarations
        ._if(this.codeModel.globalVariable("require").typeof()
            .eeq(codeModel.string("function")))
        ._then()
        .block()
        .expression(
            codeModel.globalVariable("module").p("exports")
                .p(this.spaceName)
                .assign(this.space.getVariable()));

    typeInfos = codeModel.array();
    spaceBody.append("typeInfos", typeInfos);

    elementInfos = codeModel.array();
    spaceBody.append("elementInfos", elementInfos);

  }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

    if (ObjectUtils.equals(defaultNamespaceURI, namespaceURI)) {
      return this.codeModel.string(name.getLocalPart());
    } else {

      final JSObjectLiteral nameExpression = this.codeModel.object();

      nameExpression.append("localPart",
          this.codeModel.string(name.getLocalPart()));

      if (!StringUtils.isEmpty(namespaceURI)) {
        nameExpression.append("namespaceURI",
            this.codeModel.string(namespaceURI));

      }
      return nameExpression;
    }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.expression.JSObjectLiteral

  public JSAssignmentExpression visitClassInfo(MClassInfo<T, C> info) {
    return createTypeInfoDeclaration(info);
  }

  public JSAssignmentExpression visitList(MList<T, C> info) {
    final JSObjectLiteral list = this.codeModel.object();
    list.append("type", this.codeModel.string("list"));
    list.append("typeInfo",
        info.getItemTypeInfo().acceptTypeInfoVisitor(this));
    return list;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.