Package org.apache.commons.betwixt.strategy

Examples of org.apache.commons.betwixt.strategy.NameMapper


     * @param configuration IntrospectionConfiguration, not null
     */
    private void configureDescriptor(
        NodeDescriptor descriptor,
        IntrospectionConfiguration configuration) {
        NameMapper nameMapper = configuration.getElementNameMapper();
        if (descriptor instanceof AttributeDescriptor) {
            // we want to use the attributemapper only when it is an attribute..
            nameMapper = configuration.getAttributeNameMapper();
       
        }          
        descriptor.setLocalName( nameMapper.mapTypeToElementName( propertyName ));
        descriptor.setPropertyName( getPropertyName() );
        descriptor.setPropertyType( getPropertyType() );
    }
View Full Code Here


       
       
        if ( configuration.isWrapCollectionsInElement() ) {
            ElementDescriptor wrappingDescriptor = new ElementDescriptor();
            wrappingDescriptor.setElementDescriptors( new ElementDescriptor[] { entryDescriptor } );
            NameMapper nameMapper = configuration.getElementNameMapper();  
            wrappingDescriptor.setLocalName( nameMapper.mapTypeToElementName( propertyName ));          
            result = wrappingDescriptor;
                       
        } else {
            result = entryDescriptor;
        }
View Full Code Here

     * @param configuration IntrospectionConfiguration, not null
     */
    private void configureDescriptor(
        NodeDescriptor descriptor,
        IntrospectionConfiguration configuration) {
        NameMapper nameMapper = configuration.getElementNameMapper();
        if (descriptor instanceof AttributeDescriptor) {
            // we want to use the attributemapper only when it is an attribute..
            nameMapper = configuration.getAttributeNameMapper();
       
        }          
        descriptor.setLocalName( nameMapper.mapTypeToElementName( propertyName ));
        descriptor.setPropertyName( getPropertyName() );
        descriptor.setPropertyType( getPropertyType() );
    }
View Full Code Here

       
       
        if ( configuration.isWrapCollectionsInElement() ) {
            ElementDescriptor wrappingDescriptor = new ElementDescriptor();
            wrappingDescriptor.setElementDescriptors( new ElementDescriptor[] { entryDescriptor } );
            NameMapper nameMapper = configuration.getElementNameMapper();  
            wrappingDescriptor.setLocalName( nameMapper.mapTypeToElementName( propertyName ));          
            result = wrappingDescriptor;
                       
        } else {
            result = entryDescriptor;
        }
View Full Code Here

     * @param configuration IntrospectionConfiguration, not null
     */
    private void configureDescriptor(
        NodeDescriptor descriptor,
        IntrospectionConfiguration configuration) {
        NameMapper nameMapper = configuration.getElementNameMapper();
        if (descriptor instanceof AttributeDescriptor) {
            // we want to use the attributemapper only when it is an attribute..
            nameMapper = configuration.getAttributeNameMapper();
       
        }          
        descriptor.setLocalName( nameMapper.mapTypeToElementName( propertyName ));
        descriptor.setPropertyName( getPropertyName() );
        descriptor.setPropertyType( getPropertyType() );
    }
View Full Code Here

       
       
        if ( configuration.isWrapCollectionsInElement() ) {
            ElementDescriptor wrappingDescriptor = new ElementDescriptor();
            wrappingDescriptor.setElementDescriptors( new ElementDescriptor[] { entryDescriptor } );
            NameMapper nameMapper = configuration.getElementNameMapper();  
            wrappingDescriptor.setLocalName( nameMapper.mapTypeToElementName( propertyName ));          
            result = wrappingDescriptor;
                       
        } else {
            result = entryDescriptor;
        }
View Full Code Here

    private XMLIntrospector createXMLIntrospector()
    {
        XMLIntrospector introspector = new XMLIntrospector();

        introspector.setAttributesForPrimitives(false);
        NameMapper mapper = new DecapitalizeNameMapper();       
        introspector.setElementNameMapper(mapper);
        introspector.setAttributeNameMapper(mapper);
       
        introspector.setPluralStemmer(new DefaultPluralStemmer());
View Full Code Here

TOP

Related Classes of org.apache.commons.betwixt.strategy.NameMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.