Package org.apache.flex.compiler.problems

Examples of org.apache.flex.compiler.problems.ICompilerProblem


            fileNode.initialize(this);
        }
        catch (Throwable t)
        {
            // Something went wrong, so log it. 
            ICompilerProblem problem = new UnexpectedExceptionProblem(t);
            addProblem(problem);
        }

        return fileNode;
    }
View Full Code Here


                    return Double.valueOf(s.substring(0, percentIndex));
                }
                else
                {
                    ICompilerProblem problem = new MXMLInvalidPercentageProblem(
                            (SourceLocation)propertyNode, propertyNode.getName(), s);
                    problems.add(problem);
                }
            }
            else
            {
                ICompilerProblem problem = new MXMLPercentageNotAllowedProblem(
                        (SourceLocation)propertyNode, propertyNode.getName(), s);
                problems.add(problem);
            }
        }
View Full Code Here

            expressionNode = createLiteralNode(propertyNode, type, fragments, location, flags, defaultValue);

        if (expressionNode == null)
        {
            String text = SourceFragmentsReader.concatLogicalText(fragments);
            ICompilerProblem problem = new MXMLInvalidTextForTypeProblem(location, text, typeName);
            addProblem(problem);
        }

        return expressionNode;
    }
View Full Code Here

        {
            sourceFileReader = sourceFileSpec.createReader();
        }
        catch (FileNotFoundException e)
        {
            ICompilerProblem problem =
                    new MXMLInvalidSourceAttributeProblem(sourceAttribute, resolvedSourcePath);
            addProblem(problem);
            return null;
        }
        String text;
View Full Code Here

    {
        File file = new File(resolvedSourcePath);

        if (!file.exists())
        {
            ICompilerProblem problem =
                    new MXMLInvalidSourceAttributeProblem(sourceAttribute, resolvedSourcePath);
            addProblem(problem);
            return null;
        }
View Full Code Here

        {
            if (unit instanceof IMXMLInstructionData)
            {
                if (unit.getStart() > 0)
                {
                    ICompilerProblem problem = new MXMLXMLProcessingInstructionLocationProblem(unit);
                    builder.addProblem(problem);
                }
            }
            else if (unit instanceof IMXMLTagData)
            {
                if (!foundRootTag)
                {
                    foundRootTag = true;
                    processRootTag(builder, (IMXMLTagData)unit, asDoc);
                }
                else
                {
                    ICompilerProblem problem = new MXMLMultipleRootTagsProblem(unit);
                    builder.addProblem(problem);
                }
            }
            else if (unit instanceof IMXMLTextData)
            {
                IMXMLTextData textData = (IMXMLTextData)unit;
                if (textData.getTextType().equals(TextType.ASDOC))
                    asDoc = textData;
                if (!builder.getMXMLDialect().isWhitespace(textData.getCompilableText()))
                {
                    if (documentNode == null)
                    {
                        ICompilerProblem problem = new MXMLContentBeforeRootTagProblem(unit);
                        builder.addProblem(problem);
                    }
                    else
                    {
                        ICompilerProblem problem = new MXMLContentAfterRootTagProblem(unit);
                        builder.addProblem(problem);
                    }
                }
            }
        }

        if (!foundRootTag)
        {
            ICompilerProblem problem = new MXMLMissingRootTagProblem(builder.getPath());
            builder.addProblem(problem);
        }
    }
View Full Code Here

        IDefinition tagDef = builder.getFileScope().resolveTagToDefinition(rootTag);

        // Report a problem if the root tag doesn't map to a definition.
        if (tagDef == null)
        {
            ICompilerProblem problem = new MXMLUnresolvedTagProblem(rootTag);
            builder.addProblem(problem);
            return;
        }

        // Report a problem if that definition isn't for a class.
        if (!(tagDef instanceof IClassDefinition))
        {
            ICompilerProblem problem = new MXMLNotAClassProblem(rootTag, tagDef.getQualifiedName());
            builder.addProblem(problem);
            return;
        }

        IClassDefinition tagDefinition = (IClassDefinition)tagDef;

        // Report a problem if that class is final.
        if (tagDefinition != null && tagDefinition.isFinal())
        {
            ICompilerProblem problem = new MXMLFinalClassProblem(rootTag, tagDef.getQualifiedName());
            builder.addProblem(problem);
            return;
        }

        // Report a problem is that class's constructor has required parameters.
        IFunctionDefinition constructor = tagDefinition.getConstructor();
        if (constructor != null && constructor.hasRequiredParameters())
        {
            ICompilerProblem problem = new MXMLConstructorHasParametersProblem(rootTag, tagDef.getQualifiedName());
            builder.addProblem(problem);
            return;
        }

        documentNode = new MXMLDocumentNode(this);
View Full Code Here

            // Check that the root tag mapped to a definition.
            if (tagDef == null)
            {
                // TODO Add a problem subclass for this.
                ICompilerProblem problem = new MXMLSemanticProblem(childTag);
                builder.addProblem(problem);
            }

            // Check that the definition is for a class.
            if (!(tagDef instanceof IClassDefinition))
            {
                // TODO Add a problem subclass for this.
                ICompilerProblem problem = new MXMLSemanticProblem(childTag);
                builder.addProblem(problem);
            }

            IClassDefinition tagDefinition = (IClassDefinition)tagDef;

            // Check that the class is not final.
            if (tagDefinition.isFinal())
            {
                // TODO Add a problem subclass for this.
                ICompilerProblem problem = new MXMLSemanticProblem(childTag);
                builder.addProblem(problem);
            }

            // Find the ClassDefinition that was created for the component class.
            MXMLFileScope fileScope = builder.getFileScope();
View Full Code Here

    @Override
    protected String[] processIncludeInOrExcludeFromAttribute(MXMLTreeBuilder builder,
                                                              IMXMLTagAttributeData attribute)
    {
        // TODO Report the correct problem.
        ICompilerProblem problem = new MXMLSemanticProblem(attribute);
        builder.addProblem(problem);
        return null;
    }
View Full Code Here

    @Override
    protected String processItemCreationPolicyAttribute(MXMLTreeBuilder builder,
                                                        IMXMLTagAttributeData attribute)
    {
        // TODO Report the correct problem.
        ICompilerProblem problem = new MXMLSemanticProblem(attribute);
        builder.addProblem(problem);
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.problems.ICompilerProblem

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.