From 9fd180f4aab272e96af612390782b5f7f1f472f2 Mon Sep 17 00:00:00 2001 From: Thomas Trageser Date: Mon, 13 Aug 2012 09:57:14 +0100 Subject: [PATCH] SPRNET-1519 Add [Controller] attribute stereotype as possible component declaration --- .../Spring.Core/Spring.Core.2008.csproj | 1 + .../Spring.Core/Spring.Core.2010.csproj | 1 + .../Stereotype/ControllerAttribute.cs | 54 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 src/Spring/Spring.Core/Stereotype/ControllerAttribute.cs diff --git a/src/Spring/Spring.Core/Spring.Core.2008.csproj b/src/Spring/Spring.Core/Spring.Core.2008.csproj index 65f78ae3..2dcd89a4 100644 --- a/src/Spring/Spring.Core/Spring.Core.2008.csproj +++ b/src/Spring/Spring.Core/Spring.Core.2008.csproj @@ -1108,6 +1108,7 @@ + diff --git a/src/Spring/Spring.Core/Spring.Core.2010.csproj b/src/Spring/Spring.Core/Spring.Core.2010.csproj index d734761b..e6f1052e 100644 --- a/src/Spring/Spring.Core/Spring.Core.2010.csproj +++ b/src/Spring/Spring.Core/Spring.Core.2010.csproj @@ -713,6 +713,7 @@ + diff --git a/src/Spring/Spring.Core/Stereotype/ControllerAttribute.cs b/src/Spring/Spring.Core/Stereotype/ControllerAttribute.cs new file mode 100644 index 00000000..889a537a --- /dev/null +++ b/src/Spring/Spring.Core/Stereotype/ControllerAttribute.cs @@ -0,0 +1,54 @@ +#region License + +/* + * Copyright 2002-2010 the original author or authors. + * + * 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. + */ + +#endregion + +namespace Spring.Stereotype +{ + /// + /// Indicates that an annotated class is a "Controller" (e.g. a MVC Controller). + /// + /// + /// + /// This attribute also serves as a specialization of the ComponentAttribute, allowing implementation + /// classes to be autodetected in future releases through assembly scanning. + /// + /// + /// Thomas Trageser + public class ControllerAttribute : ComponentAttribute + { + + /// + /// Initializes a new instance of the class. + /// + public ControllerAttribute() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The name. + public ControllerAttribute(string name) + : base(name) + { + } + + + } +} \ No newline at end of file