001/* 002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Antoine Taillefer <[email protected]> 018 */ 019package org.nuxeo.drive.service.impl; 020 021import java.io.Serializable; 022import java.util.ArrayList; 023import java.util.List; 024 025import org.nuxeo.common.xmap.annotation.XNode; 026import org.nuxeo.common.xmap.annotation.XNodeList; 027import org.nuxeo.common.xmap.annotation.XObject; 028import org.nuxeo.drive.service.FileSystemItemAdapterService; 029 030/** 031 * XMap descriptor for the {@code activeFileSystemItemFactories} contributions to the 032 * {@code activeFileSystemItemFactories} extension point of the {@link FileSystemItemAdapterService}. 033 * 034 * @author Antoine Taillefer 035 */ 036@XObject("activeFileSystemItemFactories") 037public class ActiveFileSystemItemFactoriesDescriptor implements Serializable { 038 039 private static final long serialVersionUID = 1L; 040 041 @XNode("@merge") 042 protected boolean merge = false; 043 044 @XNodeList(value = "factories/factory", type = ArrayList.class, componentType = ActiveFileSystemItemFactoryDescriptor.class) 045 protected List<ActiveFileSystemItemFactoryDescriptor> factories; // NOSONAR, serialization is actually performed by 046 // SerializationUtils#clone during merge/clone 047 048 public boolean isMerge() { 049 return merge; 050 } 051 052 public void setMerge(boolean merge) { 053 this.merge = merge; 054 } 055 056 public List<ActiveFileSystemItemFactoryDescriptor> getFactories() { 057 return factories; 058 } 059 060 public void setFactories(List<ActiveFileSystemItemFactoryDescriptor> factories) { 061 this.factories = factories; 062 } 063 064 @Override 065 public String toString() { 066 StringBuilder sb = new StringBuilder("<merge = "); 067 sb.append(merge); 068 sb.append(", ["); 069 for (ActiveFileSystemItemFactoryDescriptor factory : factories) { 070 sb.append(factory); 071 sb.append(", "); 072 } 073 sb.append("]>"); 074 return sb.toString(); 075 } 076 077}