| 
JSF-Spring | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mindmatters.faces.spring.factory.xml.ManagedBeanDefinitionDocumentReader
public class ManagedBeanDefinitionDocumentReader
Faces implementation of the BeanDefinitionDocumentReader interface.
 Parses bean definitions according to the "faces-config" DTD.
 
 
 Tries to build and register bean definitions of type
 ManagedBeanDefinition parsed from
 the "managed-bean"-elements. Futhermode this parser is able to parse
 definitions according to the spring beans DTD.
 
MessageSourceapplication scope defined in the faces
 configuration file in the "managed-bean-scope" tag is interpreted as
 singleton
ManagedBeanDefinition| Nested Class Summary | |
|---|---|
static class | 
ManagedBeanDefinitionDocumentReader.FacesHierarchicalMessageSource
JSF implementation of a HierarchicalMessageSource. | 
| Field Summary | |
|---|---|
static java.lang.String | 
BEAN_ELEMENT
<managed-bean></managed-bean> element.  | 
static java.lang.String | 
CLASS_ELEMENT
<managed-bean-class></managed-bean-class> element.  | 
static java.lang.String | 
DEFAULT_LOCALE_ELEMENT
<default-locale></default-locale> element.  | 
static java.lang.String | 
ID_ATTRIBUTE
id attribute of the <managed-bean></managed-bean> element.  | 
static java.lang.String | 
KEY_CLASS_ELEMENT
<key-class></key-class> element.  | 
static java.lang.String | 
KEY_ELEMENT
<key></key> element.  | 
static java.lang.String | 
LIST_ENTRIES_ELEMENT
<list-entries></list-entries> element.  | 
static java.lang.String | 
LOCALE_CONFIG_ELEMENT
<locale-config></locale-config> element.  | 
protected  org.apache.commons.logging.Log | 
logger
For logging.  | 
static java.lang.String | 
MAP_ENTRIES_ELEMENT
<map-entries></map-entries> element.  | 
static java.lang.String | 
MAP_ENTRY_ELEMENT
<map-entry></map-entry> element.  | 
static java.lang.String | 
MESSAGE_BUNDLE_ELEMENT
<message-bundle></message-bundle> element.  | 
static java.lang.String | 
NAME_ELEMENT
<managed-bean-name></managed-bean-name> element.  | 
static java.lang.String | 
NULL_VALUE_ELEMENT
<null-value></null-value> element.  | 
static java.lang.String | 
PROPERTY_CLASS_ELEMENT
<property-class></property-class> element.  | 
static java.lang.String | 
PROPERTY_ELEMENT
<managed-property></managed-property> element.  | 
static java.lang.String | 
PROPERTY_NAME_ELEMENT
<property-name></property-name> element.  | 
static java.lang.String | 
ROOT_ELEMENT
<faces-config></faces-config> element.  | 
static java.lang.String | 
SCOPE_ELEMENT
<managed-bean-scope></managed-bean-scope> element.  | 
static java.lang.String | 
SUPPORTED_LOCALE_ELEMENT
<supported-locale></supported-locale> element.  | 
static java.lang.String | 
VALUE_CLASS_ELEMENT
<value-class></value-class> element.  | 
static java.lang.String | 
VALUE_ELEMENT
<value></value> element.  | 
| Constructor Summary | |
|---|---|
ManagedBeanDefinitionDocumentReader()
 | 
|
| Method Summary | |
|---|---|
protected  void | 
addSupportedLocales(ManagedList supportedLocales,
                    org.w3c.dom.Element localeConfigElement,
                    java.lang.String beanName)
Adds the supported locales to the MessageResource
 definition defined as a "locale-config" tag in the "faces-config.xml". | 
protected  BeanDefinitionDocumentReader | 
createDefaultBeanDefinitionDocumentReader()
Creates a BeanDefinitionDocumentReader that parses bean
 definitions other than managed beans according to the "faces-config" DTD. | 
protected  void | 
error(java.lang.String message,
      org.w3c.dom.Element source)
Report an error with the given message for the given source element.  | 
protected  void | 
error(java.lang.String message,
      org.w3c.dom.Element source,
      java.lang.Throwable cause)
Report an error with the given message for the given source element.  | 
protected  java.lang.String | 
getDefaultLocale(org.w3c.dom.Element localeConfigElement,
                 java.lang.String beanName)
Parses and returns the default locale from the given locale config DOM element.  | 
protected  XmlReaderContext | 
getReaderContext()
 | 
protected static java.lang.String | 
getTextValue(org.w3c.dom.Element element)
Extract the text value from the given DOM element, ignoring XML comments.  | 
protected  BeanDefinition | 
parseManagedBeanDefinition(org.w3c.dom.Element element,
                           java.lang.String beanName)
Parses a standard faces managed bean definition.  | 
protected  ConstructorArgumentValues | 
parseManagedBeanListEntries(org.w3c.dom.Element element,
                            java.lang.String beanName)
Parses list-entries subelements of the given MANAGED-BEAN element.  | 
protected  ConstructorArgumentValues | 
parseManagedBeanMapEntries(org.w3c.dom.Element element,
                           java.lang.String beanName)
Parses map-entries subelements of the given MANAGED-BEAN element.  | 
protected  void | 
parseManagedBeanPropertyDefinition(MutablePropertyValues propertyValues,
                                   org.w3c.dom.Element element,
                                   java.lang.String beanName)
Parses a managed-property.  | 
 void | 
registerBeanDefinitions(org.w3c.dom.Document doc,
                        XmlReaderContext context)
