// 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;
/// A DependencyDirective contains information describing how a
/// depedency should be resolved.
///
///
/// Stephen McConnell
///
/// CVS $Revision: 1.2 $ $Date: 2004/02/28 22:15:36 $
///
[Serializable]
public sealed class SelectionDirective
{
public const System.String EXISTS = "exists";
public const System.String EQUALS = "equals";
public const System.String INCLUDES = "includes";
/// The feature name.
private System.String m_feature;
/// The value attributed to the feature selection criteria.
private System.String m_value;
/// The criteria to be applied with respect to the feature criteria.
private System.String m_criteria;
/// The optional status of the selection directive.
private bool m_optional;
/// Creation of a new dependency directive.
///
///
/// the selection feature
///
/// the value to asses
///
/// the selection criteria
///
/// the optional status
///
public SelectionDirective(System.String feature, System.String valueObj, System.String criteria, bool optional)
{
m_feature = feature;
m_value = valueObj;
m_criteria = criteria;
m_optional = optional;
}
/// Return the feature name.
/// the name
///
public System.String Feature
{
get
{
return m_feature;
}
}
/// Return the feature value.
/// the name
///
public System.String Value
{
get
{
return m_value;
}
}
/// Return the feature selection criteria.
/// the criteria
///
public System.String Criteria
{
get
{
return m_criteria;
}
}
/// Return the required status of this directive.
/// the required status
///
public bool Required
{
get
{
return !m_optional;
}
}
/// Return the optional status of this directive. This
/// is equivalent to !isRequired()
///
/// the optional status
///
public bool Optional
{
get
{
return m_optional;
}
}
}
}