Browse Source
Uses of AnnotationMetadata#getAnnotationAttributes throughout the framework have been updated to use the new AnnotationAttributes API in order to take advantage of the more concise, expressive and type-safe methods there. All changes are binary compatible to the 3.1.0 public API, save the exception below. A minor binary compatibility issue has been introduced in AbstractCachingConfiguration, AbstractAsyncConfiguration and AbstractTransactionManagementConfiguration when updating their protected Map<String, Object> fields representing annotation attributes to use the new AnnotationAttributes API. This is a negligible breakage, however, as the likelilhood of users subclassing these types is very low, the classes have only been in existence for a short time (further reducing the likelihood), and it is a source-compatible change given that AnnotationAttributes is assignable to Map<String, Object>.pull/16/merge
20 changed files with 151 additions and 169 deletions
@ -1,36 +0,0 @@
@@ -1,36 +0,0 @@
|
||||
/* |
||||
* Copyright 2002-2011 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. |
||||
*/ |
||||
|
||||
package org.springframework.context.annotation; |
||||
|
||||
import org.springframework.core.type.AnnotationMetadata; |
||||
|
||||
class ProfileHelper { |
||||
/** |
||||
* Return whether the given metadata includes Profile information, whether directly or |
||||
* through meta-annotation. |
||||
*/ |
||||
static boolean isProfileAnnotationPresent(AnnotationMetadata metadata) { |
||||
return metadata.isAnnotated(Profile.class.getName()); |
||||
} |
||||
|
||||
/** |
||||
* Return the String[] of candidate profiles from {@link Profile#value()}. |
||||
*/ |
||||
static String[] getCandidateProfiles(AnnotationMetadata metadata) { |
||||
return (String[])metadata.getAnnotationAttributes(Profile.class.getName()).get("value"); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue