Coverage Report - com.sun.tools.javafx.tree.JFXInstanciate
 
Classes in this File Line Coverage Branch Coverage Complexity
JFXInstanciate
65%
17/26
0%
0/5
0
 
 1  
 /*
 2  
  * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
 3  
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 4  
  *
 5  
  * This code is free software; you can redistribute it and/or modify it
 6  
  * under the terms of the GNU General Public License version 2 only, as
 7  
  * published by the Free Software Foundation.  Sun designates this
 8  
  * particular file as subject to the "Classpath" exception as provided
 9  
  * by Sun in the LICENSE file that accompanied this code.
 10  
  *
 11  
  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  
  * version 2 for more details (a copy is included in the LICENSE file that
 15  
  * accompanied this code).
 16  
  *
 17  
  * You should have received a copy of the GNU General Public License version
 18  
  * 2 along with this work; if not, write to the Free Software Foundation,
 19  
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  
  *
 21  
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 22  
  * CA 95054 USA or visit www.sun.com if you need additional information or
 23  
  * have any questions.
 24  
  */
 25  
 
 26  
 package com.sun.tools.javafx.tree;
 27  
 
 28  
 import com.sun.javafx.api.tree.InstantiateTree;
 29  
 import com.sun.javafx.api.tree.JavaFXTree.JavaFXKind;
 30  
 import com.sun.javafx.api.tree.JavaFXTreeVisitor;
 31  
 import com.sun.javafx.api.tree.ObjectLiteralPartTree;
 32  
 import com.sun.source.tree.ExpressionTree;
 33  
 import com.sun.tools.javac.code.Symbol;
 34  
 import com.sun.tools.javac.code.Symbol.*;
 35  
 import com.sun.tools.javac.tree.JCTree;
 36  
 import com.sun.tools.javac.tree.JCTree.*;
 37  
 import com.sun.tools.javac.util.List;
 38  
 
 39  
 /**
 40  
  * A class declaration
 41  
  */
 42  3
 public class JFXInstanciate extends JFXExpression implements InstantiateTree {
 43  
 
 44  
     private final JCExpression clazz;
 45  
     private final JFXClassDeclaration def;
 46  
     private final List<JCExpression> args;
 47  
     private final List<JFXObjectLiteralPart> parts;
 48  
     private final List<JFXVar> localVars;
 49  
     public ClassSymbol sym;
 50  
     public Symbol constructor;
 51  
 
 52  672
     protected JFXInstanciate(JCExpression clazz, JFXClassDeclaration def, List<JCExpression> args, List<JFXObjectLiteralPart> parts, List<JFXVar> localVars, ClassSymbol sym) {
 53  672
         this.clazz = clazz;
 54  672
         this.def = def;
 55  672
         this.args = args;
 56  672
         this.parts = parts;
 57  672
         this.localVars = localVars;
 58  672
         this.sym = sym;
 59  672
     }
 60  
 
 61  
     public void accept(JavafxVisitor v) {
 62  3847
         v.visitInstanciate(this);
 63  3847
     }
 64  
 
 65  
     public JCExpression getIdentifier() {
 66  3865
         return clazz;
 67  
     }
 68  
     
 69  
     public List<JCExpression> getArgs() {
 70  4502
         return args;
 71  
     }
 72  
 
 73  
     public java.util.List<ExpressionTree> getArguments() {
 74  0
         return JFXTree.convertList(ExpressionTree.class, args);
 75  
     }
 76  
 
 77  
     public Symbol getIdentifierSym() {
 78  0
         switch (clazz.getTag()) {
 79  
             case JCTree.IDENT:
 80  0
                 return ((JCIdent) clazz).sym;
 81  
             case JCTree.SELECT:
 82  0
                 return ((JCFieldAccess) clazz).sym;
 83  
         }
 84  0
         assert false;
 85  0
         return null;
 86  
     }
 87  
 
 88  
     public List<JFXVar> getLocalvars() {
 89  3860
         return localVars;
 90  
     }
 91  
 
 92  
     public List<JFXObjectLiteralPart> getParts() {
 93  3787
         return parts;
 94  
     }
 95  
 
 96  
     public java.util.List<ObjectLiteralPartTree> getLiteralParts() {
 97  0
         return JFXTree.convertList(ObjectLiteralPartTree.class, parts);
 98  
     }
 99  
 
 100  
     public JFXClassDeclaration getClassBody() {
 101  5366
         return def;
 102  
     }
 103  
 
 104  
     @Override
 105  
     public int getTag() {
 106  13745
         return JavafxTag.OBJECT_LITERAL;
 107  
     }
 108  
 
 109  
     public JavaFXKind getJavaFXKind() {
 110  0
         return JavaFXKind.INSTANTIATE;
 111  
     }
 112  
 
 113  
     public <R, D> R accept(JavaFXTreeVisitor<R, D> visitor, D data) {
 114  0
         return visitor.visitInstantiate(this, data);
 115  
     }
 116  
 }