001/* 002 * (C) Copyright 2006-2007 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 * Nuxeo - initial API and implementation 018 * 019 * $Id$ 020 */ 021 022package org.nuxeo.ecm.platform.content.template.service; 023 024import java.util.ArrayList; 025import java.util.HashMap; 026import java.util.List; 027import java.util.Map; 028 029import org.nuxeo.common.xmap.annotation.XNode; 030import org.nuxeo.common.xmap.annotation.XNodeList; 031import org.nuxeo.common.xmap.annotation.XNodeMap; 032import org.nuxeo.common.xmap.annotation.XObject; 033 034/** 035 * Factory binding descriptor. Immutable. 036 */ 037@XObject(value = "factoryBinding") 038public class FactoryBindingDescriptor { 039 040 @XNode("@name") 041 private String name; 042 043 @XNode("@factoryName") 044 private String factoryName; 045 046 @XNode("@targetType") 047 private String targetType; 048 049 @XNode("@targetFacet") 050 private String targetFacet; 051 052 @XNode("@append") 053 private Boolean append = false; 054 055 @XNodeMap(value = "option", key = "@name", type = HashMap.class, componentType = String.class) 056 private Map<String, String> options; 057 058 @XNodeList(value = "template/templateItem", type = ArrayList.class, componentType = TemplateItemDescriptor.class) 059 private List<TemplateItemDescriptor> template; 060 061 // Declared as ArrayList to be serializable. 062 @XNodeList(value = "acl/ace", type = ArrayList.class, componentType = ACEDescriptor.class) 063 private List<ACEDescriptor> rootAcl; 064 065 public String getFactoryName() { 066 return factoryName; 067 } 068 069 public String getName() { 070 return name; 071 } 072 073 public Map<String, String> getOptions() { 074 return options; 075 } 076 077 public String getTargetType() { 078 return targetType; 079 } 080 081 public String getTargetFacet() { 082 return targetFacet; 083 } 084 085 public List<TemplateItemDescriptor> getTemplate() { 086 return template; 087 } 088 089 public List<ACEDescriptor> getRootAcl() { 090 return rootAcl; 091 } 092 093 public Boolean getAppend() { 094 return append; 095 } 096 097 public void setAppend(Boolean append) { 098 this.append = append; 099 } 100}