當前位置: 首頁>>代碼示例>>Java>>正文


Java AnnotationAttributes.getBoolean方法代碼示例

本文整理匯總了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));
    }
}
 
開發者ID:cmeza20,項目名稱:spring-data-generator,代碼行數:11,代碼來源:AbstractTemplateProvider.java

示例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);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:18,代碼來源:AspectJAutoProxyRegistrar.java

示例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");
}
 
開發者ID:profullstack,項目名稱:spring-seed,代碼行數:13,代碼來源:SpringSeedRestApiMvcConfigration.java

示例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");
}
 
開發者ID:profullstack,項目名稱:spring-seed,代碼行數:12,代碼來源:SpringSeedRedis.java

示例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);
}
 
開發者ID:lodsve,項目名稱:lodsve-framework,代碼行數:10,代碼來源:MyBatisConfigurationBuilder.java

示例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()]);
}
 
開發者ID:lodsve,項目名稱:lodsve-framework,代碼行數:15,代碼來源:MyBatisConfigurationSelector.java

示例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");
}
 
開發者ID:FastBootWeixin,項目名稱:FastBootWeixin,代碼行數:7,代碼來源:WxBuildinMvcConfiguration.java

示例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));
}
 
開發者ID:ErinDavid,項目名稱:elastic-config,代碼行數:4,代碼來源:AutowiredAnnotationResoved.java

示例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"));
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:15,代碼來源:ContextConfigurationAttributes.java

示例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));
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:13,代碼來源:AutowiredAnnotationBeanPostProcessor.java

示例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));
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:13,代碼來源:AutowiredAnnotationBeanPostProcessor.java


注:本文中的org.springframework.core.annotation.AnnotationAttributes.getBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。