Package org.sylfra.idea.plugins.revu.model

Examples of org.sylfra.idea.plugins.revu.model.DataReferential


    return DataReferential.class.equals(type);
  }

  public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)
  {
    DataReferential referential = (DataReferential) source;

    // Priorities
    writer.startNode("priorities");
    SortedSet<IssuePriority> priorities = new TreeSet<IssuePriority>(
      referential.getIssuePrioritiesByName(false).values());
    for (IssuePriority priority : priorities)
    {
      writer.startNode("priority");
      context.convertAnother(priority);
      writer.endNode();
    }
    writer.endNode();

    // Tags
    writer.startNode("tags");
    SortedSet<IssueTag> tags = new TreeSet<IssueTag>(
      referential.getIssueTagsByName(false).values());
    for (IssueTag tag : tags)
    {
      writer.startNode("tag");
      context.convertAnother(tag);
      writer.endNode();
    }
    writer.endNode();

    // Users
    writer.startNode("users");
    SortedSet<User> users = new TreeSet<User>(referential.getUsersByLogin(false).values());
    for (User user : users)
    {
      writer.startNode("user");
      context.convertAnother(user);
      writer.endNode();
View Full Code Here


    writer.endNode();
  }

  public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
  {
    DataReferential referential = new DataReferential(getReview(context));

    while (reader.hasMoreChildren())
    {
      reader.moveDown();
      if ("priorities".equals(reader.getNodeName()))
      {
        List<IssuePriority> priorities = new ArrayList<IssuePriority>();
        while (reader.hasMoreChildren())
        {
          reader.moveDown();
          priorities.add((IssuePriority) context.convertAnother(priorities, IssuePriority.class));
          reader.moveUp();
        }
        referential.setIssuePriorities(priorities);
      }
      else if ("tags".equals(reader.getNodeName()))
      {
        List<IssueTag> tags = new ArrayList<IssueTag>();
        while (reader.hasMoreChildren())
        {
          reader.moveDown();
          tags.add((IssueTag) context.convertAnother(tags, IssueTag.class));
          reader.moveUp();
        }
        referential.setIssueTags(tags);
      }
      else if ("users".equals(reader.getNodeName()))
      {
        List<User> users = new ArrayList<User>();
        while (reader.hasMoreChildren())
        {
          reader.moveDown();
          users.add((User) context.convertAnother(users, User.class));
          reader.moveUp();
        }
        referential.setUsers(users);
      }
      reader.moveUp();
    }

    return referential;
View Full Code Here

    return DataReferential.class.equals(type);
  }

  public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)
  {
    DataReferential referential = (DataReferential) source;

    // Priorities
    writer.startNode("priorities");
    SortedSet<IssuePriority> priorities = new TreeSet<IssuePriority>(
      referential.getIssuePrioritiesByName(false).values());
    for (IssuePriority priority : priorities)
    {
      writer.startNode("priority");
      context.convertAnother(priority);
      writer.endNode();
    }
    writer.endNode();

    // Tags
    writer.startNode("tags");
    SortedSet<IssueTag> tags = new TreeSet<IssueTag>(
      referential.getIssueTagsByName(false).values());
    for (IssueTag tag : tags)
    {
      writer.startNode("tag");
      context.convertAnother(tag);
      writer.endNode();
    }
    writer.endNode();

    // Users
    writer.startNode("users");
    SortedSet<User> users = new TreeSet<User>(referential.getUsersByLogin(false).values());
    for (User user : users)
    {
      writer.startNode("user");
      context.convertAnother(user);
      writer.endNode();
View Full Code Here

    writer.endNode();
  }

  public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
  {
    DataReferential referential = new DataReferential(getReview(context));

    while (reader.hasMoreChildren())
    {
      reader.moveDown();
      if ("priorities".equals(reader.getNodeName()))
      {
        List<IssuePriority> priorities = new ArrayList<IssuePriority>();
        while (reader.hasMoreChildren())
        {
          reader.moveDown();
          priorities.add((IssuePriority) context.convertAnother(priorities, IssuePriority.class));
          reader.moveUp();
        }
        referential.setIssuePriorities(priorities);
      }
      else if ("tags".equals(reader.getNodeName()))
      {
        List<IssueTag> tags = new ArrayList<IssueTag>();
        while (reader.hasMoreChildren())
        {
          reader.moveDown();
          tags.add((IssueTag) context.convertAnother(tags, IssueTag.class));
          reader.moveUp();
        }
        referential.setIssueTags(tags);
      }
      else if ("users".equals(reader.getNodeName()))
      {
        List<User> users = new ArrayList<User>();
        while (reader.hasMoreChildren())
        {
          reader.moveDown();
          users.add((User) context.convertAnother(users, User.class));
          reader.moveUp();
        }
        referential.setUsers(users);
      }
      reader.moveUp();
    }

    return referential;
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.model.DataReferential

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.