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     */
017    package org.apache.servicemix.common.tools.wsdl;
018    
019    import java.net.URI;
020    import java.util.ArrayList;
021    import java.util.List;
022    
023    import org.w3c.dom.Element;
024    
025    /**
026     * Contains informations related to a schema.
027     *  
028     * @author gnodet
029     */
030    public class Schema {
031    
032        private Element root;
033        private String namespace;
034        private List<String> imports;
035        private List<URI> sourceUris;
036        
037        /**
038         * Add a reference to an imported namespace.
039         * @param namespace the namespace to reference
040         */
041        public void addImport(String namespace) {
042            if (imports == null) {
043                imports = new ArrayList<String>();
044            }
045            imports.add(namespace);
046        }
047        
048        /**
049         * @return Returns the imports.
050         */
051        public List<String> getImports() {
052            return imports;
053        }
054    
055        /**
056         * @param imports The imports to set.
057         */
058        public void setImports(List<String> imports) {
059            this.imports = imports;
060        }
061    
062        /**
063         * @return Returns the root.
064         */
065        public Element getRoot() {
066            return root;
067        }
068    
069        /**
070         * @param root The root to set.
071         */
072        public void setRoot(Element root) {
073            this.root = root;
074        }
075    
076        /**
077         * @return Returns the namespace.
078         */
079        public String getNamespace() {
080            return namespace;
081        }
082    
083        /**
084         * @param namespace The namespace to set.
085         */
086        public void setNamespace(String namespace) {
087            this.namespace = namespace;
088        }
089    
090        /**
091         * @return Returns the sourceUri.
092         */
093        public List<URI> getSourceUris() {
094            return sourceUris;
095        }
096    
097        /**
098         * @param sourceUri The sourceUri to set.
099         */
100        public void addSourceUri(URI sourceUri) {
101            if (sourceUris == null) {
102                    sourceUris = new ArrayList<URI>();
103            }
104            sourceUris.add(sourceUri);
105        }
106    
107    }