org.springframework.beans.factory.parsing.ProblemReporter#error ( )源码实例Demo

下面列出了org.springframework.beans.factory.parsing.ProblemReporter#error ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: spring-analysis-note   文件: BeanMethod.java
@Override
public void validate(ProblemReporter problemReporter) {
	if (getMetadata().isStatic()) {
		// static @Bean methods have no constraints to validate -> return immediately
		return;
	}

	if (this.configurationClass.getMetadata().isAnnotated(Configuration.class.getName())) {
		if (!getMetadata().isOverridable()) {
			// instance @Bean methods within @Configuration classes must be overridable to accommodate CGLIB
			problemReporter.error(new NonOverridableMethodError());
		}
	}
}
 
源代码2 项目: spring-analysis-note   文件: ConfigurationClass.java
public void validate(ProblemReporter problemReporter) {
	// A configuration class may not be final (CGLIB limitation) unless it declares proxyBeanMethods=false
	Map<String, Object> attributes = this.metadata.getAnnotationAttributes(Configuration.class.getName());
	if (attributes != null && (Boolean) attributes.get("proxyBeanMethods")) {
		if (this.metadata.isFinal()) {
			problemReporter.error(new FinalConfigurationProblem());
		}
		for (BeanMethod beanMethod : this.beanMethods) {
			beanMethod.validate(problemReporter);
		}
	}
}
 
源代码3 项目: java-technology-stack   文件: BeanMethod.java
@Override
public void validate(ProblemReporter problemReporter) {
	if (getMetadata().isStatic()) {
		// static @Bean methods have no constraints to validate -> return immediately
		return;
	}

	if (this.configurationClass.getMetadata().isAnnotated(Configuration.class.getName())) {
		if (!getMetadata().isOverridable()) {
			// instance @Bean methods within @Configuration classes must be overridable to accommodate CGLIB
			problemReporter.error(new NonOverridableMethodError());
		}
	}
}
 
public void validate(ProblemReporter problemReporter) {
	// A configuration class may not be final (CGLIB limitation)
	if (getMetadata().isAnnotated(Configuration.class.getName())) {
		if (getMetadata().isFinal()) {
			problemReporter.error(new FinalConfigurationProblem());
		}
	}

	for (BeanMethod beanMethod : this.beanMethods) {
		beanMethod.validate(problemReporter);
	}
}
 
源代码5 项目: lams   文件: BeanMethod.java
@Override
public void validate(ProblemReporter problemReporter) {
	if (getMetadata().isStatic()) {
		// static @Bean methods have no constraints to validate -> return immediately
		return;
	}

	if (this.configurationClass.getMetadata().isAnnotated(Configuration.class.getName())) {
		if (!getMetadata().isOverridable()) {
			// instance @Bean methods within @Configuration classes must be overridable to accommodate CGLIB
			problemReporter.error(new NonOverridableMethodError());
		}
	}
}
 
源代码6 项目: lams   文件: ConfigurationClass.java
public void validate(ProblemReporter problemReporter) {
	// A configuration class may not be final (CGLIB limitation)
	if (getMetadata().isAnnotated(Configuration.class.getName())) {
		if (getMetadata().isFinal()) {
			problemReporter.error(new FinalConfigurationProblem());
		}
	}

	for (BeanMethod beanMethod : this.beanMethods) {
		beanMethod.validate(problemReporter);
	}
}
 
源代码7 项目: spring4-understanding   文件: BeanMethod.java
@Override
public void validate(ProblemReporter problemReporter) {
	if (getMetadata().isStatic()) {
		// static @Bean methods have no constraints to validate -> return immediately
		return;
	}

	if (this.configurationClass.getMetadata().isAnnotated(Configuration.class.getName())) {
		if (!getMetadata().isOverridable()) {
			// instance @Bean methods within @Configuration classes must be overridable to accommodate CGLIB
			problemReporter.error(new NonOverridableMethodError());
		}
	}
}
 
public void validate(ProblemReporter problemReporter) {
	// A configuration class may not be final (CGLIB limitation)
	if (getMetadata().isAnnotated(Configuration.class.getName())) {
		if (getMetadata().isFinal()) {
			problemReporter.error(new FinalConfigurationProblem());
		}
	}

	for (BeanMethod beanMethod : this.beanMethods) {
		beanMethod.validate(problemReporter);
	}
}