Coverage Report - com.sun.tools.javafx.tree.JFXOverrideAttribute
 
Classes in this File Line Coverage Branch Coverage Complexity
JFXOverrideAttribute
62%
13/21
50%
1/2
0
 
 1  
 /*
 2  
  * Copyright 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.JavaFXTree.JavaFXKind;
 29  
 import com.sun.javafx.api.tree.JavaFXTreeVisitor;
 30  
 import com.sun.javafx.api.tree.OnReplaceTree;
 31  
 import com.sun.javafx.api.tree.JavaFXExpressionTree;
 32  
 import com.sun.javafx.api.tree.TriggerTree;
 33  
 import com.sun.tools.javac.code.Symbol.VarSymbol;
 34  
 import com.sun.tools.javac.tree.JCTree.JCIdent;
 35  
 import com.sun.javafx.api.JavafxBindStatus;
 36  
 import com.sun.source.tree.ExpressionTree;
 37  
 
 38  
 /**
 39  
  * Wrapper for loose triggers
 40  
  *
 41  
  * @author Robert Field
 42  
  */
 43  
 public class JFXOverrideAttribute extends JFXStatement implements TriggerTree {
 44  
     private final JCIdent expr;
 45  
     private final JCExpression init;
 46  
     private final JavafxBindStatus bindStatus;
 47  
     private final JFXOnReplace onReplace;
 48  
     
 49  
     public VarSymbol sym;
 50  
     
 51  
     protected JFXOverrideAttribute(JCIdent expr,
 52  
             JCExpression init,
 53  
             JavafxBindStatus bindStat,
 54  
             JFXOnReplace onReplace,
 55  9
             VarSymbol sym) {
 56  9
         this.expr = expr;
 57  9
         this.init = init;
 58  9
         this.bindStatus = bindStat == null ? JavafxBindStatus.UNBOUND : bindStat;
 59  9
         this.onReplace = onReplace;
 60  9
         this.sym = sym;
 61  9
     }
 62  
     
 63  60
     public void accept(JavafxVisitor v) { v.visitOverrideAttribute(this); }
 64  
     
 65  
     public JCIdent getId() {
 66  69
         return expr;
 67  
     }
 68  
 
 69  
     public JCExpression getInitializer() {
 70  87
         return init;
 71  
     }
 72  
 
 73  
     public ExpressionTree getExpressionTree() {
 74  0
         return (ExpressionTree)expr;
 75  
     }
 76  
 
 77  
     public JavafxBindStatus getBindStatus() {
 78  9
         return bindStatus;
 79  
     }
 80  
 
 81  
     public boolean isBound() {
 82  0
         return bindStatus.isBound();
 83  
     }
 84  
 
 85  
     public boolean isUnidiBind() {
 86  0
         return bindStatus.isUnidiBind();
 87  
     }
 88  
 
 89  
     public boolean isBidiBind() {
 90  0
         return bindStatus.isBidiBind();
 91  
     }
 92  
 
 93  
     public boolean isLazy() {
 94  0
         return bindStatus.isLazy();
 95  
     }
 96  
 
 97  
     public OnReplaceTree getOnReplaceTree() {
 98  0
         return (OnReplaceTree) onReplace;
 99  
     }
 100  
 
 101  
     public JFXOnReplace getOnReplace() {
 102  69
         return onReplace;
 103  
     }
 104  
 
 105  
     public JavaFXKind getJavaFXKind() {
 106  0
         return JavaFXKind.TRIGGER_WRAPPER;
 107  
     }
 108  
 
 109  
     @Override
 110  
     public int getTag() {
 111  456
         return JavafxTag.OVERRIDE_ATTRIBUTE_DEF;
 112  
     }
 113  
     
 114  
     public <R, D> R accept(JavaFXTreeVisitor<R, D> visitor, D data) {
 115  0
         return visitor.visitTrigger(this, data);
 116  
     }
 117  
 }