Package flex2.compiler.mxml.reflect

Examples of flex2.compiler.mxml.reflect.Type


        processPrimitiveEntry(node);
    }

    private void processPrimitiveEntry(Node node)
    {
        Type type = nodeTypeResolver.resolveType(node, document);

        Primitive primitive = initPrimitiveValue(type, node);

        CDATANode cdata = null;
        if (node instanceof CDATANode)
            cdata = (CDATANode)node;
        else
            cdata = getTextContent(node.getChildren(), false);

        if (cdata != null)
        {
            processTextInitializer(cdata.image, type, cdata.inCDATA, cdata.beginLine);
        }
        else
        {
            //  NOTE: our scanner gives us identical representations for <tag/> and <tag></tag>. Here is one place where
            //  that's suboptimal for usability. TODO worth doing something about?
            if (!topLevel)
            {
                if (typeTable.stringType.isAssignableTo(type))
                {
                    processTextInitializer("", type, true, node.beginLine);
                }
                else
                {
                    log(node.beginLine, new InitializerRequired());
                }
            }
        }

        processStateAttributes(node, primitive);

        String id = (String)getLanguageAttributeValue(node, StandardDefs.PROP_ID);
        if (id != null || topLevel || primitive.isDeclarationEnsured())
        {
            if (primitive.getValue() != null)
            {
                if(node.comment == null)
                {
                    node.comment = "";
                }

                // if generate ast if false, lets not scan the tokens here because they will be scanned later in asc scanner.
                // we will go the velocity template route
                if(!mxmlConfiguration.getGenerateAbstractSyntaxTree())
                {
                    primitive.comment = node.comment;
                }
                else
                {
                    primitive.comment = MxmlCommentUtil.commentToXmlComment(node.comment);  
                }                   
               
                registerModel(id, primitive, topLevel);
            }
            else
            {
                //  Note: primitives are currently the only kind of MXML tag that can be declared without initializing.
                //  TODO still, we should generalize 'register' to include uninitialized declarations
                boolean autogenerated = false;
                if (id == null)
                {
                    //  anon id has been generated
                    autogenerated = true;
                    id = primitive.getId();
                }

                String tempComment = null;
               
                if(node.comment == null)
                {
                    node.comment = "";
                }

                // if generate ast if false, lets not scan the tokens here because they will be scanned later in asc scanner.
                // we will go the velocity template route
                if(!mxmlConfiguration.getGenerateAbstractSyntaxTree())
                {
                    tempComment = node.comment;
                }
                else
                {
                    tempComment = MxmlCommentUtil.commentToXmlComment(node.comment);  
                }                   
               
                document.addDeclaration(id, type.getName(), node.beginLine, true, topLevel, autogenerated, primitive.getBindabilityEnsured(), tempComment);
            }
        }
    }
View Full Code Here


    /**
     * NOTE: suppress declaration of inherited properties
     */
    public final Iterator<PropertyDeclaration> getDeclarationIterator()
    {
        final Type superType = getSuperClass();

        return new FilterIterator(declarations.values().iterator(), new Predicate()
        {
            public boolean evaluate(Object object)
            {
                return superType.getProperty(((PropertyDeclaration)object).getName()) == null;
            }
        });
    }
View Full Code Here

     */
    void ensureId(Model model)
    {
        if (model.getId() == null)
        {
            Type type = model.getType();
            assert type != null;

            int i = getAnonIndex(model.getType());

            String id = "_" + NameFormatter.toDot(info.getClassName()).replace('.', '_') +
                        "_" + NameFormatter.retrieveClassName(type.getName().replace('<', '_').replace('>', '_')) + i;
            // String id = "_" + NameFormatter.retrieveClassName(type.getName()) + i;

            model.setId(id, true);
        }
    }
View Full Code Here

    {
      return;
    }

        //  create WebService VO, register id with document
        Type type = typeTable.getType(node.getNamespace(), node.getLocalPart());

        component = new Model(document, type, node.beginLine);
        registerModel(node, component, true);

    processAttributes(node, type);
View Full Code Here

  /**
   * add &lt;operation/&gt; children as members of &lt;operations/&gt;.
   */
  public void addOperation(Model ops, OperationNode node)
  {
    Type type = typeTable.getType(node.getNamespace(), WEB_SERVICE_OPERATION);

    //  push parent tag VO, child tag handler
    Model ws = component;
    ComponentChildNodeHandler wsChildNodeHandler = childNodeHandler;

View Full Code Here

    public void analyze(XMLNode node)
    {
        id = (String)getLanguageAttributeValue(node, StandardDefs.PROP_ID);
        boolean e4x = node.isE4X();
        Type t = typeTable.getType(standardDefs.getXmlBackingClassName(e4x));
        xml = new XML(document, t, parent, e4x, node.beginLine);
        if (id != null)
        {
            xml.setId(id, false);
        }
View Full Code Here

                        {
                            if (styleDef.isTypeSelector())
                            {
                                if (qualifiedTypeSelectors && mxmlConfiguration.showInvalidCssPropertyWarnings())
                                {
                                    Type type = typeTable.getType(NameFormatter.toColon(typeName));
   
                                    if (type != null)
                                    {
                                        validateTypeSelectorProperties(styleProperties, type, styleDef,
                                                                       typeName, themeNamesString);
                                    }
                                }
                            }
   
                            if (mxmlDocumentQName != null)
                            {
                                // Don't use getType(QName), because that
                                // tries to lookup the class name in the
                                // manifest.  Use getType(String) instead.
                                Type mxmlDocumentType = typeTable.getType(mxmlDocumentQName.toString());
                                assert mxmlDocumentType != null;
                                validatePropertyReferences(styleProperties, mxmlDocumentType);
                            }
                        }
                    }
View Full Code Here

        String currentVar = varContext.elementVar;
        String contentVar = varContext.contentVar;
        String parentClass = varContext.elementClass;
        String parentChildrenVar = varContext.elementChildrenVar;
        Type type = varContext.type;

        if (!varContext.varDeclared)
        {
            // var someElement:SomeElement = new SomeElement();
            buf.append("        var ").append(currentVar).append(":").append(parentClass).append(" = new ").append(parentClass).append("();\r\n");
View Full Code Here

                String thisAttrib = null;

                Property property = type.getProperty(attribName);
                if (property != null)
                {
                    Type propertyType = property.getType();
                    if (propertyType.isAssignableTo(typeTable.stringType)
                        || propertyType == typeTable.objectType
                        || propertyType == typeTable.noType)
                    {
                        thisAttrib = attribName + " = \"" + attribValue + "\"";
                    }
View Full Code Here

        output = null;
        directory = null;
        mimeMappings = new MimeMappings();
        meter = null;
        resolver = null;
        cc = new CompilerControl();

        //data = null;
        cacheName = null;
        configurationReport = null;
        messages = new ArrayList<Message>();
View Full Code Here

TOP

Related Classes of flex2.compiler.mxml.reflect.Type

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.