本文整理汇总了Java中org.springframework.core.annotation.AnnotationAttributes.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationAttributes.getBoolean方法的具体用法?Java AnnotationAttributes.getBoolean怎么用?Java AnnotationAttributes.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.core.annotation.AnnotationAttributes
的用法示例。
在下文中一共展示了AnnotationAttributes.getBoolean方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractTemplateProvider
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
public AbstractTemplateProvider(AnnotationAttributes attributes) {
Assert.notNull(attributes, "AnnotationAttributes must not be null!");
this.excludeClasses = attributes.getClassArray(getExcludeClasses());
this.postfix = attributes.getString(getPostfix());
this.debug = attributes.getBoolean("debug");
this.overwrite = attributes.getBoolean("overwrite");
if (excludeClasses.length > 0 && debug) {
SDLogger.debug(String.format("Exclude %s %s in the %s generator", excludeClasses.length, excludeClasses.length == 1 ? "entity":"entities", postfix));
}
}
示例2: registerBeanDefinitions
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
/**
* Register, escalate, and configure the AspectJ auto proxy creator based on the value
* of the @{@link EnableAspectJAutoProxy#proxyTargetClass()} attribute on the importing
* {@code @Configuration} class.
*/
@Override
public void registerBeanDefinitions(
AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
AopConfigUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(registry);
AnnotationAttributes enableAJAutoProxy =
AnnotationConfigUtils.attributesFor(importingClassMetadata, EnableAspectJAutoProxy.class);
if (enableAJAutoProxy.getBoolean("proxyTargetClass")) {
AopConfigUtils.forceAutoProxyCreatorToUseClassProxying(registry);
}
}
示例3: setImportMetadata
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
AnnotationAttributes attributes = AnnotationAttributes.fromMap(importMetadata.getAnnotationAttributes(EnableSpringSeedRestApiMvc.class.getName()));
this.disableCors = attributes.getBoolean("disableCors");
this.parseAuthorizationHeader = attributes.getBoolean("parseAuthorizationHeader");
AnnotationAttributes jwt = attributes.getAnnotation("enableJwtConfig");
this.jwtValue = jwt.getBoolean("value");
this.jwtSecretPropertyName = jwt.getString("secretPropertyName");
this.expiration = jwt.getNumber("expiration").longValue();
this.enableSwagger2 = attributes.getBoolean("enableSwagger2");
}
示例4: setImportMetadata
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
AnnotationAttributes attributes = AnnotationAttributes.fromMap(importMetadata.getAnnotationAttributes(EnableSpringSeedRedis.class.getName()));
this.defaultExpiration = attributes.getNumber("defaultExpiration").longValue();
this.propertyPrefix = attributes.getString("propertyPrefix");
AnnotationAttributes[] annotationAttributes = attributes.getAnnotationArray("cacheExpirations");
for(AnnotationAttributes a: annotationAttributes){
expiresMap.put(a.getString("value"), a.getNumber("expiration").longValue());
}
this.clearBeforeStart = attributes.getBoolean("clearBeforeStart");
}
示例5: MyBatisConfigurationBuilder
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
private MyBatisConfigurationBuilder(AnnotationMetadata metadata) {
this.metadata = metadata;
AnnotationAttributes attributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(EnableMyBatis.class.getName(), false));
Assert.notNull(attributes, String.format("@%s is not present on importing class '%s' as expected", EnableMyBatis.class.getName(), metadata.getClassName()));
this.attributes = attributes;
this.useFlyway = attributes.getBoolean(Constant.USE_FLYWAY_ATTRIBUTE_NAME);
this.migration = attributes.getString(Constant.MIGRATION_ATTRIBUTE_NAME);
}
示例6: selectImports
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
@Override
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
List<String> imports = new ArrayList<>();
imports.add(MyBatisBeanDefinitionRegistrar.class.getName());
imports.add(MyBatisConfiguration.class.getName());
AnnotationAttributes attributes = AnnotationAttributes.fromMap(importingClassMetadata.getAnnotationAttributes(EnableMyBatis.class.getName(), false));
boolean supportTransaction = attributes.getBoolean(Constant.SUPPORT_TRANSACTION_ATTRIBUTE_NAME);
if (supportTransaction) {
imports.add(DataSourceTransactionManagementConfiguration.class.getName());
}
return imports.toArray(new String[imports.size()]);
}
示例7: getMatchOutcome
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
AnnotationAttributes annotationAttributes = AnnotationAttributes
.fromMap(metadata.getAnnotationAttributes(ANNOTATION_CLASS));
String endpointName = annotationAttributes.getString("value");
boolean enabledByDefault = annotationAttributes.getBoolean("enabledByDefault");
ConditionOutcome outcome = determineEndpointOutcome(endpointName,
enabledByDefault, context);
if (outcome != null) {
return outcome;
}
return determineAllEndpointsOutcome(context);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:OnEnabledEndpointCondition.java
示例8: setImportMetadata
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
AnnotationAttributes annotationAttributes = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(EnableWxMvc.class.getName(), false));
this.menuAutoCreate = annotationAttributes.getBoolean("menuAutoCreate");
}
示例9: determineRequiredStatus
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
protected boolean determineRequiredStatus(AnnotationAttributes ann) {
return (!ann.containsKey(this.requiredParameterName) || this.requiredParameterValue == ann.getBoolean(this.requiredParameterName));
}
示例10: ContextConfigurationAttributes
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
/**
* Construct a new {@link ContextConfigurationAttributes} instance for the
* supplied {@link AnnotationAttributes} (parsed from a
* {@link ContextConfiguration @ContextConfiguration} annotation) and
* the {@linkplain Class test class} that declared them.
* @param declaringClass the test class that declared {@code @ContextConfiguration}
* @param annAttrs the annotation attributes from which to retrieve the attributes
*/
@SuppressWarnings("unchecked")
public ContextConfigurationAttributes(Class<?> declaringClass, AnnotationAttributes annAttrs) {
this(declaringClass, annAttrs.getStringArray("locations"), annAttrs.getClassArray("classes"), annAttrs.getBoolean("inheritLocations"),
(Class<? extends ApplicationContextInitializer<? extends ConfigurableApplicationContext>>[]) annAttrs.getClassArray("initializers"),
annAttrs.getBoolean("inheritInitializers"), annAttrs.getString("name"), (Class<? extends ContextLoader>) annAttrs.getClass("loader"));
}
示例11: determineRequiredStatus
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
/**
* Determine if the annotated field or method requires its dependency.
* <p>A 'required' dependency means that autowiring should fail when no beans
* are found. Otherwise, the autowiring process will simply bypass the field
* or method when no beans are found.
* @param annotation the Autowired annotation
* @return whether the annotation indicates that a dependency is required
*/
protected boolean determineRequiredStatus(AnnotationAttributes annotation) {
return (!annotation.containsKey(this.requiredParameterName) ||
this.requiredParameterValue == annotation.getBoolean(this.requiredParameterName));
}
示例12: determineRequiredStatus
import org.springframework.core.annotation.AnnotationAttributes; //导入方法依赖的package包/类
/**
* Determine if the annotated field or method requires its dependency.
* <p>A 'required' dependency means that autowiring should fail when no beans
* are found. Otherwise, the autowiring process will simply bypass the field
* or method when no beans are found.
* @param ann the Autowired annotation
* @return whether the annotation indicates that a dependency is required
*/
protected boolean determineRequiredStatus(AnnotationAttributes ann) {
return (!ann.containsKey(this.requiredParameterName) ||
this.requiredParameterValue == ann.getBoolean(this.requiredParameterName));
}