Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XStream.addImplicitCollection not supported by XStreamMarshaller [SWS-361] #513

Closed
gregturn opened this issue May 22, 2008 · 2 comments
Closed
Assignees
Milestone

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented May 22, 2008

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 23, 2008

David DUTOUR commented

Code to add to support ImplicitCollection in XStreamMarshaller

------ CODE -----
/**

  • Adds an implicit Collection for the given type.

  • @param name alias to be used for the type

  • @param type the type to be Collection
    */
    public void addImplicitCollection(String name, Class type) {
    getXStream().addImplicitCollection(type, name);
    }

    /**

    • Set a implicit colletion/type map, consisting of string implicit collection mapped to <code>Class</code>
    • instances (or Strings to be converted to <code>Class</code> instances).
    • @see org.springframework.beans.propertyeditors.ClassEditor
      */
      public void setImplicitCollection(Map implicitCollection) {
      for (Iterator iterator = implicitCollection.entrySet().iterator(); iterator.hasNext();) {
      Map.Entry entry = (Map.Entry) iterator.next();
      Class type;
      if (entry.getValue() instanceof Class) {
      type = (Class) entry.getValue();
      }
      else {
      ClassEditor editor = new ClassEditor();
      editor.setAsText(String.valueOf(entry.getValue()));
      type = (Class) editor.getValue();
      }
      addImplicitCollection((String) entry.getKey(), type);
      }
      }

---- END CODE -----

@gregturn
Copy link
Member Author

@gregturn gregturn commented Jul 21, 2008

Arjen Poutsma commented

Closing issues in 1.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.