Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | package org.apache.felix.scrplugin.helper; |
| 20 | |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 21 | import java.util.ArrayList; |
| 22 | import java.util.List; |
| 23 | |
| 24 | import org.apache.felix.scrplugin.Options; |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 25 | |
| 26 | /** |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 27 | * The description container holds all {@link ComponentContainer}s. |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 28 | */ |
| 29 | public class DescriptionContainer { |
| 30 | |
| 31 | /** The options. */ |
| 32 | private final Options options; |
| 33 | |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 34 | /** The list of {@link ComponentContainer}s. */ |
| 35 | private final List<ComponentContainer> containers = new ArrayList<ComponentContainer>(); |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 36 | |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 37 | /** |
| 38 | * Constructor |
| 39 | * @param options The options for this module |
| 40 | */ |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 41 | public DescriptionContainer(final Options options) { |
| 42 | this.options = options; |
| 43 | } |
| 44 | |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 45 | /** |
| 46 | * Get the options |
| 47 | * @return The options |
| 48 | */ |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 49 | public Options getOptions() { |
| 50 | return this.options; |
| 51 | } |
| 52 | |
| 53 | /** |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 54 | * Return the list of {@link ComponentContainer}s. |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 55 | */ |
| 56 | public List<ComponentContainer> getComponents() { |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 57 | return this.containers; |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | /** |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 61 | * Add a container to the list. |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 62 | */ |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 63 | public void add(final ComponentContainer c) { |
| 64 | this.containers.add(c); |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 65 | } |
Carsten Ziegeler | 561e4e2 | 2012-06-27 06:38:28 +0000 | [diff] [blame] | 66 | |
| 67 | @Override |
| 68 | public String toString() { |
Carsten Ziegeler | 283ace9 | 2012-06-27 09:51:56 +0000 | [diff] [blame] | 69 | return "DescriptionContainer [options=" + options + ", containers=" + containers + "]"; |
Carsten Ziegeler | 561e4e2 | 2012-06-27 06:38:28 +0000 | [diff] [blame] | 70 | } |
Carsten Ziegeler | 9a496fe | 2012-06-27 06:20:28 +0000 | [diff] [blame] | 71 | } |