001    /*
002     *  Licensed to the Apache Software Foundation (ASF) under one
003     *  or more contributor license agreements.  See the NOTICE file
004     *  distributed with this work for additional information
005     *  regarding copyright ownership.  The ASF licenses this file
006     *  to you under the Apache License, Version 2.0 (the
007     *  "License"); you may not use this file except in compliance
008     *  with the License.  You may obtain a copy of the License at
009     *  
010     *    http://www.apache.org/licenses/LICENSE-2.0
011     *  
012     *  Unless required by applicable law or agreed to in writing,
013     *  software distributed under the License is distributed on an
014     *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     *  KIND, either express or implied.  See the License for the
016     *  specific language governing permissions and limitations
017     *  under the License. 
018     *  
019     */
020    package org.apache.directory.shared.converter.schema;
021    
022    import java.io.InputStream;
023    import java.io.Writer;
024    
025    
026    /**
027     * A bean used to hold a schema. We keep its name and we associate whith this
028     * object an inputStream mapped on the OpenLdap schema to read, and a writer
029     * in which the ldif file will be dumped.
030     *
031     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
032     * @version $Rev$, $Date$
033     */
034    public class Schema
035    {
036        /** The schema name */
037        private String name;
038        
039        /** The inputStream mapped on the file to read */
040        private InputStream in; 
041        
042        /** The writer where we dump the ldif lines */
043        private Writer out;
044    
045        /**
046         * Set the schema name to parse. This name is the prefix of the
047         * schema file, which postifx is '.schema'.
048         * 
049         * For instance, 'test.schema' being the file to parse, its name 
050         * will be 'test'
051         * @param name
052         */
053        public void setName( String name )
054        {
055            this.name = name;
056        }
057    
058        /**
059         * @return The schema name.
060         */
061        public String getName()
062        {
063            return name;
064        }
065        
066        /**
067         * Set the inputStream mapped on the schema file
068         * @param in The InputStream mapped on the schema file
069         */
070        public void setInput( InputStream in )
071        {
072            this.in = in;
073        }
074        
075        /**
076         * @return The InputStream mapped on the schema file
077         */
078        public InputStream getInput()
079        {
080            return in;
081        }
082    
083        /**
084         * @return The writer in which the ldif lines will be dumped
085         */
086        public Writer getOutput()
087        {
088            return out;
089        }
090    
091        /**
092         * Set a writer to dump the ldif files
093         * @param out The writer 
094         */
095        public void setOutput( Writer out )
096        {
097            this.out = out;
098        }
099    }