Spring for Apache Hadoop

org.springframework.yarn.config
Class YarnNamespaceUtils

java.lang.Object
  extended by org.springframework.yarn.config.YarnNamespaceUtils

public class YarnNamespaceUtils
extends java.lang.Object

Shared utility methods for yarn namespace parsers.

Author:
Janne Valkealahti

Constructor Summary
YarnNamespaceUtils()
           
 
Method Summary
static java.lang.String createElementDescription(org.w3c.dom.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.parsing.BeanComponentDefinition parseInnerHandlerDefinition(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parses inner bean definition from an dom element.
static void setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName)
          Configures the provided bean definition builder with a property reference to a bean.
static void setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName, java.lang.String defaultName)
          Configures the provided bean definition builder with a property reference to a bean.
static void setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName, java.lang.String propertyName, java.lang.String defaultName)
          Configures the provided bean definition builder with a property reference to a bean.
static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.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(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.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(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName, boolean emptyStringAllowed, java.lang.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(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName, java.lang.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(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName, java.lang.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(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName, java.lang.String propertyName, boolean emptyStringAllowed, java.lang.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(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.w3c.dom.Element element, java.lang.String attributeName, java.lang.String propertyName, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YarnNamespaceUtils

public YarnNamespaceUtils()
Method Detail

setValueIfAttributeDefined

public static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                              org.w3c.dom.Element element,
                                              java.lang.String attributeName,
                                              java.lang.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.

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be used to populate the property
propertyName - the name of the property to be populated

setValueIfAttributeDefined

public static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                              org.w3c.dom.Element element,
                                              java.lang.String attributeName,
                                              java.lang.String propertyName,
                                              java.lang.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.

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be used to populate the property
propertyName - the name of the property to be populated
defaultPropertyValue - Property value to use as default

setValueIfAttributeDefined

public static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                              org.w3c.dom.Element element,
                                              java.lang.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.

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).

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be set on the property
See Also:
Conventions.attributeNameToPropertyName(String)

setValueIfAttributeDefined

public static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                              org.w3c.dom.Element element,
                                              java.lang.String attributeName,
                                              java.lang.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.

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be used to populate the property
propertyName - the name of the property to be populated
emptyStringAllowed - 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.

setValueIfAttributeDefined

public static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                              org.w3c.dom.Element element,
                                              java.lang.String attributeName,
                                              java.lang.String propertyName,
                                              boolean emptyStringAllowed,
                                              java.lang.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.

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be used to populate the property
propertyName - the name of the property to be populated
emptyStringAllowed - 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 default

setValueIfAttributeDefined

public static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                              org.w3c.dom.Element element,
                                              java.lang.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.

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).

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be set on the property
emptyStringAllowed - 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.
See Also:
Conventions.attributeNameToPropertyName(String)

setValueIfAttributeDefined

public static void setValueIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                              org.w3c.dom.Element element,
                                              java.lang.String attributeName,
                                              boolean emptyStringAllowed,
                                              java.lang.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.

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).

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be set on the property
emptyStringAllowed - 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 default
See Also:
Conventions.attributeNameToPropertyName(String)

setReferenceIfAttributeDefined

public static void setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                                  org.w3c.dom.Element element,
                                                  java.lang.String attributeName,
                                                  java.lang.String propertyName,
                                                  java.lang.String defaultName)
Configures the provided bean definition builder with a property reference to a bean. The bean reference is identified by the value from the attribute whose name is provided if that attribute is defined in the given element.

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be used as a bean reference to populate the property
defaultName - the default bean reference name to use
propertyName - the name of the property to be populated

setReferenceIfAttributeDefined

public static void setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                                  org.w3c.dom.Element element,
                                                  java.lang.String attributeName)
Configures the provided bean definition builder with a property reference to a bean. The bean reference is identified by the value from the attribute whose name is provided if that attribute is defined in the given element.

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).

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be used as a bean reference to populate the property
See Also:
Conventions.attributeNameToPropertyName(String), Conventions.attributeNameToPropertyName(String)

setReferenceIfAttributeDefined

public static void setReferenceIfAttributeDefined(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                                  org.w3c.dom.Element element,
                                                  java.lang.String attributeName,
                                                  java.lang.String defaultName)
Configures the provided bean definition builder with a property reference to a bean. The bean reference is identified by the value from the attribute whose name is provided if that attribute is defined in the given element.

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).

Parameters:
builder - the bean definition builder to be configured
element - the XML element where the attribute should be defined
attributeName - the name of the attribute whose value will be used as a bean reference to populate the property
defaultName - the default bean reference name to use
See Also:
Conventions.attributeNameToPropertyName(String), Conventions.attributeNameToPropertyName(String)

parseInnerHandlerDefinition

public static org.springframework.beans.factory.parsing.BeanComponentDefinition parseInnerHandlerDefinition(org.w3c.dom.Element element,
                                                                                                            org.springframework.beans.factory.xml.ParserContext parserContext)
Parses inner bean definition from an dom element.

Parameters:
element - the dom element
parserContext - the parser context
Returns:
bean component definition

createElementDescription

public static java.lang.String createElementDescription(org.w3c.dom.Element element)
Provides a user friendly description of an element based on its node name and, if available, its "id" attribute value. This is useful for creating error messages from within bean definition parsers.

Parameters:
element - the dom element
Returns:
user friendly element description

Spring for Apache Hadoop