Package flex2.compiler.util

Examples of flex2.compiler.util.QName


                    {
                        String s = inherited.get(j).toString().intern();
                        //Make sure that the inheritance list doesn't contain itself or a package.
                        if (!s.equals(debug) && !s.equals(otherPackage))
                        {
                            QName q = new QName(s);
                            if (!q.getLocalPart().equals(""))
                            {
                                assert !((q.getLocalPart().equals(cls)) && (q.getNamespace().equals(pkg))) : "same class";
                                inherit.add(q);
                            }
                        }
                    }
                }
            }
            else if (current.def instanceof FunctionDefinitionNode)
            {
                FunctionDefinitionNode fd = (FunctionDefinitionNode)current.def;
                debug = fd.fexpr.debug_name;
                int colon = debug.indexOf(':');
                int slash = debug.indexOf('/');
                if (colon < 0)
                {
                    pkg = "";
                    if (slash < 0) //when there's only a name (Ex. debug == Foobar)
                        cls = "";
                    else  //when there happens to be a slash (Ex. debug == Class/Function)
                        cls = debug.substring(0, slash).intern();
                }
                else
                {
                    pkg = debug.substring(0, colon).intern();
                    if (slash < 0)   //when you have debug == packageName:Function
                        cls = "";
                    else if (slash < colon//when debug == className/private:something (mxml case)
                    {
                        pkg = "";
                        cls = debug.substring(0, slash).intern();
                    }
                    else  //when debug == packageName:className/Function
                        cls = debug.substring(colon + 1, slash).intern();
                }
            }
            else if (current.def instanceof VariableDefinitionNode)
            {
                VariableBindingNode vb = (VariableBindingNode)(((VariableDefinitionNode)current.def).list.items.get(0));
                debug = vb.debug_name;
                int colon = debug.indexOf(':');
                int slash = debug.indexOf('/');
                if (colon < 0)
                {
                    pkg = "";
                    if (slash < 0)
                        cls = "";
                    else
                        cls = debug.substring(0, slash).intern();
                }
                else
                {
                    pkg = debug.substring(0, colon).intern();
                    if (slash < 0)
                        cls = "";
                    else if (slash < colon)
                    {
                        pkg = "";
                        cls = debug.substring(0, slash).intern();
                    }
                    else
                        cls = debug.substring(colon + 1, slash).intern();
                }
            }
            //Add to list for other classes (they will be in a separate package)
            if (!pkg.equals(packageName))
            {
                if (cls.equals(""))
                    cls = "null";
                List<DocCommentNode> l = otherClasses.get(cls);
                if (l == null)
                    l = new ArrayList<DocCommentNode>();
                l.add(current);
                otherClasses.put(cls, l);
            }
            else  //Add to list for public class
                mainClass.add(current);
        }
       
        if (mainDef//there exists a public class definition
            this.put(name, mainClass, inheritance, exclude, cx, abcClass);
        else    //null classname for package level functions
            this.put(new QName(packageName, "null"), mainClass, inheritance, exclude, cx, abcClass);
       
        //for classes outside the package but in the same sourcefile (should be private, but we exclude anyway)
        if (otherPackage != null)
        {
            Iterator<String> iter = otherClasses.keySet().iterator();
            while (iter.hasNext())
            {
                //Add other classes under asc generated package name
                String cls = iter.next().intern();
                this.put(new QName(otherPackage, cls), otherClasses.get(cls), otherInheritance.get(cls), true, cx, abcClass);
            }
        }
       
        //This is to ensure that the packageTable contains all the package names (as keys).
        if (!packageTable.containsKey(packageName))
View Full Code Here


        {
            if (packageName == null)
                packageName = "";
            if (className == null || className.equals(""))
                className = "null";
            String name = NameFormatter.toDot(new QName(packageName, className));
            CommentsTable temp = classTable.get(name);
            return new ArrayList<DocComment>(temp.values());
        } catch (NullPointerException e)
        {
            return null;   //if a given class/package do not exist
View Full Code Here

           
            //Search through all parent classes and implemented interfaces
            Iterator iter = inheritance.iterator();
           
            CommentsTable baseClassObj = null;
            QName baseClass = null;
            while (iter.hasNext()){
                QName nextClass = (QName)iter.next();
                CommentsTable t = classTable.get(NameFormatter.toDot(nextClass));
               
                if(restoreBuiltinClasses && t == null && nextClass.getNamespace().equals(QName.DEFAULT_NAMESPACE) && !"Object_ASDoc".equals(abcClass.getName()))
                {
                    nextClass = new QName(QName.DEFAULT_NAMESPACE, nextClass.getLocalPart() + "_ASDoc");
                    t = classTable.get(NameFormatter.toDot(nextClass));
                }
               
                if (t != null)
                {
                    if(!t.isInterface())
                    {
                        baseClassObj = t;
                        baseClass = nextClass;
                        continue;
                    }
                   
                    //retrieve inherited Documentation.
                    //Special case for class definition comments
                    if (key.type == DocComment.CLASS)
                        inheritDoc = t.getCommentForInherit(new KeyPair(nextClass.getLocalPart(), DocComment.CLASS));
                    else 
                        inheritDoc = t.getCommentForInherit(key);
                }
                if (inheritDoc != null)
                    break;
View Full Code Here

          for (Iterator iter = signatureChecksums.entrySet().iterator(); iter.hasNext();)
          {
            Map.Entry entry = (Map.Entry)iter.next();
           
            // lookup definition in swc context
                    QName qName = (QName) entry.getKey();
            Long dataSignatureChecksum = (Long)entry.getValue();
            Long swcSignatureChecksum = swcContext.getChecksum(qName);
                    if (swcSignatureChecksum == null && qName != null)
                    {
                        Source source = swcContext.getSource(qName.getNamespace(), qName.getLocalPart());
                        if (source != null)
                        {
                            swcSignatureChecksum = new Long(source.getLastModified());
                        }
                    }
View Full Code Here

    if (data.swcDefSignatureChecksums != null)
    {
      for (Iterator iter = unit.topLevelDefinitions.iterator(); iter.hasNext();)
        {
          QName qname = (QName) iter.next();
            data.swcDefSignatureChecksums.put(qname, signatureChecksum);
        }
    }
  }
View Full Code Here

       
        scripts = new TreeMap<String, Script>();
       
        for (int i = 0; i < definitionNames.length; i++)
        {
            QName def = names.get(i);
            Script s = swcContext.getScript(def, includeBytecodes);
            scripts.put(def.toString(), s);
        }
       
        components = new TreeMap<String, Component>();
       
        for (Iterator i = swcContext.getComponentIterator(); i.hasNext(); )
View Full Code Here

                    }

          //  HACK for 174078: width="n%" at the root of an MXML app is a specification of the ratio of
          //  player to browser width, not app to player width. So we pass it through to the SWF, but strip
          //  it from the MXML DOM, preventing it from showing up in the property settings for the root UIC.
          node.removeAttribute(new QName(width.getNamespace(), rootAttrWidth));
        }
        else
        {
          if (value instanceof Double)
          {
            value = new Integer(((Double) value).intValue());
          }
          swfvarmap.put(rootAttrWidth, value);
        }
      }
        }

        Attribute height = node.getAttribute(DEFAULT_NAMESPACE, rootAttrHeight);
        if (height != null && isApplication)
        {
            String heightString = height.getValue().toString();
      Object value = rootAttributeParser.parseNumberOrPercentage(heightString,
              height.getLine(),
              rootAttrHeight);

      if (value != null)
      {
        if (rootAttributeParser.wasPercentage())
        {
          if (heightString.endsWith("%"))
                    {
                        swfvarmap.put("heightPercent", heightString);
                    }
                    else
                    {
                        swfvarmap.put("heightPercent", heightString + '%');
                    }

          //  HACK for 174078: as above for width
          node.removeAttribute(new QName(height.getNamespace(), rootAttrHeight));
        }
        else
        {
          if (value instanceof Double)
          {
View Full Code Here

    Map<String, Object> rootAttributeEmbedNamesMap = new HashMap<String, Object>();
    //  Type type = typeTable.getType(node.getNamespace(), node.getLocalPart());

    for (Iterator it = node.getAttributeNames(); it != null && it.hasNext();)
    {
      QName qname = (QName) it.next();
      //  String namespace = qname.getNamespace();
      String localPart = qname.getLocalPart();

      /*
      if ((type.getProperty( localPart ) != null)
        || (type.hasEffect( localPart ))
        || (type.getStyle( localPart ) != null)
View Full Code Here

        Source source = new Source(file, relativePath, className, null, false, false, false);
        source.setAssetInfo(unit.getAssets().get(className));
        source.setPathResolver(unit.getSource().getPathResolver());

        if (source != null)
            sources.put(new QName(packageName, className), source);

        // Also recursively generate sources for any additional assets
        List<Transcoder.TranscodingResults> childAssets = asset.additionalAssets;
        if (childAssets != null)
        {
View Full Code Here

        {
            Iterator<QName> iterator = variables.iterator();

            while ( iterator.hasNext() )
            {
                QName qName = iterator.next();
                if ( variableName.equals( qName.getLocalPart() ) )
                {
                    result = true;
                }
            }
        }
View Full Code Here

TOP

Related Classes of flex2.compiler.util.QName

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.