Package org.apache.flex.compiler.definitions.references

Examples of org.apache.flex.compiler.definitions.references.INamespaceReference


                break;
            default:
                throw new IllegalStateException("Invalid method kind:" + kind);
        }
       
        final INamespaceReference namespaceReference = getNamespaceReference(name);
        methodDef.setNamespaceReference(namespaceReference);

        int paramTypesSize = method.getParamTypes().size();
        final ParameterDefinition params[] = new ParameterDefinition[paramTypesSize + (method.needsRest() ? 1 : 0)];
        if (params.length > 0)
View Full Code Here


    private INamespaceReference getNamespaceReference(Name name)
    {
        final Namespace namespace = Iterables.getFirst(name.getQualifiers(), null);
        assert namespace != null;
       
        INamespaceReference namespaceReference =
            (INamespaceReference)scopeBuilder.getNamespaceReferenceForNamespace(namespace);
       
        // Interface Namespaces are encoded as regular user defined namespaces in the ABC, but internally
        // we want them to be InterfaceNamespaceDefinitions.  If we come across a user defined namespace while
        // building the traits for an interface, and it matches the interface namespace, then use the interface
View Full Code Here

        String typeName = iinfo.name.getBaseName();

        final Namespace namespace = iinfo.name.getSingleQualifier();
        final String namespaceName = namespace.getName();
        final int namespaceKind = namespace.getKind();
        INamespaceReference namespaceRef = null;
        if (namespaceName.length() != 0 &&
            ((namespaceKind == ABCConstants.CONSTANT_PackageNs) || (namespaceKind == ABCConstants.CONSTANT_PackageInternalNs)))
        {
            namespaceRef =
                ((Workspace)workspace).getPackageNamespaceDefinitionCache().get(namespaceName, namespaceKind == ABCConstants.CONSTANT_PackageInternalNs);
View Full Code Here

     * @return              true if the namespace set says that the definition should be included
     *                      in the results based on the definitions namespace.
     */
    public boolean apply (IDefinition definition)
    {
        INamespaceReference nsRef = definition.getNamespaceReference();

        if( namespaceSet == ASScopeBase.allNamespacesSet )
            return true;

        if( this.extraNamespace != null && nsRef == this.extraNamespace )
View Full Code Here

     * All the non-static members are on InstanceTraits.
     */
    @Override
    public ITraitsVisitor visitInstanceTraits()
    {
        INamespaceReference interfNs = null;
        if( definition instanceof InterfaceDefinition )
            interfNs = ((InterfaceDefinition)definition).getInterfaceNamespaceReference();
        return new ScopedDefinitionTraitsVisitor(scopeBuilder, scope, false, interfNs);
    }
View Full Code Here

        if (isBuiltinNamespaceIdentifier())
        {
            // Resolve public, private, internal, or protected special-like
            // this is so exprs like public::x work correctly.
            ASScope scope = getASScope();
            INamespaceReference nsRef = NamespaceDefinition.createNamespaceReference(scope, this);
            return nsRef != null ? nsRef.resolveNamespaceReference(project) : null;
        }

        IDefinition d = super.resolve(project);

        if (resolveToConcreteNs &&
View Full Code Here

            // If the elementType is int, Number, or uint, then the vector class is a special
            // class that we just need to look up in the project symbol table, otherwise we
            // need to sub-class Vector$object.

            // Some short cuts here to avoid extra lookups.
            INamespaceReference elementTypeNSRef = elementType.getNamespaceReference();
            if ((elementTypeNSRef.equals(NamespaceDefinition.getPublicNamespaceDefinition())) && // int, Number, and uint are all public classes.
            (elementType.getPackageName().length() == 0) && // int, Number, and uint are all in the unnamed package.
            (elementType instanceof IClassDefinition) && // int, Number, and uint are all classes.
            (!(elementType instanceof AppliedVectorDefinition))) // int, Number and uint are not Vector classes.
            {
                // Now just compare the elementType's string base name to
View Full Code Here

        if (!otherIsInterface)
        {
            // Compare method namespaces.
            // Note that equals() for namespace references
            // actually compares URIs for non-builtin namespaces.
            INamespaceReference nsRef1 = getNamespaceReference();
            INamespaceReference nsRef2 = other.getNamespaceReference();
            if (!nsRef1.equals(nsRef2))
                return false;
        }
        else
        {
View Full Code Here

     */

    private AccessorDefinition findCorrespondingAccessor(ASScope scope, ICompilerProject project)
    {
        final String name = getBaseName();
        final INamespaceReference namespaceReference = getNamespaceReference();
        final boolean isStatic = isStatic();
       
        // If the namespace is bad and dosn't resolve, then we can't find corresponding accessor.
        final INamespaceDefinition thisNamespaceDef = namespaceReference.resolveNamespaceReference(project);
        if (thisNamespaceDef == null)
            return null;
        final boolean isBindable = ((NamespaceDefinition)thisNamespaceDef).getAETNamespace().getName().equals(
                                    BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());

        final IDefinitionSet definitionSet = scope.getLocalDefinitionSetByName(name);

        if (definitionSet == null)
            return null;

        final int n = definitionSet.getSize();
        for (int i = 0; i < n; i++)
        {
            IDefinition d = definitionSet.getDefinition(i);
            if (d instanceof IAccessorDefinition)
            {
                final IAccessorDefinition definition = (IAccessorDefinition)d;
               
                // If this is a static accessor, we want another static accessor.
                // If this is an instance accessor, we want another instance accessor.
                if (definition.isStatic() == isStatic)
                {
                    // If this is a getter, we want a setter, and vice versa.
                    if (this instanceof IGetterDefinition && definition instanceof ISetterDefinition ||
                        this instanceof ISetterDefinition && definition instanceof IGetterDefinition)
                    {
                        INamespaceReference testDefRef = definition.getNamespaceReference();
                        INamespaceDefinition testNamespaceDef = testDefRef.resolveNamespaceReference(project);
                        final boolean testBindable = ((NamespaceDefinition)testNamespaceDef).getAETNamespace().getName().equals(
                                BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());
                        /* aharui: namespaces shouldn't have to match.  A subclass may only override
                         * one of the protected methods, and it was legal to have a public getter with
                         * a protected setter and other combinations like that.  Either both
View Full Code Here

            return "";
        }

        assert (!(containingToplevelDefinition instanceof FunctionDefinition)) || (!((FunctionDefinition)containingToplevelDefinition).isConstructor()) : "Constructors should always be contained by class definitions!";

        INamespaceReference toplevelDefinitionNSRef =
                containingToplevelDefinition.getNamespaceReference();

        assert toplevelDefinitionNSRef != null;
        String packageNameFromNSRef = namespaceReferenceToPackageName(toplevelDefinitionNSRef);
        if (packageNameFromNSRef != null)
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.definitions.references.INamespaceReference

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.