Package flex2.compiler.mxml.reflect

Examples of flex2.compiler.mxml.reflect.Type


        else
        {
            potentialProperty = sourceExpression;
        }

        Type skeletonClass = mxmlDocument.getSkeletonClass();

        boolean result = false;

        if (potentialProperty.indexOf(":") == -1)
        {
            Property property = skeletonClass.getProperty(SymbolTable.publicNamespace, potentialProperty);

            // It looks like we are checking for "public" twice, but
            // the above call also returns properties in the unnamed
            // package, because they are both equivalent to an empty
            // string.
View Full Code Here


     * code generating the binding source and destination functions.
     * It's also used when code generating the document's imports.
     */
    public String getDestinationTypeName()
    {
        Type type = null;

        if ((destination != null) &&
            !(destination instanceof AnonymousObjectGraph) &&
            !(destination instanceof XML))
        {
            if (destinationProperty != null)
            {
                Type destinationType = destination.getType();

                if (!destinationType.getName().equals(mxmlDocument.getStandardDefs().CLASS_OBJECTPROXY))
                {
                    Property property = destinationType.getProperty(destinationProperty);

                    if (property != null)
                    {
                        type = property.getType();
                    }
                }
            }
            else if (destinationStyle != null)
            {
                Type destinationType = destination.getType();
                Style style = destinationType.getStyle(destinationStyle);

                if (style != null)
                {
                    type = style.getType();
                }
View Full Code Here

        Model destination = (context != null && context.getParent() != null) ? context : null;
       
        // Special case for ItemsComponent. The default property is "contentFactory", but we don't
        // want to specify that in the AddItems code. By eliminating the property name, we rely
        // on the runtime to figure out the right thing to do.
        Type parentType = destination != null ? destination.getType() : document.getRoot().getType();
        if (standardDefs.isItemsComponent(parentType) &&
            parentType.getDefaultProperty().getName() == parentProperty)
        {
            parentProperty = null;
        }

        // Validate we're ok to use include/exclude on this node (exclude scalar values)
View Full Code Here

        Model destination = (context != null && context.getParent() != null) ? context : null;
       
        // Special case for ItemsComponent. The default property is "contentFactory", but we don't
        // want to specify that in the AddItems code. By eliminating the property name, we rely
        // on the runtime to figure out the right thing to do.
        Type parentType = destination != null ? destination.getType() : document.getRoot().getType();
        if (standardDefs.isItemsComponent(parentType) &&
            parentType.getDefaultProperty().getName() == parentProperty)
        {
            parentProperty = null;
        }
     
        // Validate our reparent and construct our override nodes.
View Full Code Here

     * Ensures that the instance we are reparenting is compatible with the destination
     * type.
     */
    private boolean validateReparentType(Model targetModel, Model destination, String parentProperty, ReparentInfo reparentNode)
    {
        Type childType = targetModel.getType();
        Type parentType = destination != null ? destination.getType() : document.getRoot().getType();
       
        if (standardDefs.isContainer(parentType) && standardDefs.isIUIComponent(childType) && parentProperty == null)
        {
            return true;
        }
        else if (parentProperty != null || parentType.getDefaultProperty() != null)
        {
            Property property = (parentProperty != null) ? parentType.getProperty(parentProperty) : parentType.getDefaultProperty();
            Style style = (parentProperty != null) ? parentType.getStyle(parentProperty) : null;
           
            if (standardDefs.isItemsComponent(parentType) && (property.getName() == parentType.getDefaultProperty().getName()))
            {
                return true;
            }
           
            if ((property != null) &&
                ((property.getType() == document.getTypeTable().arrayType) ||
                 (property.getType().getElementType() != null)))
            {
                Type propertyElementType = property.getElementType();

                if ((propertyElementType == null) || childType.isAssignableTo(propertyElementType))
                    return true;
            }
            else if (property != null && isStatefulCompatibleType(property.getType()))
View Full Code Here

    /*
     * Ensures that the instance we are marking state-specific is not a scalar property value.
     */
    private boolean validateStatefulModelType(Model targetModel, Model destination, String parentProperty)
    {
        Type parentType = destination != null ? destination.getType() : document.getRoot().getType();
        Property property = (parentProperty != null) ? parentType.getProperty(parentProperty) : parentType.getDefaultProperty();
        Style style = (parentProperty != null) ? parentType.getStyle(parentProperty) : null;
       
        if (parentType != null && property != null && (standardDefs.isItemsComponent(parentType) &&
            (property.getName() == parentType.getDefaultProperty().getName())))
        {
            return true;
        }
        if (property != null && !isStatefulCompatibleType(property.getType()))
        {
View Full Code Here

     */
    private void postProcessBindingInstance(ValueInitializer value, SetPropertyOverride override)
    {
        if (value.getValue() instanceof BindingExpression)
        {
            Type type = document.getTypeTable().getType(override.getDeclaredType());
            Model model = new Model(document, type, null, 0);
            document.ensureDeclaration(model);
            model.ensureBindable();
       
            // We need to ensure each override has its own unique copy of the
View Full Code Here

    public void analyze(ModelNode node)
  {
        String classObjectProxy = NameFormatter.toDot(standardDefs.CLASS_OBJECTPROXY);
        document.addImport(classObjectProxy, node.beginLine);
    Type bindingClass = typeTable.getType(standardDefs.CLASS_OBJECTPROXY);
    if (bindingClass == null)
    {
      log(node, new ClassNotFound(classObjectProxy));
    }
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

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.