ServiceXmlList.java :  » REST » alc-rest » org » allcolor » services » servlet » Java Open Source

Java Open Source » REST » alc rest 
alc rest » org » allcolor » services » servlet » ServiceXmlList.java
package org.allcolor.services.servlet;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@XStreamAlias("services")
public class ServiceXmlList implements Serializable, Cloneable {
  /**
   * 
   */
  private static final long serialVersionUID = 3578597241907077289L;
  @XStreamImplicit(itemFieldName = "service")
  private List<ServiceXml> list = new ArrayList<ServiceXml>(0);

  @XStreamAsAttribute
  public final String xmlns = "http://www.allcolor.org/xmlns/service";

  public List<ServiceXml> getList() {
    return this.list;
  }

  public void setList(final List<ServiceXml> list) {
    this.list = list;
  }

  public void setServicesProperties(final Properties servicesProperties) {
    try {
      if (this.list == null) {
        this.list = new ArrayList<ServiceXml>(0);
      }
      for (final Map.Entry<Object, Object> entry : servicesProperties
          .entrySet()) {
        try {
          final ServiceXml sxml = new ServiceXml((String) entry
              .getKey(), (String) entry.getValue(),
              (String) entry.getKey());
          this.list.add(sxml);
        } catch (final Exception ignore) {
        }
      }
    } catch (final Exception e) {
      //
    }
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.