001/* 002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Nuxeo - initial API and implementation 016 * 017 * $Id$ 018 */ 019 020package org.nuxeo.ecm.platform.content.template.service; 021 022import java.util.ArrayList; 023import java.util.HashMap; 024import java.util.List; 025import java.util.Map; 026 027import org.nuxeo.common.xmap.annotation.XNode; 028import org.nuxeo.common.xmap.annotation.XNodeList; 029import org.nuxeo.common.xmap.annotation.XNodeMap; 030import org.nuxeo.common.xmap.annotation.XObject; 031 032/** 033 * Factory binding descriptor. Immutable. 034 */ 035@XObject(value = "factoryBinding") 036public class FactoryBindingDescriptor { 037 038 @XNode("@name") 039 private String name; 040 041 @XNode("@factoryName") 042 private String factoryName; 043 044 @XNode("@targetType") 045 private String targetType; 046 047 @XNode("@targetFacet") 048 private String targetFacet; 049 050 @XNode("@append") 051 private Boolean append = false; 052 053 @XNodeMap(value = "option", key = "@name", type = HashMap.class, componentType = String.class) 054 private Map<String, String> options; 055 056 @XNodeList(value = "template/templateItem", type = ArrayList.class, componentType = TemplateItemDescriptor.class) 057 private List<TemplateItemDescriptor> template; 058 059 // Declared as ArrayList to be serializable. 060 @XNodeList(value = "acl/ace", type = ArrayList.class, componentType = ACEDescriptor.class) 061 private List<ACEDescriptor> rootAcl; 062 063 public String getFactoryName() { 064 return factoryName; 065 } 066 067 public String getName() { 068 return name; 069 } 070 071 public Map<String, String> getOptions() { 072 return options; 073 } 074 075 public String getTargetType() { 076 return targetType; 077 } 078 079 public String getTargetFacet() { 080 return targetFacet; 081 } 082 083 public List<TemplateItemDescriptor> getTemplate() { 084 return template; 085 } 086 087 public List<ACEDescriptor> getRootAcl() { 088 return rootAcl; 089 } 090 091 public Boolean getAppend() { 092 return append; 093 } 094 095 public void setAppend(Boolean append) { 096 this.append = append; 097 } 098}