Package com.sun.mirror.type

Examples of com.sun.mirror.type.TypeMirror


    {
    }

    private void checkControlField( FieldDeclaration f )
    {
        TypeMirror fieldType = f.getType();

        // Make sure that this field doesn't try to override another that's inherited.
        String fieldName = f.getSimpleName();
        TypeDeclaration declaringType = f.getDeclaringType();
View Full Code Here


            return "";
       
        int i = 0;
        for (ParameterDeclaration paramDecl : _methodDecl.getParameters())
        {
            TypeMirror paramType = paramDecl.getType();
            if ( paramType == null )
                return "";
               
            if (bindingMap != null && bindingMap.containsKey(paramType.toString()))
                paramType = bindingMap.get(paramType.toString());

            if (i != 0)
                sb.append(", ");
           
            sb.append(paramType.toString());

            sb.append(' ');

            // BUGBUG: when the MethodDeclaration is derived from Reflection, this seems
            // to return 'arg0' for all arguments!
View Full Code Here

        for (ParameterDeclaration paramDecl : _methodDecl.getParameters())
        {
            if (i++ != 0)
                sb.append(", ");

            TypeMirror paramType = paramDecl.getType();
            if (paramType == null)
                return "";

            //
            // Use the erasure here, because we only want the raw type, not the reference
View Full Code Here

     */
    public boolean hasParameterizedArguments()
    {
        for (ParameterDeclaration paramDecl : _methodDecl.getParameters())
        {
            TypeMirror paramType = paramDecl.getType();
            if (paramType instanceof ReferenceType || paramType instanceof WildcardType)
                return true;
        }
        return false;
    }
View Full Code Here

            }

            //
            // Locate the EventSet based upon the eventSet element value
            //
            TypeMirror tm = (TypeMirror)( handlerAnnot.getObjectValue("eventSet") );
            if ( tm == null )
                continue;
            String setName = tm.toString();

            AptControlInterface controlIntf = eventField.getControlInterface();
            AptEventSet eventSet = controlIntf.getEventSet(setName);
            if (eventSet == null)
            {
View Full Code Here

    /**
     * Initializes the ControlInterface associated with this ControlField
     */
    protected AptControlInterface initControlInterface()
    {
        TypeMirror controlType = _fieldDecl.getType();
        if (! (controlType instanceof DeclaredType))
        {
            _ap.printError( _fieldDecl, "control.field.bad.type" );
            return null;
        }

        //
        // The field can either be declared as the bean type or the public interface type.
        // If it is the bean type, then we need to reflect to find the public interface
        // type it implements.
        //
        TypeDeclaration typeDecl = ((DeclaredType)controlType).getDeclaration();
        InterfaceDeclaration controlIntf = null;

        //
        // It is possible that the declared type is associated with a to-be-generated
        // bean type.  In this case, look for the associated control interface on the
        // processor input list.
        //
        if ( typeDecl == null )
        {
            String className = controlType.toString();
            String intfName = className.substring(0, className.length() - 4);
            controlIntf = (InterfaceDeclaration)_ap.getAnnotationProcessorEnvironment().getTypeDeclaration(intfName);
            if (controlIntf == null)
            {
                // The specified class name may not be fully qualified.  In this case, the
View Full Code Here

        if (paramMap.containsKey(paramNameQualifiers[0]) == false) {
            throw new ControlException(buildMessage(parameterName, method.getSimpleName()));
        }

        ParameterDeclaration tpd = paramMap.get(paramNameQualifiers[0]);
        TypeMirror type = tpd.getType();

        MethodDeclaration getterMethod = null;
        FieldDeclaration field = null;

        for (int i = 1; i < paramNameQualifiers.length; i++) {
View Full Code Here

        //
        // batch update methods must return int[]
        //
        final boolean batchUpdate = methodSQL.batchUpdate();
        final TypeMirror returnType = method.getReturnType();
        if (batchUpdate) {
            if (returnType instanceof ArrayType) {
                final TypeMirror aType = ((ArrayType) returnType).getComponentType();
                if (aType instanceof PrimitiveType == false
                        || ((PrimitiveType) aType).getKind() != PrimitiveType.Kind.INT) {
                    env.getMessager().printError(method.getPosition(),
                                                 getResourceString("jdbccontrol.batchupdate", method.getSimpleName()));
                    return;
View Full Code Here

        if (paramMap.containsKey(paramNameQualifiers[0]) == false) {
            throw new ControlException(buildMessage(parameterName, method.getSimpleName()));
        }

        ParameterDeclaration tpd = paramMap.get(paramNameQualifiers[0]);
        TypeMirror type = tpd.getType();

        MethodDeclaration getterMethod = null;
        FieldDeclaration field = null;

        for (int i = 1; i < paramNameQualifiers.length; i++) {
View Full Code Here

        //
        // batch update methods must return int[]
        //
        final boolean batchUpdate = methodSQL.batchUpdate();
        final TypeMirror returnType = method.getReturnType();
        if (batchUpdate) {
            if (returnType instanceof ArrayType) {
                final TypeMirror aType = ((ArrayType) returnType).getComponentType();
                if (aType instanceof PrimitiveType == false
                        || ((PrimitiveType) aType).getKind() != PrimitiveType.Kind.INT) {
                    env.getMessager().printError(method.getPosition(),
                                                 getResourceString("jdbccontrol.batchupdate", method.getSimpleName()));
                    return;
View Full Code Here

TOP

Related Classes of com.sun.mirror.type.TypeMirror

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.