public abstract class NamespaceUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BASE_PACKAGE |
static String |
METHOD_ATTRIBUTE |
static String |
ORDER |
static String |
REF_ATTRIBUTE |
Constructor and Description |
---|
NamespaceUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addConstructorArgBooleanValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName,
boolean defaultValue)
Populates the bean definition constructor argument with the boolean value of that attribute if it is defined in
the given element or else uses the default provided.
|
static boolean |
addConstructorArgParentRefIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName)
Populates the bean definition constructor argument with a reference to a bean with parent id equal to the
attribute if it is defined in the given element.
|
static boolean |
addConstructorArgRefIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName)
Populates the bean definition constructor argument with a reference to a bean with id equal to the attribute if
it is defined in the given element.
|
static boolean |
addConstructorArgValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName)
Populates the bean definition constructor argument with the value of that attribute if it is defined in the given
element.
|
static String |
createElementDescription(Element element)
Provides a user friendly description of an element based on its node name and, if available, its "id" attribute
value.
|
static org.springframework.beans.factory.config.BeanDefinition |
createExpressionDefIfAttributeDefined(String expressionElementName,
Element element) |
static org.springframework.beans.factory.config.BeanDefinition |
createExpressionDefinitionFromValueOrExpression(String valueElementName,
String expressionElementName,
org.springframework.beans.factory.xml.ParserContext parserContext,
Element element,
boolean oneRequired) |
static boolean |
isAttributeDefined(Element element,
String attributeName)
Checks the attribute to see if it is defined in the given element.
|
static void |
parseDeclarationControls(Element element,
org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Parses 'auto-declare' and 'declared-by' attributes.
|
static org.springframework.beans.factory.parsing.BeanComponentDefinition |
parseInnerBeanDefinition(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext) |
static boolean |
setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName)
Populates the bean definition property corresponding to the specified attributeName with the reference to a bean
identified by the value of that attribute if the attribute is defined in the given element.
|
static boolean |
setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName)
Populates the specified bean definition property with the reference to a bean.
|
static boolean |
setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName)
Populates the bean definition property corresponding to the specified attributeName with the value of that
attribute if it is defined in the given element.
|
static boolean |
setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName)
Populates the specified bean definition property with the value of the attribute whose name is provided if that
attribute is defined in the given element.
|
public static final String BASE_PACKAGE
public static final String REF_ATTRIBUTE
public static final String METHOD_ATTRIBUTE
public static final String ORDER
public static boolean setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used to populate the propertypropertyName
- the name of the property to be populatedpublic static boolean setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName)
The property name will be the camel-case equivalent of the lower case hyphen separated attribute (e.g. the "foo-bar" attribute would match the "fooBar" property).
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be set on the propertyConventions.attributeNameToPropertyName(String)
public static boolean isAttributeDefined(Element element, String attributeName)
element
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used as a constructor argumentpublic static boolean addConstructorArgValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used as a constructor argumentpublic static void addConstructorArgBooleanValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName, boolean defaultValue)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used as a constructor argumentdefaultValue
- the default value to use if the attirbute is not setpublic static boolean addConstructorArgRefIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used to set the referencepublic static boolean addConstructorArgParentRefIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used to set the referencepublic static boolean setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName)
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used as a bean reference to populate the
propertypropertyName
- the name of the property to be populatedpublic static boolean setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attributeName)
The property name will be the camel-case equivalent of the lower case hyphen separated attribute (e.g. the "foo-bar" attribute would match the "fooBar" property).
builder
- the bean definition builder to be configuredelement
- the XML element where the attribute should be definedattributeName
- the name of the attribute whose value will be used as a bean reference to populate the
propertyConventions.attributeNameToPropertyName(String)
public static String createElementDescription(Element element)
element
- The element.public static org.springframework.beans.factory.parsing.BeanComponentDefinition parseInnerBeanDefinition(Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
public static void parseDeclarationControls(Element element, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
element
- The element.builder
- The builder.public static org.springframework.beans.factory.config.BeanDefinition createExpressionDefinitionFromValueOrExpression(String valueElementName, String expressionElementName, org.springframework.beans.factory.xml.ParserContext parserContext, Element element, boolean oneRequired)