Package org.codehaus.plexus.util.introspection

Examples of org.codehaus.plexus.util.introspection.ClassMap


                    catch ( NumberFormatException e )
                    {
                    }
                }

                final ClassMap classMap = getClassMap( value.getClass() );

                final String methodBase = StringUtils.capitalizeFirstLetter( token );

                String methodName = "get" + methodBase;

                Method method = classMap.findMethod( methodName, CLASS_ARGS );

                if ( method == null )
                {
                    // perhaps this is a boolean property??
                    methodName = "is" + methodBase;

                    method = classMap.findMethod( methodName, CLASS_ARGS );
                }

                if ( method == null )
                {
                    return null;
                }

                value = method.invoke( value, OBJECT_ARGS );
                if ( value == null )
                {
                    return null;
                }
                if ( Collection.class.isAssignableFrom( value.getClass() ) )
                {
                    ClassMap classMap2 = getClassMap( value.getClass() );

                    Method method2 = classMap2.findMethod( "toArray", CLASS_ARGS );

                    value = method2.invoke( value, OBJECT_ARGS );
                }
                if ( value.getClass().isArray() )
                {
View Full Code Here


            return value;
        }

        private static ClassMap getClassMap( Class<? extends Object> clazz )
        {
            ClassMap classMap = classMaps.get( clazz );

            if ( classMap == null )
            {
                classMap = new ClassMap( clazz );

                classMaps.put( clazz, classMap );
            }

            return classMap;
View Full Code Here

                    catch ( NumberFormatException e )
                    {
                    }
                }

                final ClassMap classMap = getClassMap( value.getClass() );

                final String methodBase = StringUtils.capitalizeFirstLetter( token );

                String methodName = "get" + methodBase;

                Method method = classMap.findMethod( methodName, CLASS_ARGS );

                if ( method == null )
                {
                    // perhaps this is a boolean property??
                    methodName = "is" + methodBase;

                    method = classMap.findMethod( methodName, CLASS_ARGS );
                }

                if ( method == null )
                {
                    return null;
                }

                value = method.invoke( value, OBJECT_ARGS );
                if ( value == null )
                {
                    return null;
                }
                if ( Collection.class.isAssignableFrom( value.getClass() ) )
                {
                    ClassMap classMap2 = getClassMap( value.getClass() );

                    Method method2 = classMap2.findMethod( "toArray", CLASS_ARGS );

                    value = method2.invoke( value, OBJECT_ARGS );
                }
                if ( value.getClass().isArray() )
                {
View Full Code Here

            return value;
        }

        private static ClassMap getClassMap( Class<? extends Object> clazz )
        {
            ClassMap classMap = classMaps.get( clazz );

            if ( classMap == null )
            {
                classMap = new ClassMap( clazz );

                classMaps.put( clazz, classMap );
            }

            return classMap;
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.introspection.ClassMap

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.