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 *     Nicolas Chapurlat <nchapurlat@nuxeo.com>
018 */
019
020package org.nuxeo.ecm.core.api.validation;
021
022import org.nuxeo.common.xmap.annotation.XNode;
023import org.nuxeo.common.xmap.annotation.XObject;
024
025/**
026 * Handler for the {@link DocumentValidationService} "activations" extension point.
027 *
028 * @since 7.1
029 */
030@XObject("validation")
031public class DocumentValidationDescriptor {
032
033    @XNode("@context")
034    private String context;
035
036    @XNode("@activated")
037    private boolean activated;
038
039    public DocumentValidationDescriptor() {
040    }
041
042    public DocumentValidationDescriptor(String context, boolean activated) {
043        super();
044        this.context = context;
045        this.activated = activated;
046    }
047
048    public String getContext() {
049        return context;
050    }
051
052    public void setContext(String context) {
053        this.context = context;
054    }
055
056    public boolean isActivated() {
057        return activated;
058    }
059
060    public void setActivated(boolean activated) {
061        this.activated = activated;
062    }
063
064    @Override
065    public String toString() {
066        return context + ": " + activated;
067    }
068
069}