Package org.asteriskjava.manager

Examples of org.asteriskjava.manager.AsteriskMapping


        }
    }

    private String mapToAsterisk(Method getter)
    {
        AsteriskMapping annotation;

        // check annotation of getter method
        annotation = getter.getAnnotation(AsteriskMapping.class);
        if (annotation != null)
        {
            return annotation.value();
        }

        // check annotation of setter method
        String setterName = determineSetterName(getter.getName());
        try
        {
            Method setter = getter.getDeclaringClass().getDeclaredMethod(setterName, getter.getReturnType());
            annotation = setter.getAnnotation(AsteriskMapping.class);
            if (annotation != null)
            {
                return annotation.value();
            }
        }
        catch (NoSuchMethodException e)
        {
            // ok, no setter method
        }

        // check annotation of field
        String fieldName = determineFieldName(getter.getName());
        try
        {
            Field field = getter.getDeclaringClass().getDeclaredField(fieldName);
            annotation = field.getAnnotation(AsteriskMapping.class);
            if (annotation != null)
            {
                return annotation.value();
            }
        }
        catch (NoSuchFieldException e)
        {
            // ok, no field
View Full Code Here


        }
    }

    private String mapToAsterisk(Method getter)
    {
        AsteriskMapping annotation;

        // check annotation of getter method
        annotation = getter.getAnnotation(AsteriskMapping.class);
        if (annotation != null)
        {
            return annotation.value();
        }

        // check annotation of setter method
        String setterName = determineSetterName(getter.getName());
        try
        {
            Method setter = getter.getDeclaringClass().getDeclaredMethod(setterName, getter.getReturnType());
            annotation = setter.getAnnotation(AsteriskMapping.class);
            if (annotation != null)
            {
                return annotation.value();
            }
        }
        catch (NoSuchMethodException e)
        {
            // ok, no setter method
        }

        // check annotation of field
        String fieldName = determineFieldName(getter.getName());
        try
        {
            Field field = getter.getDeclaringClass().getDeclaredField(fieldName);
            annotation = field.getAnnotation(AsteriskMapping.class);
            if (annotation != null)
            {
                return annotation.value();
            }
        }
        catch (NoSuchFieldException e)
        {
            // ok, no field
View Full Code Here

TOP

Related Classes of org.asteriskjava.manager.AsteriskMapping

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.