001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS <http://nuxeo.com> and others
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Jean-Marc Orliaguet, Chalmers
011 *
012 * $Id$
013 */
014
015package org.nuxeo.theme.models;
016
017import java.util.ArrayList;
018import java.util.List;
019
020import org.nuxeo.common.xmap.annotation.XNode;
021import org.nuxeo.common.xmap.annotation.XNodeList;
022import org.nuxeo.common.xmap.annotation.XObject;
023import org.nuxeo.theme.types.Type;
024import org.nuxeo.theme.types.TypeFamily;
025
026@XObject("model")
027public final class ModelType implements Type {
028
029    @XNode("@name")
030    public String name;
031
032    @XNode("class")
033    public String className;
034
035    @XNodeList(value = "contains", type = ArrayList.class, componentType = String.class)
036    public List<String> allowedTypes;
037
038    public ModelType() {
039    }
040
041    public ModelType(String name, String className, List<String> allowedTypes) {
042        this.name = name;
043        this.className = className;
044        this.allowedTypes = allowedTypes;
045    }
046
047    public String getTypeName() {
048        return name;
049    }
050
051    public TypeFamily getTypeFamily() {
052        return TypeFamily.MODEL;
053    }
054
055    public String getClassName() {
056        return className;
057    }
058
059    public void setClassName(String className) {
060        this.className = className;
061    }
062
063    public List<String> getAllowedTypes() {
064        return allowedTypes;
065    }
066
067    public void setAllowedTypes(List<String> allowedTypes) {
068        this.allowedTypes = allowedTypes;
069    }
070
071}