Examples of TypeInstance


Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        // Add a warning when this annotation is on a getter method which returns a primitive type.
        // In that case, it will never be null.
        //
        if ( classMember instanceof MethodDeclaration )
        {
            TypeInstance returnType = ( ( MethodDeclaration ) classMember ).getReturnType();
           
            if ( returnType instanceof PrimitiveType )
            {
                addWarning( annotation, "warning.validate-required-on-primitive-type",
                            ANNOTATION_INTERFACE_PREFIX + VALIDATE_REQUIRED_TAG_NAME );
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        //
        // Only warn about nonserializable member data that's defined in this particular class.
        //
        if ( CompilerUtils.typesAreEqual( jclass, field.getDeclaringType() ) )
        {
            TypeInstance type = field.getType();
           
            if ( ! field.hasModifier( Modifier.TRANSIENT ) && ! field.hasModifier( Modifier.STATIC )
                 && type instanceof ClassType
                 && ! CompilerUtils.isAssignableFrom( SERIALIZABLE_CLASS_NAME, type, getEnv() ) )
            {
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        {
            for ( Iterator i = sharedFlowRefs.iterator(); i.hasNext();
            {
                AnnotationInstance sharedFlowRef = ( AnnotationInstance ) i.next();
                String name = CompilerUtils.getString( sharedFlowRef, NAME_ATTR, true );
                TypeInstance type = CompilerUtils.getTypeInstance( sharedFlowRef, TYPE_ATTR, true );
               
                if ( type instanceof DeclaredType )   // if it's not a DeclaredType, the error will be caught elsewhere.
                {
                    TypeDeclaration typeDecl = ( ( DeclaredType ) type ).getDeclaration();
                   
                    if ( typeDecl != null )     // If the declaration is null, it's an error type.
                    {
                        _sharedFlowTypes.put( name, typeDecl );
                    }
                }
            }
        }
       
        //
        // If there's no SharedFlowController, fall back to the deprecated Global.app.
        //
        if ( _sharedFlowTypes.isEmpty() )
        {
            TypeDeclaration type = env.getTypeDeclaration( GLOBALAPP_FULL_CLASSNAME );
            if ( type != null ) _sharedFlowTypes.put( GLOBALAPP_SHARED_FLOW_NAME, type );
        }
 
        _sharedFlowTypeNames = new LinkedHashMap();
        _sharedFlowFiles = new LinkedHashMap();
       
        for ( Iterator i = _sharedFlowTypes.entrySet().iterator(); i.hasNext();
        {
            Map.Entry entry = ( Map.Entry ) i.next();
            TypeDeclaration type = ( TypeDeclaration ) entry.getValue();
            _sharedFlowTypeNames.put( entry.getKey(), type.getQualifiedName() );
            File file = CompilerUtils.getSourceFile( type, false );
           
            if ( file != null )
            {
                _sharedFlowFiles.put( entry.getKey(), file );
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

     * Add a return-action from an annotation.
     * @return the form bean type, or null</code> if there is no form bean.
     */
    public TypeInstance addReturnAction( String returnActionName, AnnotationInstance annotation, TypeDeclaration outerType )
    {
        TypeInstance formBeanType = CompilerUtils.getTypeInstance( annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true );
       
        if ( formBeanType == null )
        {
            String memberFieldName = CompilerUtils.getString( annotation, OUTPUT_FORM_BEAN_ATTR, true );
           
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

         return false;
     }
   
    public static TypeInstance getArrayBaseType( ArrayType arrayType )
    {
        TypeInstance baseType = arrayType;
       
        do
        {
            baseType = ( ( ArrayType ) baseType ).getComponentType();
        } while ( baseType instanceof ArrayType );
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

                    AnnotationInstance sharedFlowRef = ( AnnotationInstance ) ii.next();
                    if ( sharedFlowName.equals( CompilerUtils.getString( sharedFlowRef, NAME_ATTR, true ) ) )
                    {
                        foundOne = true;
                       
                        TypeInstance sfType = CompilerUtils.getTypeInstance( sharedFlowRef, TYPE_ATTR, true );
                        TypeInstance ft = field.getType();
                       
                        if ( ! ( sfType instanceof DeclaredType )
                             || ! CompilerUtils.isAssignableFrom( ft, ( ( DeclaredType ) sfType ).getDeclaration() ) )
                        {
                            getDiagnostics().addError(
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        String formBeanName = null;
       
        if ( params.length > 0 )
        {
            assert params.length == 1 : params.length;  // checker should catch this
            TypeInstance paramType = CompilerUtils.getGenericBoundsType( params[0].getType() );
            formBeanName = addFormBean( paramType, parentApp );
        }
       
        return formBeanName;
    }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        setNullable( nullable );
       
        //
        // Get the base type, and add "[]" to it for arrays.
        //
        TypeInstance baseType = CompilerUtils.getReferenceType( annotation, TYPE_ATTR, true );
        StringBuffer arrayDimensions = new StringBuffer();
        while ( baseType instanceof ArrayType )
        {
            arrayDimensions.append( ARRAY_TYPE_SUFFIX );
            baseType = ( ( ArrayType ) baseType ).getComponentType();
        }
       
        String baseTypeName;
        if ( baseType instanceof PrimitiveType )
        {
            baseTypeName = ( ( PrimitiveType ) baseType ).getKind().toString().toLowerCase();
        }
        else
        {
            assert baseType instanceof DeclaredType : baseType.getClass().getName();   // checker should enforce this
            baseTypeName = CompilerUtils.getLoadableName( ( DeclaredType ) baseType );
        }
       
        setType( baseTypeName + arrayDimensions.toString() );
    }
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        // If the method's arguments are wrong in any way, don't worry about it -- the exception-handler checker will
        // report an error.
        //
        if ( parameters.length > 0 )
        {
            TypeInstance handledExceptionType = parameters[0].getType();
           
            if ( ! CompilerUtils.isAssignableFrom( handledExceptionType, CompilerUtils.getDeclaration( exceptionType ) ) )
            {
                addError( annotation, "error.incompatible-exception-handler", handlerMethod.getSimpleName(),
                          CompilerUtils.getDeclaration( exceptionType ).getQualifiedName() );
View Full Code Here

Examples of org.apache.beehive.netui.compiler.typesystem.type.TypeInstance

        return true;
    }
   
    private static Object parseValue( AnnotationTypeElementDeclaration memberDecl, String strValue, SourcePositionImpl pos )
    {
        TypeInstance type = memberDecl.getReturnType();
   
        if ( type instanceof ClassType )
        {
            ClassType classType = ( ClassType ) type;
            String typeName = classType.getClassTypeDeclaration().getQualifiedName();
           
            if ( typeName.equals( "java.lang.String" ) )
            {
                return strValue;
            }
            else if ( typeName.equals( "java.lang.Class" ) )
            {
                TypeInstance retVal = XDocletCompilerUtils.resolveType( strValue, false, pos.getOuterClass() );
               
                if ( retVal == null )
                {
                    XDocletCompilerUtils.addError( pos, "error.unknown-class",
                                                   new String[]{ strValue, memberDecl.getSimpleName() } );
                }
               
                return XDocletCompilerUtils.resolveType( strValue, true, pos.getOuterClass() );
            }
            else
            {
                assert false : "unexpected type in annotation declaration: " + typeName;
            }
        }
        else if ( type instanceof ArrayType )
        {
            ArrayType arrayType = ( ArrayType ) type;
            TypeInstance componentType = arrayType.getComponentType();
           
            // We only handle an array of strings -- nothing else at this point.
            assert componentType instanceof DeclaredType : componentType.getClass().getName();
            assert ( ( DeclaredType ) componentType ).getDeclaration().getQualifiedName().equals( String.class.getName() )
                    : ( ( DeclaredType ) componentType ).getDeclaration().getQualifiedName();
            StringTokenizer tok = new StringTokenizer( strValue, "," );
            ArrayList arrayValues = new ArrayList();
            while ( tok.hasMoreTokens() )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.