using System;
using Mustache.Properties;
namespace Mustache
{
///
/// Defines a parameter belonging to a custom tag.
///
public sealed class TagParameter
{
private readonly string _name;
///
/// Initializes a new instance of a TagParameter.
///
/// The name of the parameter.
/// The parameter name is null or an invalid identifier.
public TagParameter(string parameterName)
{
if (!RegexHelper.IsValidIdentifier(parameterName))
{
throw new ArgumentException(Resources.BlankParameterName, "parameterName");
}
_name = parameterName;
}
///
/// Gets the name of the parameter.
///
public string Name
{
get { return _name; }
}
///
/// Gets or sets whether the field is required.
///
public bool IsRequired
{
get;
set;
}
///
/// Gets or sets the default value to use when an argument is not provided
/// for the parameter.
///
public object DefaultValue
{
get;
set;
}
}
}