Package com.tll.server.marshal

Examples of com.tll.server.marshal.MarshalOptions


                // shouldn't happen
                throw new IllegalStateException("Unable to instantiate the list handler: " + e.getMessage(), e);
              }

              // transform to marshaling list handler
              MarshalOptions mo;
              try {
                mo = context.getMarshalOptionsResolver().resolve(search.getEntityType());
              }
              catch(final IllegalArgumentException e) {
                mo = MarshalOptions.NO_REFERENCES;
View Full Code Here


   * @param entity
   * @return new {@link Model} instance
   * @throws RuntimeException upon marshaling related error
   */
  protected Model marshal(IEntityType entityType, IEntity entity) throws RuntimeException {
    MarshalOptions mo;
    try {
      mo = context.getMarshalOptionsResolver().resolve(entityType);
    }
    catch(final IllegalArgumentException e) {
      // default fallback
View Full Code Here

        if(list == null || list.size() < 1) {
          payload.getStatus().addMsg("Unable to obtain " + et.descriptor() + " entities for aux data.",
              MsgLevel.ERROR, MsgAttr.STATUS.flag);
        }
        else {
          final MarshalOptions mo = getMarshalOptions(context, et, MarshalOptions.NO_REFERENCES);
          final List<Model> elist = new ArrayList<Model>(list.size());
          for(final IEntity e : list) {
            final Model group = context.getMarshaler().marshalEntity(e, mo);
            elist.add(group);
          }
          if(entityMap == null) {
            entityMap = new HashMap<IEntityType, List<Model>>();
          }
          entityMap.put(et, elist);
        }
      }
    }

    // entity prototypes
    etitr = auxDataRequest.getEntityPrototypeRequests();
    while(etitr != null && etitr.hasNext()) {
      final IEntityType et = etitr.next();
      final IEntity e =
        context.getEntityAssembler().assembleEntity(
            (Class<IEntity>) context.getEntityTypeResolver().resolveEntityClass(et), null, false);
      final MarshalOptions mo = getMarshalOptions(context, et, MarshalOptions.NO_REFERENCES);
      final Model model = context.getMarshaler().marshalEntity(e, mo);
      if(entityPrototypes == null) {
        entityPrototypes = new HashSet<Model>();
      }
      entityPrototypes.add(model);
View Full Code Here

    }

    final Marshaler entityMarshaller = mec.getMarshaler();
    assert entityMarshaller != null : "No marshaler present";

    final Model user = entityMarshaller.marshalEntity(sac.getUser(), new MarshalOptions(true, 1, null));
    // NOTE: we want a distinct copy of the account here so we separately
    // marshall the account as opposed to grabbing the nested account from the
    // just marshaled user
    final Model account = entityMarshaller.marshalEntity(sac.getUser().getAccount(), MarshalOptions.NON_RELATIONAL);
View Full Code Here

      // set the quasi-id
      ai.setId(ais.getAccountId() + '|' + ais.getInterfaceId());

      final Marshaler marshaler = context.getMarshaler();
      final MarshalOptions moptions = context.getMarshalOptionsResolver().resolve(SmbizEntityType.ACCOUNT_INTERFACE);
      final Model m = marshaler.marshalEntity(ai, moptions);
      payload.setModel(m);
    }
    else
      throw new IllegalArgumentException("Unhandled account interface data search type.");
View Full Code Here

    AccountInterface ai = isvc.loadAccountInterface(accountId, intfId);

    ai = marshaler.marshalModel(model, ai);
    isvc.setAccountInterface(ai);

    final MarshalOptions moptions = context.getMarshalOptionsResolver().resolve(SmbizEntityType.ACCOUNT_INTERFACE);
    final Model m = marshaler.marshalEntity(ai, moptions);
    payload.setModel(m);
  }
View Full Code Here

TOP

Related Classes of com.tll.server.marshal.MarshalOptions

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.