Java Doc for PropertiesBeanDefinitionReader.java in  » J2EE » spring-framework-2.0.6 » org » springframework » beans » factory » support » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.beans.factory.support 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.beans.factory.support.AbstractBeanDefinitionReader
      org.springframework.beans.factory.support.PropertiesBeanDefinitionReader

PropertiesBeanDefinitionReader
public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader (Code)
Bean definition reader for a simple properties format.

Provides bean definition registration methods for Map/Properties and ResourceBundle. Typically applied to a DefaultListableBeanFactory.

Example:

employee.(class)=MyClass       // bean is of class MyClass
 employee.(abstract)=true       // this bean can't be instantiated directly
 employee.group=Insurance       // real property
 employee.usesDialUp=false      // real property (potentially overridden)
 salesrep.(parent)=employee     // derives from "employee" bean definition
 salesrep.(lazy-init)=true      // lazily initialize this singleton bean
 salesrep.manager(ref)=tony     // reference to another bean
 salesrep.department=Sales      // real property
 techie.(parent)=employee       // derives from "employee" bean definition
 techie.(singleton)=false       // bean is a prototype (not a shared instance)
 techie.manager(ref)=jeff       // reference to another bean
 techie.department=Engineering  // real property
 techie.usesDialUp=true         // real property (overriding parent value)
ceo.$0(ref)=secretary // inject 'secretary' bean as 0th constructor arg ceo.$1=1000000 // inject value '1000000' at 1st constructor arg Note: As of Spring 1.2.6, the use of class and parent has been deprecated in favor of (class) and (parent), for consistency with all other special properties. Users should note that support for class and parent as special properties rather then actual bean properties will be removed in a future version.
author:
   Rod Johnson
author:
   Juergen Hoeller
author:
   Rob Harrop
since:
   26.11.2003
See Also:   DefaultListableBeanFactory


Field Summary
final public static  StringABSTRACT_KEY
     Special key to distinguish owner.(abstract)=true Default is "false".
final public static  StringCLASS_KEY
    
final public static  StringCONSTRUCTOR_ARG_PREFIX
     Prefix used to denote a constructor argument definition.
final public static  StringLAZY_INIT_KEY
     Special key to distinguish owner.(lazy-init)=true Default is "false".
final public static  StringPARENT_KEY
    
final public static  StringREF_PREFIX
     Prefix before values referencing other beans.
final public static  StringREF_SUFFIX
     Property suffix for references to other beans in the current BeanFactory: e.g.
final public static  StringSEPARATOR
     Separator between bean name and property name.
final public static  StringSINGLETON_KEY
     Special key to distinguish owner.(singleton)=true Default is "true".
final public static  StringTRUE_VALUE
     Value of a T/F attribute that represents true. Anything else represents false.

Constructor Summary
public  PropertiesBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
     Create new PropertiesBeanDefinitionReader for the given bean factory.

Method Summary
public  StringgetDefaultParentBean()
     Return the default parent bean for this bean factory.
public  PropertiesPersistergetPropertiesPersister()
     Return the PropertiesPersister to use for parsing properties files.
