Package org.x2jb.bind.spi.handler

Examples of org.x2jb.bind.spi.handler.ElementHandler


     */
    static Object bindElementToObject( final Element value, final BeanImpl bean )
    {
        final Class< ? > handlerClass = bean.getTypeHandler();
        final Class< ? > clazz = bean.getType();
        ElementHandler handler;

        if ( handlerClass == null )
        {
            handler = ( ElementHandler ) HandlersRepository.getDefaultHandler( bean, true );
        }
        else
        {
            handler = ( ElementHandler ) HandlersRepository.getUserHandler( bean, true );
        }

        return handler.bind( value, clazz );
    }
View Full Code Here


    static Object bindElementsToObjectArray( final List< Element > values, final BeanImpl bean )
    {
        final Class< ? > clazz = bean.getType();
        final Object array = ReflectionUtils.newArrayInstance( clazz, values.size() );
        final Class< ? > handlerClass = bean.getTypeHandler();
        ElementHandler handler;

        if ( handlerClass == null )
        {
            handler = ( ElementHandler ) HandlersRepository.getDefaultHandler( bean, true );
        }
        else
        {
            handler = ( ElementHandler ) HandlersRepository.getUserHandler( bean, true );
        }

        for ( int index = 0; index < values.size(); index++ )
        {
            final Object boundValue = handler.bind( values.get( index ), clazz );
            ReflectionUtils.setArrayValue( array, index, boundValue );
        }

        return array;
    }
View Full Code Here

TOP

Related Classes of org.x2jb.bind.spi.handler.ElementHandler

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.