public class YarnNamespaceUtils extends Object
| Constructor and Description |
|---|
YarnNamespaceUtils() |
| Modifier and Type | Method and Description |
|---|---|
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 BeanComponentDefinition |
parseInnerHandlerDefinition(Element element,
ParserContext parserContext)
Parses inner bean definition from an dom element.
|
static boolean |
setCSVReferenceProperty(Element element,
BeanDefinitionBuilder builder,
String attrName,
String propertyName)
Sets the reference property as list from a comma delimited string.
|
static void |
setReferenceIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName)
Configures the provided bean definition builder with a property reference
to a bean.
|
static void |
setReferenceIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String defaultName)
Configures the provided bean definition builder with a property reference
to a bean.
|
static void |
setReferenceIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName,
String defaultName)
Configures the provided bean definition builder with a property reference
to a bean.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName)
Configures the provided bean definition builder with a property value
corresponding to the attribute whose name is provided if that attribute
is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
boolean emptyStringAllowed)
Configures the provided bean definition builder with a property value
corresponding to the attribute whose name is provided if that attribute
is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
boolean emptyStringAllowed,
String defaultPropertyValue)
Configures the provided bean definition builder with a property value
corresponding to the attribute whose name is provided if that attribute
is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName)
Configures the provided bean definition builder with a property value
corresponding to the attribute whose name is provided if that attribute
is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName,
boolean emptyStringAllowed)
Configures the provided bean definition builder with a property value
corresponding to the attribute whose name is provided if that attribute
is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName,
boolean emptyStringAllowed,
String defaultPropertyValue)
Configures the provided bean definition builder with a property value
corresponding to the attribute whose name is provided if that attribute
is defined in the given element.
|
static void |
setValueIfAttributeDefined(BeanDefinitionBuilder builder,
Element element,
String attributeName,
String propertyName,
String defaultPropertyValue)
Configures the provided bean definition builder with a property value
corresponding to the attribute whose name is provided if that attribute
is defined in the given element.
|
public static void setValueIfAttributeDefined(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 void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName, String defaultPropertyValue)
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 populateddefaultPropertyValue - Property value to use as defaultpublic static void setValueIfAttributeDefined(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 void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName, boolean emptyStringAllowed)
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 populatedemptyStringAllowed - if true, the value is set, even if an empty String (""); if
false, an empty String is treated as if the attribute wasn't provided.public static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName, boolean emptyStringAllowed, String defaultPropertyValue)
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 populatedemptyStringAllowed - if true, the value is set, even if an empty String (""); if
false, an empty String is treated as if the attribute wasn't provided.defaultPropertyValue - Property value to use as defaultpublic static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, boolean emptyStringAllowed)
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 propertyemptyStringAllowed - if true, the value is set, even if an empty String (""); if
false, an empty String is treated as if the attribute wasn't provided.Conventions.attributeNameToPropertyName(String)public static void setValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, boolean emptyStringAllowed, String defaultPropertyValue)
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 propertyemptyStringAllowed - if true, the value is set, even if an empty String (""); if
false, an empty String is treated as if the attribute wasn't provided.defaultPropertyValue - Property value to use as defaultConventions.attributeNameToPropertyName(String)public static void setReferenceIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String propertyName, String defaultName)
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 propertydefaultName - the default bean reference name to usepropertyName - the name of the property to be populatedpublic static void setReferenceIfAttributeDefined(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),
Conventions.attributeNameToPropertyName(String)public static void setReferenceIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName, String defaultName)
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 propertydefaultName - the default bean reference name to useConventions.attributeNameToPropertyName(String),
Conventions.attributeNameToPropertyName(String)public static BeanComponentDefinition parseInnerHandlerDefinition(Element element, ParserContext parserContext)
element - the dom elementparserContext - the parser contextpublic static String createElementDescription(Element element)
element - the dom elementpublic static boolean setCSVReferenceProperty(Element element, BeanDefinitionBuilder builder, String attrName, String propertyName)
element - the elementbuilder - the builderattrName - the attr namepropertyName - the property name