Package org.apache.flex.compiler.mxml

Examples of org.apache.flex.compiler.mxml.IMXMLTagAttributeData


            stateStart += offsetAdjustment;
        }
        attributesStart += offsetAdjustment;
        for (int i = 0; i < attributes.length; i++)
        {
            IMXMLTagAttributeData attribute = attributes[i];
            ((MXMLTagAttributeData)attribute).adjustOffsets(offsetAdjustment);
        }
    }
View Full Code Here


    }

    @Override
    public String getRawAttributeValue(String attributeName)
    {
        IMXMLTagAttributeData attributeData = attributeMap.get(attributeName);
        if (attributeData != null)
            return attributeData.getRawValue();
        return null;
    }
View Full Code Here

     * @return the attribute (or null, if no attribute contains the offset)
     */
    public IMXMLTagAttributeData findAttributeContainingOffset(int offset)
    {
        // Find the last attribute that starts to the left of offset
        IMXMLTagAttributeData lastAttribute = null;
        IMXMLTagAttributeData attribute = null;
        for (int i = 0; i < attributes.length; i++)
        {
            attribute = attributes[i];
            if (attribute.getAbsoluteStart() < offset)
                lastAttribute = attribute;
            else
                break;
        }
        // That last attribute is good if it's unfinished or if it contains the offset in question
View Full Code Here

            // a state, as we can't check it it resolved to mx.states.State.
            if (IMXMLLanguageConstants.STATE.equals(tag.getShortName()))
                processState(tag, qname);
        }

        IMXMLTagAttributeData idAttribute = tag.getTagAttributeData("id");
        String id = tag.getRawAttributeValue("id");
        if (id != null)
            processID(tag, idAttribute);

        if (recurse)
View Full Code Here

     */
    private void processScriptTag(IMXMLTagData scriptTag)
    {
        assert fileScope.isScriptTag(scriptTag);
       
        IMXMLTagAttributeData sourceAttribute = scriptTag.getTagAttributeData(IMXMLLanguageConstants.ATTRIBUTE_SOURCE);
        if (sourceAttribute != null)
        {
            // script tag with source attribute
            String sourcePath = MXMLNodeBase.resolveSourceAttributePath(null, sourceAttribute, null);
            Reader sourceFileReader = null;
View Full Code Here

        if (!qname.equals(IMXMLTypeConstants.State) || tag.getMXMLDialect() == MXMLDialect.MXML_2006)
            return;

        // if there is no name attribute, ignore it as a state, as name is
        // a required attribute
        IMXMLTagAttributeData nameAttribute = tag.getTagAttributeData(IMXMLLanguageConstants.ATTRIBUTE_NAME);
        if (nameAttribute == null)
            return;

        // TODO: need to handle evaluations of entities
        String stateName = nameAttribute.getRawValue();
        currentClassDefinition.addStateName(stateName);
    }
View Full Code Here

     * If not, call <code>addUnfoundReferenceSourceFileDependency()</code>
     * on the <code>FlexProject</code>.
     */
    private void processSourceAttribute(IMXMLTagData tag)
    {
        IMXMLTagAttributeData sourceAttribute = tag.getTagAttributeData(IMXMLLanguageConstants.ATTRIBUTE_SOURCE);
        if (sourceAttribute != null)
        {
            String sourcePath = MXMLNodeBase.resolveSourceAttributePath(null, sourceAttribute, null);
            Reader sourceFileReader = null;
            try
View Full Code Here

        FlexProject project = builder.getProject();
        builder.addExpressionDependency(project.getBindingManagerClass());

        // Do some semantic checks.

        IMXMLTagAttributeData sourceAttribute = tag.getTagAttributeData(ATTRIBUTE_SOURCE);
        IMXMLTagAttributeData destinationAttribute = tag.getTagAttributeData(ATTRIBUTE_DESTINATION);

        String trimmedSourceValue = null;
        String trimmedDestinationValue = null;

        if (sourceAttribute == null)
        {
            // 'source' attribute is required
            ICompilerProblem problem = new MXMLRequiredAttributeProblem(tag, ATTRIBUTE_SOURCE);
            builder.addProblem(problem);
            markInvalidForCodeGen();
        }
        else
        {
            trimmedSourceValue = builder.getMXMLDialect().trim(sourceAttribute.getRawValue());
            if (trimmedSourceValue.isEmpty())
            {
                // 'source' attribute value cannot be empty
                ICompilerProblem problem = new MXMLEmptyAttributeProblem(sourceAttribute);
                builder.addProblem(problem);
                markInvalidForCodeGen();
            }
        }

        if (destinationAttribute == null)
        {
            // 'destination' attribute is required
            ICompilerProblem problem = new MXMLRequiredAttributeProblem(tag, ATTRIBUTE_DESTINATION);
            builder.addProblem(problem);
            markInvalidForCodeGen();
        }
        else
        {
            trimmedDestinationValue = builder.getMXMLDialect().trim(destinationAttribute.getRawValue());
            if (trimmedDestinationValue.isEmpty())
            {
                // 'destination' attribute value cannot be empty
                ICompilerProblem problem = new MXMLEmptyAttributeProblem(destinationAttribute);
                builder.addProblem(problem);
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.mxml.IMXMLTagAttributeData

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.