001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.camel.model.validator;
018
019import javax.xml.bind.annotation.XmlAccessType;
020import javax.xml.bind.annotation.XmlAccessorType;
021import javax.xml.bind.annotation.XmlAttribute;
022import javax.xml.bind.annotation.XmlType;
023
024import org.apache.camel.spi.Metadata;
025import org.apache.camel.spi.Validator;
026
027/**
028 * Represents an endpoint {@link Validator} which leverages camel validator
029 * component such as <a href="http://camel.apache.org/validation.html">Validator
030 * Component</a> and <a href="http://camel.apache.org/bean-validation.html">Bean
031 * Validator Component</a> to perform content validation. A
032 * {@link org.apache.camel.impl.validator.ProcessorValidator} will be created
033 * internally with a {@link org.apache.camel.processor.SendProcessor} which
034 * forwards the message to the validator Endpoint. {@see ValidatorDefinition}
035 * {@see Validator}
036 */
037@Metadata(label = "validation")
038@XmlType(name = "endpointValidator")
039@XmlAccessorType(XmlAccessType.FIELD)
040public class EndpointValidatorDefinition extends ValidatorDefinition {
041
042    @XmlAttribute
043    private String ref;
044    @XmlAttribute
045    private String uri;
046
047    public String getRef() {
048        return ref;
049    }
050
051    /**
052     * Set the reference of the Endpoint.
053     *
054     * @param ref reference of the Endpoint
055     */
056    public void setRef(String ref) {
057        this.ref = ref;
058    }
059
060    public String getUri() {
061        return uri;
062    }
063
064    /**
065     * Set the URI of the Endpoint.
066     *
067     * @param uri URI of the Endpoint
068     */
069    public void setUri(String uri) {
070        this.uri = uri;
071    }
072
073}