public  intloadBeanDefinitions(Resource resource)
     Load bean definitions from the specified properties file, using all property keys (i.e.
public  intloadBeanDefinitions(Resource resource, String prefix)
     Load bean definitions from the specified properties file.
Parameters:
  resource - the resource descriptor for the properties file
Parameters:
  prefix - match or filter within the keys in the map: e.g.
public  intloadBeanDefinitions(EncodedResource encodedResource)
     Load bean definitions from the specified properties file.
public  intloadBeanDefinitions(EncodedResource encodedResource, String prefix)
     Load bean definitions from the specified properties file.
protected  voidregisterBeanDefinition(String beanName, Map map, String prefix, String resourceDescription)
    
public  intregisterBeanDefinitions(ResourceBundle rb)
     Register bean definitions contained in a resource bundle, using all property keys (i.e.
public  intregisterBeanDefinitions(ResourceBundle rb, String prefix)
     Register bean definitions contained in a ResourceBundle.

Similar syntax as for a Map.

public  intregisterBeanDefinitions(Map map)
     Register bean definitions contained in a Map, using all property keys (i.e.
public  intregisterBeanDefinitions(Map map, String prefix)
     Register bean definitions contained in a Map. Ignore ineligible properties.
Parameters:
  map - Map name -> property (String or Object).
public  intregisterBeanDefinitions(Map map, String prefix, String resourceDescription)
     Register bean definitions contained in a Map. Ignore ineligible properties.
Parameters:
  map - Map name -> property (String or Object).
public  voidsetDefaultParentBean(String defaultParentBean)
     Set the default parent bean for this bean factory. If a child bean definition handled by this factory provides neither a parent nor a class attribute, this default value gets used.

Can be used e.g.

public  voidsetPropertiesPersister(PropertiesPersister propertiesPersister)
     Set the PropertiesPersister to use for parsing properties files.

Field Detail
ABSTRACT_KEY
final public static String ABSTRACT_KEY(Code)
Special key to distinguish owner.(abstract)=true Default is "false".



CLASS_KEY
final public static String CLASS_KEY(Code)
Special key to distinguish owner.(class)=com.myapp.MyClass



CONSTRUCTOR_ARG_PREFIX
final public static String CONSTRUCTOR_ARG_PREFIX(Code)
Prefix used to denote a constructor argument definition.



LAZY_INIT_KEY
final public static String LAZY_INIT_KEY(Code)
Special key to distinguish owner.(lazy-init)=true Default is "false".



PARENT_KEY
final public static String PARENT_KEY(Code)
Special key to distinguish owner.(parent)=parentBeanName



REF_PREFIX
final public static String REF_PREFIX(Code)
Prefix before values referencing other beans.



REF_SUFFIX
final public static String REF_SUFFIX(Code)
Property suffix for references to other beans in the current BeanFactory: e.g. owner.dog(ref)=fido. Whether this is a reference to a singleton or a prototype will depend on the definition of the target bean.



SEPARATOR
final public static String SEPARATOR(Code)
Separator between bean name and property name. We follow normal Java conventions.



SINGLETON_KEY
final public static String SINGLETON_KEY(Code)
Special key to distinguish owner.(singleton)=true Default is "true".



TRUE_VALUE
final public static String TRUE_VALUE(Code)
Value of a T/F attribute that represents true. Anything else represents false. Case seNsItive.




Constructor Detail
PropertiesBeanDefinitionReader
public PropertiesBeanDefinitionReader(BeanDefinitionRegistry beanFactory)(Code)
Create new PropertiesBeanDefinitionReader for the given bean factory.




Method Detail
getDefaultParentBean
public String getDefaultParentBean()(Code)
Return the default parent bean for this bean factory.



getPropertiesPersister
public PropertiesPersister getPropertiesPersister()(Code)
Return the PropertiesPersister to use for parsing properties files.



loadBeanDefinitions
public int loadBeanDefinitions(Resource resource) throws BeansException(Code)
Load bean definitions from the specified properties file, using all property keys (i.e. not filtering by prefix).
Parameters:
  resource - the resource descriptor for the properties file the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors
See Also:   PropertiesBeanDefinitionReader.loadBeanDefinitions(org.springframework.core.io.Resource,String)



loadBeanDefinitions
public int loadBeanDefinitions(Resource resource, String prefix) throws BeansException(Code)
Load bean definitions from the specified properties file.
Parameters:
  resource - the resource descriptor for the properties file
Parameters:
  prefix - match or filter within the keys in the map: e.g. 'beans.'(can be empty or null) the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors



loadBeanDefinitions
public int loadBeanDefinitions(EncodedResource encodedResource) throws BeansException(Code)
Load bean definitions from the specified properties file.
Parameters:
  encodedResource - the resource descriptor for the properties file,allowing to specify an encoding to use for parsing the file the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors



loadBeanDefinitions
public int loadBeanDefinitions(EncodedResource encodedResource, String prefix) throws BeansException(Code)
Load bean definitions from the specified properties file.
Parameters:
  encodedResource - the resource descriptor for the properties file,allowing to specify an encoding to use for parsing the file the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors



registerBeanDefinition
protected void registerBeanDefinition(String beanName, Map map, String prefix, String resourceDescription) throws BeansException(Code)
Get all property values, given a prefix (which will be stripped) and add the bean they define to the factory with the given name
Parameters:
  beanName - name of the bean to define
Parameters:
  map - Map containing string pairs
Parameters:
  prefix - prefix of each entry, which will be stripped
Parameters:
  resourceDescription - description of the resource that the Map came from(for logging purposes)
throws:
  BeansException - if the bean definition could not be parsed or registered



registerBeanDefinitions
public int registerBeanDefinitions(ResourceBundle rb) throws BeanDefinitionStoreException(Code)
Register bean definitions contained in a resource bundle, using all property keys (i.e. not filtering by prefix).
Parameters:
  rb - the ResourceBundle to load from the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors
See Also:   PropertiesBeanDefinitionReader.registerBeanDefinitions(java.util.ResourceBundle,String)



registerBeanDefinitions
public int registerBeanDefinitions(ResourceBundle rb, String prefix) throws BeanDefinitionStoreException(Code)
Register bean definitions contained in a ResourceBundle.

Similar syntax as for a Map. This method is useful to enable standard Java internationalization support.
Parameters:
  rb - the ResourceBundle to load from
Parameters:
  prefix - match or filter within the keys in the map: e.g. 'beans.'(can be empty or null) the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors




registerBeanDefinitions
public int registerBeanDefinitions(Map map) throws BeansException(Code)
Register bean definitions contained in a Map, using all property keys (i.e. not filtering by prefix).
Parameters:
  map - Map: name -> property (String or Object). Property valueswill be strings if coming from a Properties file etc. Property names(keys) must be Strings. Class keys must be Strings. the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors
See Also:   PropertiesBeanDefinitionReader.registerBeanDefinitions(java.util.Map,String,String)



registerBeanDefinitions
public int registerBeanDefinitions(Map map, String prefix) throws BeansException(Code)
Register bean definitions contained in a Map. Ignore ineligible properties.
Parameters:
  map - Map name -> property (String or Object). Property valueswill be strings if coming from a Properties file etc. Property names(keys) must be Strings. Class keys must be Strings.
Parameters:
  prefix - The match or filter within the keys in the map: e.g. 'beans.' the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors



registerBeanDefinitions
public int registerBeanDefinitions(Map map, String prefix, String resourceDescription) throws BeansException(Code)
Register bean definitions contained in a Map. Ignore ineligible properties.
Parameters:
  map - Map name -> property (String or Object). Property valueswill be strings if coming from a Properties file etc. Property names(keys) must be strings. Class keys must be Strings.
Parameters:
  prefix - match or filter within the keys in the map: e.g. 'beans.'(can be empty or null)
Parameters:
  resourceDescription - description of the resource that the Map came from(for logging purposes) the number of bean definitions found
throws:
  BeansException - in case of loading or parsing errors
See Also:   PropertiesBeanDefinitionReader.registerBeanDefinitions(Map,String)



setDefaultParentBean
public void setDefaultParentBean(String defaultParentBean)(Code)
Set the default parent bean for this bean factory. If a child bean definition handled by this factory provides neither a parent nor a class attribute, this default value gets used.

Can be used e.g. for view definition files, to define a parent with a default view class and common attributes for all views. View definitions that define their own parent or carry their own class can still override this.

Strictly speaking, the rule that a default parent setting does not apply to a bean definition that carries a class is there for backwards compatiblity reasons. It still matches the typical use case.




setPropertiesPersister
public void setPropertiesPersister(PropertiesPersister propertiesPersister)(Code)
Set the PropertiesPersister to use for parsing properties files. The default is DefaultPropertiesPersister.
See Also:   org.springframework.util.DefaultPropertiesPersister



Fields inherited from org.springframework.beans.factory.support.AbstractBeanDefinitionReader
final protected Log logger(Code)(Java Doc)

Methods inherited from org.springframework.beans.factory.support.AbstractBeanDefinitionReader
public ClassLoader getBeanClassLoader()(Code)(Java Doc)
public BeanDefinitionRegistry getBeanFactory()(Code)(Java Doc)
public BeanNameGenerator getBeanNameGenerator()(Code)(Java Doc)
public ResourceLoader getResourceLoader()(Code)(Java Doc)
public int loadBeanDefinitions(Resource[] resources) throws BeanDefinitionStoreException(Code)(Java Doc)
public int loadBeanDefinitions(String location) throws BeanDefinitionStoreException(Code)(Java Doc)
public int loadBeanDefinitions(String[] locations) throws BeanDefinitionStoreException(Code)(Java Doc)
public void setBeanClassLoader(ClassLoader beanClassLoader)(Code)(Java Doc)
public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)(Code)(Java Doc)
public void setResourceLoader(ResourceLoader resourceLoader)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.