| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| package org.apache.tamaya.model; |
| |
| import java.util.Collection; |
| |
| /** |
| * Interface describing a configuration section. |
| */ |
| public interface ConfigSection extends Validated { |
| /** |
| * Get all parameters contained in the given section. |
| * |
| * @return the parameters, not null. |
| */ |
| Collection<ConfigParameter> getParameters(); |
| |
| /** |
| * Get all parameters contained in the given section. |
| * |
| * @param recursive if true, traverse down the subtree and collect all parameters found. |
| * @return the parameters, not null. |
| */ |
| Collection<ConfigParameter> getParameters(boolean recursive); |
| |
| /** |
| * Get a parameter by name. |
| * |
| * @param name the parameter name. |
| * @return the parameter found, or null. |
| */ |
| ConfigParameter getParameter(String name); |
| |
| /** |
| * Get all child section (non recursive). |
| * |
| * @return all child sections, never null. |
| */ |
| Collection<ConfigSection> getChildSections(); |
| |
| /** |
| * Get a child section by name (non recursive). |
| * |
| * @param name the section's name. |
| * @return the section found, or null. |
| */ |
| ConfigSection getSection(String name); |
| |
| /** |
| * Get a section by name/path. The section path can be relative (first lookup) |
| * or absolute. |
| * |
| * @param name the section's name/path. |
| * @return the section found, or null. |
| */ |
| ConfigSection lookupSection(String name); |
| |
| /** |
| * Flag if the item is required. |
| * |
| * @return true, if the item is required. |
| */ |
| boolean isRequired(); |
| |
| /** |
| * Get the containing parent section. |
| * |
| * @return the parent secion, or null, if there is no parent. |
| */ |
| ConfigSection getParent(); |
| } |