Package org.apache.beehive.netui.compiler.typesystem.declaration

Examples of org.apache.beehive.netui.compiler.typesystem.declaration.PackageDeclaration


    protected void doAdditionalClassChecks( ClassDeclaration jpfClass )
    {
        // Make sure there are no other page flows in this package/directory.
        checkForOverlappingClasses( jpfClass, JPF_BASE_CLASS, JPF_FILE_EXTENSION_DOT, "error.overlapping-pageflows" );
       
        PackageDeclaration pkg = jpfClass.getPackage();
        File jpfFile = CompilerUtils.getSourceFile( jpfClass, true );
        File parentDir = jpfFile.getParentFile();
       
        //
        // Check the package name.
        //
        String jpfPackageName = pkg.getQualifiedName();
       
        if ( jpfPackageName != null && jpfPackageName.length() > 0 )
        {
            String expectedPackage = parentDir.getAbsolutePath().replace( '\\', '/' ).replace( '/', '.' );
           
            if ( ! expectedPackage.endsWith( jpfPackageName ) )
            {
                getDiagnostics().addError( jpfClass, "error.wrong-package-for-directory", parentDir.getPath() );
            }
        }

        //
        // Issue a warning if the class name is the same as the parent package name.
        // This causes ambiguity when resolving inner classes.
        //
        if ( jpfClass.getSimpleName().equals( pkg.getQualifiedName() ) )
        {
            getDiagnostics().addWarning( jpfClass, "warning.classname-same-as-package" );
        }
       
        //
View Full Code Here


    protected void checkForOverlappingClasses( ClassDeclaration jpfClass, String baseClass, String fileExtension,
                                               String errorKey )
    {
        File jpfFile = CompilerUtils.getSourceFile( jpfClass, true );
        File parentDir = jpfFile.getParentFile();
        PackageDeclaration pkg = jpfClass.getPackage();
        ClassDeclaration[] packageClasses = pkg.getClasses();
        Set overlapping = new HashSet();
        List overlappingFiles = new ArrayList();
       
        //
        // First go through the other classes in this package to look for other classes of this type.  Only one per
View Full Code Here

            else
            {
                // Use the package name to infer the relative path (from web content root) to the page flow directory.
                String[] webContentRoots = CompilerUtils.getWebContentRoots( env );
                String jpfParentRelativePath = "";
                PackageDeclaration jpfPackage = outerClass.getPackage();
                if ( jpfPackage != null ) jpfParentRelativePath = jpfPackage.getQualifiedName().replace( '.', '/' );
               
                for ( int i = 0; i < webContentRoots.length; i++ )
                {
                    String webContentRoot = webContentRoots[i];
                    File desiredParentDir = new File( webContentRoot, jpfParentRelativePath );
View Full Code Here

            else
            {
                // Use the package name to infer the relative path (from web content root) to the page flow directory.
                String webContentRoot = CompilerUtils.getWebContentRoot( env );
                String jpfParentRelativePath = "";
                PackageDeclaration jpfPackage = outerClass.getPackage();
                if ( jpfPackage != null ) jpfParentRelativePath = jpfPackage.getQualifiedName().replace( '.', '/' );
                File desiredParentDir = new File( webContentRoot, jpfParentRelativePath );
                fileToCheck = new File( desiredParentDir, filePath );
            }
           
            if ( ! fileToCheck.exists() && ! ( ignoreDirectories && fileToCheck.isDirectory() ) )
View Full Code Here

    protected void checkForOverlappingClasses( ClassDeclaration jpfClass, String baseClass, String fileExtension,
                                               String errorKey )
    {
        File jpfFile = CompilerUtils.getSourceFile( jpfClass, true );
        File parentDir = jpfFile.getParentFile();
        PackageDeclaration pkg = jpfClass.getPackage();
        ClassDeclaration[] packageClasses = pkg.getClasses();
        Set overlapping = new HashSet();
        List overlappingFiles = new ArrayList();
       
        //
        // First go through the other classes in this package to look for other classes of this type.  Only one per
View Full Code Here

    protected void doAdditionalClassChecks( ClassDeclaration jpfClass )
    {
        // Make sure there are no other page flows in this package/directory.
        checkForOverlappingClasses( jpfClass, JPF_BASE_CLASS, JPF_FILE_EXTENSION_DOT, "error.overlapping-pageflows" );
       
        PackageDeclaration pkg = jpfClass.getPackage();
        File jpfFile = CompilerUtils.getSourceFile( jpfClass, true );
        File parentDir = jpfFile.getParentFile();
       
        //
        // Check the package name.
        //
        String jpfPackageName = pkg.getQualifiedName();
       
        if ( jpfPackageName != null && jpfPackageName.length() > 0 )
        {
            String expectedPackage = parentDir.getAbsolutePath().replace( '\\', '/' ).replace( '/', '.' );
           
            if ( ! expectedPackage.endsWith( jpfPackageName ) )
            {
                getDiagnostics().addError( jpfClass, "error.wrong-package-for-directory", parentDir.getPath() );
            }
        }

        //
        // Issue a warning if the class name is the same as the parent package name.
        // This causes ambiguity when resolving inner classes.
        //
        if ( jpfClass.getSimpleName().equals( pkg.getQualifiedName() ) )
        {
            getDiagnostics().addWarning( jpfClass, "warning.classname-same-as-package" );
        }
       
        //
View Full Code Here

    }
   
    protected boolean isModuleDeclaredInWebXml()
    {
        // Only the root page flow (which generates a module for path "/") is declared in web.xml
        PackageDeclaration pkg = _jclass.getPackage();
        return ! isSharedFlow() && pkg == null || pkg.getQualifiedName().length() == 0;
    }
View Full Code Here

            else
            {
                // Use the package name to infer the relative path (from web content root) to the page flow directory.
                String[] webContentRoots = CompilerUtils.getWebContentRoots( env );
                String jpfParentRelativePath = "";
                PackageDeclaration jpfPackage = outerClass.getPackage();
                if ( jpfPackage != null ) jpfParentRelativePath = jpfPackage.getQualifiedName().replace( '.', '/' );
               
                for ( int i = 0; i < webContentRoots.length; i++ )
                {
                    String webContentRoot = webContentRoots[i];
                    File desiredParentDir = new File( webContentRoot, jpfParentRelativePath );
View Full Code Here

    protected void doAdditionalClassChecks( ClassDeclaration jpfClass )
    {
        // Make sure there are no other page flows in this package/directory.
        checkForOverlappingClasses( jpfClass, JPF_BASE_CLASS, JPF_FILE_EXTENSION_DOT, "error.overlapping-pageflows" );
       
        PackageDeclaration pkg = jpfClass.getPackage();
        File jpfFile = CompilerUtils.getSourceFile( jpfClass, true );
        File parentDir = jpfFile.getParentFile();
       
        //
        // Check the package name.
        //
        String jpfPackageName = pkg.getQualifiedName();
       
        if ( jpfPackageName != null && jpfPackageName.length() > 0 )
        {
            String expectedPackage = parentDir.getAbsolutePath().replace( '\\', '/' ).replace( '/', '.' );
           
            if ( ! expectedPackage.endsWith( jpfPackageName ) )
            {
                getDiagnostics().addError( jpfClass, "error.wrong-package-for-directory", parentDir.getPath() );
            }
        }

        //
        // Issue a warning if the class name is the same as the parent package name.
        // This causes ambiguity when resolving inner classes.
        //
        if ( jpfClass.getSimpleName().equals( pkg.getQualifiedName() ) )
        {
            getDiagnostics().addWarning( jpfClass, "warning.classname-same-as-package" );
        }
       
        //
View Full Code Here

    protected void checkForOverlappingClasses( ClassDeclaration jpfClass, String baseClass, String fileExtension,
                                               String errorKey )
    {
        File jpfFile = CompilerUtils.getSourceFile( jpfClass, true );
        File parentDir = jpfFile.getParentFile();
        PackageDeclaration pkg = jpfClass.getPackage();
        ClassDeclaration[] packageClasses = pkg.getClasses();
        Set overlapping = new HashSet();
        List overlappingFiles = new ArrayList();
       
        //
        // First go through the other classes in this package to look for other classes of this type.  Only one per
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.compiler.typesystem.declaration.PackageDeclaration

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.