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

java.lang.Object
  extended byorg.apache.xbean.spring.context.impl.MappingMetaData

public class MappingMetaData
extends java.lang.Object

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

Since:
2.0
Version:
$Id$
Author:
James Strachan

Constructor Summary
MappingMetaData(java.util.Properties properties)
          Creates MappingMetaData using the specified properties which contan the package name.
MappingMetaData(java.lang.String packageName)
          Creates an empty MappingMetaData for the specified Java package.
 
Method Summary
static java.lang.String constructorToPropertyName(java.lang.reflect.Constructor constructor)
           
 java.lang.String getClassName(java.lang.String localName)
          Returns the Java class name for the given XML element name
 java.lang.String getContentProperty(java.lang.String elementName)
           
 java.lang.String getDestroyMethodName(java.lang.String elementName)
           
 java.lang.String getFactoryMethodName(java.lang.String elementName)
           
 java.lang.String getFlatCollectionProperty(java.lang.String elementName, java.lang.String property)
           
 java.lang.String getInitMethodName(java.lang.String elementName)
           
 java.lang.String getMapEntryName(java.lang.String elementName, java.lang.String property)
           
 java.lang.String getMapKeyName(java.lang.String elementName, java.lang.String property)
           
 java.lang.String getNestedListProperty(java.lang.String elementName, java.lang.String childElementName)
          Returns a valid property name if the childElementName maps to a nested list property
 java.lang.String getNestedProperty(java.lang.String elementName, java.lang.String childElementName)
          Returns a valid property name if the childElementName maps to a nested bean property
 java.lang.String[] getParameterNames(java.lang.Class beanClass, java.lang.reflect.Method factoryMethod)
           
 java.lang.String[] getParameterNames(java.lang.reflect.Constructor constructor)
           
 java.lang.String getPropertyName(java.lang.String elementName, java.lang.String attributeName)
          Returns the property name for the given element and attribute name
 boolean isDefaultConstructor(java.lang.reflect.Constructor constructor)
           
 boolean isDefaultFactoryMethod(java.lang.Class beanClass, java.lang.reflect.Method factoryMethod)
           
 boolean isFlatProperty(java.lang.String elementName, java.lang.String property)
           
static java.lang.String methodToPropertyName(java.lang.Class beanClass, java.lang.reflect.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(java.lang.String packageName)
Creates an empty MappingMetaData for the specified Java package.

Parameters:
packageName - the Java package to map

MappingMetaData

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

Parameters:
properties -
Method Detail

getClassName

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


getPropertyName

public java.lang.String getPropertyName(java.lang.String elementName,
                                        java.lang.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 java.lang.String getNestedListProperty(java.lang.String elementName,
                                              java.lang.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 java.lang.String getNestedProperty(java.lang.String elementName,
                                          java.lang.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(java.lang.reflect.Constructor constructor)

isDefaultFactoryMethod

public boolean isDefaultFactoryMethod(java.lang.Class beanClass,
                                      java.lang.reflect.Method factoryMethod)

getParameterNames

public java.lang.String[] getParameterNames(java.lang.reflect.Constructor constructor)

getParameterNames

public java.lang.String[] getParameterNames(java.lang.Class beanClass,
                                            java.lang.reflect.Method factoryMethod)

constructorToPropertyName

public static java.lang.String constructorToPropertyName(java.lang.reflect.Constructor constructor)

methodToPropertyName

public static java.lang.String methodToPropertyName(java.lang.Class beanClass,
                                                    java.lang.reflect.Method method)

getInitMethodName

public java.lang.String getInitMethodName(java.lang.String elementName)

getDestroyMethodName

public java.lang.String getDestroyMethodName(java.lang.String elementName)

getFactoryMethodName

public java.lang.String getFactoryMethodName(java.lang.String elementName)

getContentProperty

public java.lang.String getContentProperty(java.lang.String elementName)

getMapEntryName

public java.lang.String getMapEntryName(java.lang.String elementName,
                                        java.lang.String property)

getMapKeyName

public java.lang.String getMapKeyName(java.lang.String elementName,
                                      java.lang.String property)

getFlatCollectionProperty

public java.lang.String getFlatCollectionProperty(java.lang.String elementName,
                                                  java.lang.String property)

isFlatProperty

public boolean isFlatProperty(java.lang.String elementName,
                              java.lang.String property)


Copyright © {inceptionYear}-2006 Apache Software Foundation. All Rights Reserved.