org.apache.xbean.spring.context.impl
Class MappingMetaData

java.lang.Object
  extended by org.apache.xbean.spring.context.impl.MappingMetaData

public class MappingMetaData
extends Object

A helper class which understands how to map an XML namespaced element to Spring bean configurations

Since:
2.0
Author:
James Strachan

Constructor Summary
MappingMetaData(Properties properties)
          Creates MappingMetaData using the specified properties which contan the package name.
MappingMetaData(String packageName)
          Creates an empty MappingMetaData for the specified Java package.
 
Method Summary
static String constructorToPropertyName(Constructor constructor)
           
 String getClassName(String localName)
          Returns the Java class name for the given XML element name
 String getContentProperty(String elementName)
           
 String getDestroyMethodName(String elementName)
           
 String getFactoryMethodName(String elementName)
           
 String getFlatCollectionProperty(String elementName, String property)
           
 String getInitMethodName(String elementName)
           
 String getMapDefaultKey(String elementName, String property)
           
 String getMapDupsMode(String elementName, String property)
           
 String getMapEntryName(String elementName, String property)
           
 String getMapKeyName(String elementName, String property)
           
 String getNestedListProperty(String elementName, String childElementName)
          Returns a valid property name if the childElementName maps to a nested list property
 String getNestedProperty(String elementName, String childElementName)
          Returns a valid property name if the childElementName maps to a nested bean property
 String[] getParameterNames(Class beanClass, Method factoryMethod)
           
 String[] getParameterNames(Constructor constructor)
           
 String getPropertyEditor(String elementName, String property)
           
 String getPropertyName(String elementName, String attributeName)
          Returns the property name for the given element and attribute name
 boolean isDefaultConstructor(Constructor constructor)
           
 boolean isDefaultFactoryMethod(Class beanClass, Method factoryMethod)
           
 boolean isFlatMap(String elementName, String property)
           
 boolean isFlatProperty(String elementName, String property)
           
static String methodToPropertyName(Class beanClass, Method method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingMetaData

public MappingMetaData(String packageName)
Creates an empty MappingMetaData for the specified Java package.

Parameters:
packageName - the Java package to map

MappingMetaData

public MappingMetaData(Properties properties)
Creates MappingMetaData using the specified properties which contan the package name.

Parameters:
properties -
Method Detail

getClassName

public String getClassName(String localName)
Returns the Java class name for the given XML element name


getPropertyName

public String getPropertyName(String elementName,
                              String attributeName)
Returns the property name for the given element and attribute name

Parameters:
elementName - the XML local name of the element
attributeName - the XML local name of the attribute
Returns:
the property name to use or null if the attribute is not a valid property

getNestedListProperty

public String getNestedListProperty(String elementName,
                                    String childElementName)
Returns a valid property name if the childElementName maps to a nested list property

Parameters:
elementName - the owner element
childElementName - is the child element name which maps to the nested list property
Returns:
the property name if available or null if it is not applicable

getNestedProperty

public String getNestedProperty(String elementName,
                                String childElementName)
Returns a valid property name if the childElementName maps to a nested bean property

Parameters:
elementName - the owner element
childElementName - is the child element name which maps to the nested bean property
Returns:
the property name if available or null if it is not applicable

isDefaultConstructor

public boolean isDefaultConstructor(Constructor constructor)

isDefaultFactoryMethod

public boolean isDefaultFactoryMethod(Class beanClass,
                                      Method factoryMethod)

getParameterNames

public String[] getParameterNames(Constructor constructor)

getParameterNames

public String[] getParameterNames(Class beanClass,
                                  Method factoryMethod)

constructorToPropertyName

public static String constructorToPropertyName(Constructor constructor)

methodToPropertyName

public static String methodToPropertyName(Class beanClass,
                                          Method method)

getInitMethodName

public String getInitMethodName(String elementName)

getDestroyMethodName

public String getDestroyMethodName(String elementName)

getFactoryMethodName

public String getFactoryMethodName(String elementName)

getContentProperty

public String getContentProperty(String elementName)

getMapEntryName

public String getMapEntryName(String elementName,
                              String property)

getMapKeyName

public String getMapKeyName(String elementName,
                            String property)

isFlatMap

public boolean isFlatMap(String elementName,
                         String property)

getMapDupsMode

public String getMapDupsMode(String elementName,
                             String property)

getMapDefaultKey

public String getMapDefaultKey(String elementName,
                               String property)

getFlatCollectionProperty

public String getFlatCollectionProperty(String elementName,
                                        String property)

isFlatProperty

public boolean isFlatProperty(String elementName,
                              String property)

getPropertyEditor

public String getPropertyEditor(String elementName,
                                String property)


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.