001/*
002 * (C) Copyright 2014 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 *      Vladimir Pasquier <vpasquier@nuxeo.com>
018 */
019package org.nuxeo.binary.metadata.internals;
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;
028
029/**
030 * @since 7.1
031 */
032@XObject("metadataMapping")
033public class MetadataMappingDescriptor implements Serializable {
034
035    private static final long serialVersionUID = 1L;
036
037    @XNode("@id")
038    protected String id;
039
040    @XNode("@processor")
041    protected String processor;
042
043    @XNode("@blobXPath")
044    protected String blobXPath;
045
046    @XNode("@ignorePrefix")
047    protected Boolean ignorePrefix = true;
048
049    @XNodeList(value = "metadata", componentType = MetadataDescriptor.class, type = ArrayList.class)
050    protected List<MetadataDescriptor> metadataDescriptors;
051
052    public List<MetadataDescriptor> getMetadataDescriptors() {
053        return metadataDescriptors;
054    }
055
056    @XObject("metadata")
057    public static class MetadataDescriptor implements Serializable {
058
059        private static final long serialVersionUID = 1L;
060
061        @XNode("@name")
062        protected String name;
063
064        @XNode("@xpath")
065        protected String xpath;
066
067        public String getXpath() {
068            return xpath;
069        }
070
071        public String getName() {
072            return name;
073        }
074
075    }
076
077    public String getId() {
078        return id;
079    }
080
081    public String getProcessor() {
082        return processor;
083    }
084
085    public String getBlobXPath() {
086        return blobXPath;
087    }
088
089    public Boolean getIgnorePrefix() {
090        return ignorePrefix;
091    }
092}