// Copyright 2004 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;
/// Description of typeloader.
///
///
/// Avalon Development Team
///
/// $Revision: 1.1 $ $Date: 2004/02/01 13:31:01 $
///
[Serializable]
public sealed class TypeLoaderDirective
{
/// Return true if the library and classpath declarations are empty.
/// If the function returns true, this directive is in an effective
/// default state and need not be externalized.
///
///
/// the empty status of this directive
///
public bool Empty
{
get
{
return (m_library.Empty && m_classpath.Empty);
}
}
/// Return the library directive.
///
///
/// the library directive.
///
public LibraryDirective Library
{
get
{
return m_library;
}
}
/// Return the classpath directive.
///
///
/// the classpath directive.
///
public ClasspathDirective ClasspathDirective
{
get
{
return m_classpath;
}
}
private static readonly LibraryDirective EMPTY_LIBRARY = new LibraryDirective();
private static readonly ClasspathDirective EMPTY_CLASSPATH = new ClasspathDirective();
/// The library directive.
private LibraryDirective m_library;
/// The root category hierachy.
private ClasspathDirective m_classpath;
/// Create an empty TypeLoaderDirective.
public TypeLoaderDirective():this(null, null)
{
}
/// Create a TypeLoaderDirective instance.
///
///
/// the library descriptor
///
/// the classpath descriptor
///
public TypeLoaderDirective(LibraryDirective library, ClasspathDirective classpath)
{
if (library == null)
{
m_library = EMPTY_LIBRARY;
}
else
{
m_library = library;
}
if (classpath == null)
{
m_classpath = EMPTY_CLASSPATH;
}
else
{
m_classpath = classpath;
}
}
}
}