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.dataformat;
018
019import javax.xml.bind.annotation.XmlAccessType;
020import javax.xml.bind.annotation.XmlAccessorType;
021import javax.xml.bind.annotation.XmlAttribute;
022import javax.xml.bind.annotation.XmlRootElement;
023
024import org.apache.camel.model.DataFormatDefinition;
025import org.apache.camel.spi.Metadata;
026
027/**
028 * The ASN.1 data format is used for file transfer with telecommunications
029 * protocols.
030 */
031@Metadata(firstVersion = "2.20.0", label = "dataformat,transformation,file", title = "ASN.1 File")
032@XmlRootElement(name = "asn1")
033@XmlAccessorType(XmlAccessType.FIELD)
034public class ASN1DataFormat extends DataFormatDefinition {
035    @XmlAttribute
036    @Metadata(javaType = "java.lang.Boolean")
037    private String usingIterator;
038    @XmlAttribute
039    private String clazzName;
040
041    public ASN1DataFormat() {
042        super("asn1");
043    }
044
045    public ASN1DataFormat(Boolean usingIterator) {
046        this();
047        setUsingIterator(usingIterator != null ? usingIterator.toString() : null);
048    }
049
050    public ASN1DataFormat(String clazzName) {
051        this();
052        setUsingIterator(Boolean.toString(true));
053        setClazzName(clazzName);
054    }
055
056    public String getUsingIterator() {
057        return usingIterator;
058    }
059
060    /**
061     * If the asn1 file has more then one entry, the setting this option to
062     * true, allows to work with the splitter EIP, to split the data using an
063     * iterator in a streaming mode.
064     */
065    public void setUsingIterator(String usingIterator) {
066        this.usingIterator = usingIterator;
067    }
068
069    public String getClazzName() {
070        return clazzName;
071    }
072
073    /**
074     * Name of class to use when unmarshalling
075     */
076    public void setClazzName(String clazzName) {
077        this.clazzName = clazzName;
078    }
079
080}