Package org.jboss.errai.marshalling.rebind.api

Examples of org.jboss.errai.marshalling.rebind.api.MappingStrategy


  }

  public void addMarshaller(final MetaClass type) {
    if (!mappingContext.isRendered(type)) {
      mappingContext.markRendered(type);
      final MappingStrategy strategy = MappingStrategyFactory
          .createStrategy(target == MarshallerOutputTarget.GWT, mappingContext, type);
      if (strategy == null) {
        throw new RuntimeException("no available marshaller for class: " + type.getFullyQualifiedName());
      }

      final String varName = getVarName(type);

      final Statement marshaller = strategy.getMapper().getMarshaller();
      classStructureBuilder.privateField(varName, marshaller.getType()).finish();

      if (type.isAnnotationPresent(AlwaysQualify.class)) {
        constructor.append(loadVariable(varName).assignValue(
            Stmt.newObject(QualifyingMarshallerWrapper.class, marshaller, type)));
View Full Code Here


    constructor.finish();
  }

  private Statement marshal(MetaClass cls) {
    MappingStrategy strategy = MappingStrategyFactory.createStrategy(target == MarshallerOuputTarget.GWT, mappingContext, cls);
    if (strategy == null) {
      throw new RuntimeException("no available marshaller for class: " + cls.getName());
    }
    return strategy.getMapper().getMarshaller();
  }
View Full Code Here

    constructor.finish();
  }

  private Statement marshal(MetaClass cls) {
    MappingStrategy strategy = MappingStrategyFactory.createStrategy(target == MarshallerOuputTarget.GWT, mappingContext, cls);
    if (strategy == null) {
      throw new RuntimeException("no available marshaller for class: " + cls.getName());
    }
    return strategy.getMapper().getMarshaller();
  }
View Full Code Here

    constructor.finish();
  }

  private Statement marshal(MetaClass cls) {
    final MappingStrategy strategy = MappingStrategyFactory
            .createStrategy(target == MarshallerOuputTarget.GWT, mappingContext, cls);
    if (strategy == null) {
      throw new RuntimeException("no available marshaller for class: " + cls.getName());
    }
    return strategy.getMapper().getMarshaller();
  }
View Full Code Here

    constructor.finish();
  }

  private Statement marshal(MetaClass cls) {
    final MappingStrategy strategy = MappingStrategyFactory
            .createStrategy(target == MarshallerOuputTarget.GWT, mappingContext, cls);
    if (strategy == null) {
      throw new RuntimeException("no available marshaller for class: " + cls.getName());
    }
    return strategy.getMapper().getMarshaller();
  }
View Full Code Here

    final PrintWriter printWriter = context.tryCreate(logger, packageName, className);

    if (printWriter != null) {
      MarshallerOutputTarget target = MarshallerOutputTarget.GWT;
      final MappingStrategy strategy =
          MappingStrategyFactory.createStrategy(true, GeneratorMappingContextFactory.getFor(context, target), type);

      String gen = null;
      if (type.isArray()) {
        BuildMetaClass marshallerClass =
            MarshallerGeneratorFactory.generateArrayMarshaller(type, packageName + "." + className, true);
        gen = marshallerClass.toJavaString();
      }
      else {
        final ClassStructureBuilder<?> marshaller =
            strategy.getMapper().getMarshaller(packageName + "." + className);
        gen = marshaller.toJavaString();
      }
      printWriter.append(gen);

      final File tmpFile =
View Full Code Here

  }

  public void addMarshaller(final MetaClass type) {
    if (!mappingContext.isRendered(type)) {
      mappingContext.markRendered(type);
      final MappingStrategy strategy = MappingStrategyFactory
          .createStrategy(target == MarshallerOutputTarget.GWT, mappingContext, type);
      if (strategy == null) {
        throw new RuntimeException("no available marshaller for class: " + type.getFullyQualifiedName());
      }

      final String varName = getVarName(type);

      final Statement marshaller = strategy.getMapper().getMarshaller();
      classStructureBuilder.privateField(varName, marshaller.getType()).finish();

      if (type.isAnnotationPresent(AlwaysQualify.class)) {
        constructor.append(loadVariable(varName).assignValue(
            Stmt.newObject(QualifyingMarshallerWrapper.class, marshaller, type)));
View Full Code Here

  }

  public void addMarshaller(final MetaClass type) {
    if (!mappingContext.isRendered(type)) {
      mappingContext.markRendered(type);
      final MappingStrategy strategy = MappingStrategyFactory
          .createStrategy(target == MarshallerOutputTarget.GWT, mappingContext, type);
      if (strategy == null) {
        throw new RuntimeException("no available marshaller for class: " + type.getFullyQualifiedName());
      }

      final String varName = getVarName(type);

      final Statement marshaller = strategy.getMapper().getMarshaller();
      classStructureBuilder.privateField(varName, marshaller.getType()).finish();

      if (type.isAnnotationPresent(AlwaysQualify.class)) {
        constructor.append(loadVariable(varName).assignValue(
            Stmt.newObject(QualifyingMarshallerWrapper.class, marshaller)));
View Full Code Here

  }

  public void addMarshaller(final MetaClass type) {
    if (!mappingContext.isRendered(type)) {
      mappingContext.markRendered(type);
      final MappingStrategy strategy = MappingStrategyFactory
          .createStrategy(target == MarshallerOutputTarget.GWT, mappingContext, type);
      if (strategy == null) {
        throw new RuntimeException("no available marshaller for class: " + type.getFullyQualifiedName());
      }

      final String varName = getVarName(type);

      final Statement marshaller = strategy.getMapper().getMarshaller();
      classStructureBuilder.privateField(varName, marshaller.getType()).finish();

      if (type.isAnnotationPresent(AlwaysQualify.class)) {
        constructor.append(loadVariable(varName).assignValue(
            Stmt.newObject(QualifyingMarshallerWrapper.class, marshaller, type)));
View Full Code Here

    constructor.finish();
  }

  private Statement marshal(final MetaClass cls) {
    final MappingStrategy strategy = MappingStrategyFactory
        .createStrategy(target == MarshallerOutputTarget.GWT, mappingContext, cls);
    if (strategy == null) {
      throw new RuntimeException("no available marshaller for class: " + cls.getFullyQualifiedName());
    }
    return strategy.getMapper().getMarshaller();
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.marshalling.rebind.api.MappingStrategy

Copyright © 2018 www.massapicom. 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.