001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (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 *     Nuxeo - initial API and implementation
011 *
012 * $Id$
013 */
014
015package org.nuxeo.ecm.core.schema;
016
017import java.io.File;
018
019import org.nuxeo.common.xmap.annotation.XNode;
020import org.nuxeo.common.xmap.annotation.XObject;
021import org.nuxeo.runtime.model.RuntimeContext;
022
023/**
024 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
025 */
026@XObject("schema")
027public class SchemaBindingDescriptor {
028
029    @XNode("@name")
030    public String name;
031
032    @XNode("@src")
033    public String src;
034
035    public File file;
036
037    @XNode("@prefix")
038    public String prefix = "";
039
040    @XNode("@override")
041    public boolean override = false;
042
043    @XNode("@xsdRootElement")
044    public String xsdRootElement;
045
046    // this is set by the type service to the context that knows how to locate
047    // the schema file
048    public RuntimeContext context;
049
050    public SchemaBindingDescriptor() {
051    }
052
053    public SchemaBindingDescriptor(String name, String prefix) {
054        this.name = name;
055        this.prefix = prefix;
056    }
057
058    @Override
059    public String toString() {
060        return "Schema: " + name;
061    }
062
063}