// Copyright 2003-2004 The Apache Software Foundation
//
// Licensed 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.
namespace Apache.Avalon.Composition.Data
{
using System;
using Apache.Avalon.Framework;
///
A target is a tagged configuration fragment. The tag is a path
/// seperated by "/" charaters qualifying the component that the target
/// configuration is to be applied to.
///
///
/// Stephen McConnell
///
/// $Revision: 1.2 $ $Date: 2004/02/28 22:15:36 $
///
[Serializable]
public class TargetDirective
{
//========================================================================
// immutable state
//========================================================================
/// The path.
private System.String m_path;
/// The configuration.
private IConfiguration m_config;
/// The configuration.
private CategoriesDirective m_categories;
//========================================================================
// constructors
//========================================================================
/// Create a new null Target instance.
///
///
/// target path
///
public TargetDirective(System.String path):this(path, null)
{
}
/// Create a new Target instance.
///
///
/// target path
///
/// the configuration
///
public TargetDirective(System.String path, IConfiguration configuration):this(path, configuration, null)
{
}
/// Create a new Target instance.
///
///
/// target path
///
/// the configuration
///
/// the logging category directives
///
public TargetDirective(System.String path, IConfiguration configuration, CategoriesDirective categories)
{
m_path = path;
m_config = configuration;
m_categories = categories;
}
//========================================================================
// implementation
//========================================================================
/// Return a string representation of the target.
/// a string representing the target instance
///
public override System.String ToString()
{
return "[target: " + Path + ", " + (Configuration != null) + ", " + (CategoriesDirective != null) + ", " + " ]";
}
/// Return the target path.
///
///
/// the target path
///
public virtual System.String Path
{
get
{
return m_path;
}
}
/// Return the target configuration.
///
///
/// the target configuration
///
public virtual IConfiguration Configuration
{
get
{
return m_config;
}
}
/// Return the logging categories directive.
///
///
/// the logging categories (possibly null)
///
public virtual CategoriesDirective CategoriesDirective
{
get
{
return m_categories;
}
}
}
}