zoukankan      html  css  js  c++  java
  • Spring源码解析之BeanDefinition

    BeanDefinition接口继承了接口AttributeAccessor,BeanMetadataElement。

    接口AttributeAccessor:
    String[] attributeNames() 
              Return the names of all attributes.
    Object getAttribute(String name) 
              Get the value of the attribute identified by name.
    boolean hasAttribute(String name) 
              Return true if the attribute identified by name exists.
    Object removeAttribute(String name) 
              Remove the attribute identified by name and return its value.
    void setAttribute(String name, Object value) 
              Set the attribute defined by name to the supplied value.

     

     接口BeanDefinition:

     BeanDefinition描述了一个bean实例,它具有属性值,构造函数参数值以及具体实现提供的更多信息。这只是一个最小的接口:主要目的是允许BeanFactoryPostProcessor(如PropertyPlaceholderConfigurer)内省和修改属性值和其他bean元数据。  

    String  getBeanClassName() 
              Return the current bean class name of this bean definition.
    ConstructorArgumentValues  getConstructorArgumentValues() 
              Return the constructor argument values for this bean.
    String[]  getDependsOn() 
              Return the bean names that this bean depends on.
    String  getDescription() 
              Return a human-readable description of this bean definition.
    String  getFactoryBeanName() 
              Return the factory bean name, if any.
    String  getFactoryMethodName() 
              Return a factory method, if any.
    BeanDefinition  getOriginatingBeanDefinition() 
              Return the originating BeanDefinition, or null if none.
    String  getParentName() 
              Return the name of the parent definition of this bean definition, if any.
    MutablePropertyValues  getPropertyValues() 
              Return the property values to be applied to a new instance of the bean.
    String  getResourceDescription() 
              Return a description of the resource that this bean definition came from (for the purpose of showing context in case of errors).
    int getRole() 
              Get the role hint for this BeanDefinition.
    String  getScope() 
              Return the name of the current target scope for this bean, or null if not known yet.
    boolean  isAbstract() 
              Return whether this bean is "abstract", that is, not meant to be instantiated.
    boolean  isAutowireCandidate() 
              Return whether this bean is a candidate for getting autowired into some other bean.
    boolean  isLazyInit() 
              Return whether this bean should be lazily initialized, i.e.
    boolean  isPrimary() 
              Return whether this bean is a primary autowire candidate.
    boolean  isPrototype() 
              Return whether this a Prototype, with an independent instance returned for each call.
    boolean  isSingleton() 
              Return whether this a Singleton, with a single, shared instance returned on all calls.
    void setAutowireCandidate(boolean autowireCandidate) 
              Set whether this bean is a candidate for getting autowired into some other bean.
    void  setBeanClassName(String beanClassName) 
              Override the bean class name of this bean definition.
    void  setDependsOn(String[] dependsOn) 
              Set the names of the beans that this bean depends on being initialized.
    void  setFactoryBeanName(String factoryBeanName) 
              Specify the factory bean to use, if any.
    void  setFactoryMethodName(String factoryMethodName) 
              Specify a factory method, if any.
    void  setLazyInit(boolean lazyInit) 
              Set whether this bean should be lazily initialized.
    void  setParentName(String parentName) 
              Set the name of the parent definition of this bean definition, if any.
    void  setPrimary(boolean primary) 
              Set whether this bean is a primary autowire candidate.
    void  setScope(String scope) 
              Override the target scope of this bean, specifying a new scope name.
  • 相关阅读:
    leetCode 24. Swap Nodes in Pairs (双数交换节点) 解题思路和方法
    【jQuery 区别】.click()和$(document).on("click","指定的元素",function(){});的区别
    【前台 submit的重复提交 错误】submit的重复提交
    【spring 注解 错误】使用controller 作为后台给前台ajax交互数据出错
    【Filter 不登陆无法访问】web项目中写一个过滤器实现用户不登陆,直接给链接,无法进入页面的功能
    【Filter 页面重定向循环】写一个过滤器造成的页面重定向循环的问题
    【前台页面 BUG】回车按钮后,页面自动跳转
    【hibernate 执行方法未插入数据库】hibernate的save方法成功执行,但是未插入到数据库
    【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
    【hibernate criteria】hibernate中criteria的完整用法 转
  • 原文地址:https://www.cnblogs.com/yaohuiqin/p/10435526.html
Copyright © 2011-2022 走看看