blob: eff6797d074e4e2d425b79ae93ce81fa3ae6974e [file] [log] [blame]
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +00001/*
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 */
19package org.apache.felix.scrplugin.helper;
20
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000021import java.util.ArrayList;
22import java.util.List;
23
24import org.apache.felix.scrplugin.Options;
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000025
26/**
Carsten Ziegeler283ace92012-06-27 09:51:56 +000027 * The description container holds all {@link ComponentContainer}s.
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000028 */
29public class DescriptionContainer {
30
31 /** The options. */
32 private final Options options;
33
Carsten Ziegeler283ace92012-06-27 09:51:56 +000034 /** The list of {@link ComponentContainer}s. */
35 private final List<ComponentContainer> containers = new ArrayList<ComponentContainer>();
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000036
Carsten Ziegeler283ace92012-06-27 09:51:56 +000037 /**
38 * Constructor
39 * @param options The options for this module
40 */
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000041 public DescriptionContainer(final Options options) {
42 this.options = options;
43 }
44
Carsten Ziegeler283ace92012-06-27 09:51:56 +000045 /**
46 * Get the options
47 * @return The options
48 */
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000049 public Options getOptions() {
50 return this.options;
51 }
52
53 /**
Carsten Ziegeler283ace92012-06-27 09:51:56 +000054 * Return the list of {@link ComponentContainer}s.
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000055 */
56 public List<ComponentContainer> getComponents() {
Carsten Ziegeler283ace92012-06-27 09:51:56 +000057 return this.containers;
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000058 }
59
60 /**
Carsten Ziegeler283ace92012-06-27 09:51:56 +000061 * Add a container to the list.
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000062 */
Carsten Ziegeler283ace92012-06-27 09:51:56 +000063 public void add(final ComponentContainer c) {
64 this.containers.add(c);
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000065 }
Carsten Ziegeler561e4e22012-06-27 06:38:28 +000066
67 @Override
68 public String toString() {
Carsten Ziegeler283ace92012-06-27 09:51:56 +000069 return "DescriptionContainer [options=" + options + ", containers=" + containers + "]";
Carsten Ziegeler561e4e22012-06-27 06:38:28 +000070 }
Carsten Ziegeler9a496fe2012-06-27 06:20:28 +000071}