Read bean definitions from the given DOM document, and register them with the given bean factory.  | 
protected  void | 
registerManagedBeanDefinition(org.w3c.dom.Element element)
Parses an element definition: We know this is a MANAGED-BEAN element.  | 
protected  void | 
registerManagedBeanDefinitions(org.w3c.dom.Document doc)
Parses bean definitions from the given DOM document, and register them with the help of the given XmlReaderContext. | 
protected  void | 
registerMessageBeanDefinitions(org.w3c.dom.NodeList messageBundleElements,
                               org.w3c.dom.NodeList localeConfigElements)
Loads the MessageSource definition as a
 RootBeanDefinition
 defined in the "faces-config.xml" as a "message-bundle" tag. | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final java.lang.String ROOT_ELEMENT
public static final java.lang.String MESSAGE_BUNDLE_ELEMENT
public static final java.lang.String LOCALE_CONFIG_ELEMENT
public static final java.lang.String DEFAULT_LOCALE_ELEMENT
public static final java.lang.String SUPPORTED_LOCALE_ELEMENT
public static final java.lang.String BEAN_ELEMENT
public static final java.lang.String ID_ATTRIBUTE
public static final java.lang.String NAME_ELEMENT
public static final java.lang.String CLASS_ELEMENT
public static final java.lang.String SCOPE_ELEMENT
public static final java.lang.String PROPERTY_ELEMENT
public static final java.lang.String PROPERTY_NAME_ELEMENT
public static final java.lang.String PROPERTY_CLASS_ELEMENT
public static final java.lang.String VALUE_ELEMENT
public static final java.lang.String VALUE_CLASS_ELEMENT
public static final java.lang.String NULL_VALUE_ELEMENT
public static final java.lang.String MAP_ENTRIES_ELEMENT
public static final java.lang.String MAP_ENTRY_ELEMENT
public static final java.lang.String KEY_ELEMENT
public static final java.lang.String KEY_CLASS_ELEMENT
public static final java.lang.String LIST_ENTRIES_ELEMENT
protected final org.apache.commons.logging.Log logger
| Constructor Detail | 
|---|
public ManagedBeanDefinitionDocumentReader()
| Method Detail | 
|---|
protected static java.lang.String getTextValue(org.w3c.dom.Element element)
element - the given DOM element
protected final void error(java.lang.String message,
                           org.w3c.dom.Element source)
message - The message to reportsource - The Element source of the error to report
protected final void error(java.lang.String message,
                           org.w3c.dom.Element source,
                           java.lang.Throwable cause)
message - The message to reportsource - The Element source of the error to reportcause - The cause of the error if any
public final void registerBeanDefinitions(org.w3c.dom.Document doc,
                                          XmlReaderContext context)
registerBeanDefinitions in interface BeanDefinitionDocumentReaderdoc - the DOM documentcontext - the current context of the reader. Includes the resource being parsedprotected BeanDefinitionDocumentReader createDefaultBeanDefinitionDocumentReader()
BeanDefinitionDocumentReader that parses bean
 definitions other than managed beans according to the "faces-config" DTD.
 
 
 Default implementation returns a
 DefaultBeanDefinitionDocumentReader. May be overriden in
 subclasses.
 
BeanDefinitionDocumentReaderprotected void registerManagedBeanDefinitions(org.w3c.dom.Document doc)
XmlReaderContext.
doc - the DOM documentprotected void registerManagedBeanDefinition(org.w3c.dom.Element element)
element - the DOM element representing a MANAGED-BEAN
protected BeanDefinition parseManagedBeanDefinition(org.w3c.dom.Element element,
                                                    java.lang.String beanName)
element - the DOM element representing a MANAGED-BEANbeanName - the name of the bean represented by the delivered
            BeanDefinition
ManagedBeanDefinition
protected ConstructorArgumentValues parseManagedBeanListEntries(org.w3c.dom.Element element,
                                                                java.lang.String beanName)
element - the DOM element representing a MANAGED-BEAN elementbeanName - the name of the bean represented by the delivered
            BeanDefinition
PropertyValue
protected ConstructorArgumentValues parseManagedBeanMapEntries(org.w3c.dom.Element element,
                                                               java.lang.String beanName)
element - the DOM element representing a MANAGED-BEAN elementbeanName - the name of the bean represented by the delivered
            BeanDefinition
PropertyValue
protected void parseManagedBeanPropertyDefinition(MutablePropertyValues propertyValues,
                                                  org.w3c.dom.Element element,
                                                  java.lang.String beanName)
propertyValues - MutablePropertyValues representing the properties defined for
            this managed bean definitionelement - the managed property definitionbeanName - the name of the bean represented by the delivered
            BeanDefinition
protected void registerMessageBeanDefinitions(org.w3c.dom.NodeList messageBundleElements,
                                              org.w3c.dom.NodeList localeConfigElements)
MessageSource definition as a
 RootBeanDefinition
 defined in the "faces-config.xml" as a "message-bundle" tag.
messageBundleElements - the DOM nodelist representing message bundle definitionslocaleConfigElements - the DOM nodelist representing locale config definitions
protected void addSupportedLocales(ManagedList supportedLocales,
                                   org.w3c.dom.Element localeConfigElement,
                                   java.lang.String beanName)
MessageResource
 definition defined as a "locale-config" tag in the "faces-config.xml".
supportedLocales - the locale definitions to supportlocaleConfigElement - the DOM element representing a locale config definitionbeanName - the name of the bean represented by the delivered
            BeanDefinition
protected java.lang.String getDefaultLocale(org.w3c.dom.Element localeConfigElement,
                                            java.lang.String beanName)
localeConfigElement - the DOM element representing the locale config definitionbeanName - the name of the bean represented by the delivered
            BeanDefinition
protected final XmlReaderContext getReaderContext()
XmlReaderContext
  | 
JSF-Spring | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||