1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
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.ObjectLiteralPartTree; |
31 | |
import com.sun.tools.javac.tree.JCTree.JCExpression; |
32 | |
import com.sun.tools.javac.util.Name; |
33 | |
import com.sun.tools.javac.code.Symbol; |
34 | |
import com.sun.javafx.api.JavafxBindStatus; |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | 2 | public class JFXObjectLiteralPart extends JFXStatement implements ObjectLiteralPartTree { |
40 | |
private JCExpression expr; |
41 | |
public Name name; |
42 | 771 | private JCExpression translationInit = null; |
43 | |
public Symbol sym; |
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
protected JFXObjectLiteralPart( |
50 | |
Name name, |
51 | |
JCExpression expr, |
52 | |
JavafxBindStatus bindStatus, |
53 | 0 | Symbol sym) { |
54 | 0 | this.name = name; |
55 | 0 | this.expr = bindStatus == JavafxBindStatus.UNBOUND ? expr : |
56 | |
new JFXBindExpression(expr, bindStatus); |
57 | 0 | this.sym = sym; |
58 | 0 | } |
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
protected JFXObjectLiteralPart( |
66 | |
Name name, |
67 | |
JCExpression expr, |
68 | 771 | Symbol sym) { |
69 | 771 | this.name = name; |
70 | 771 | this.expr = expr; |
71 | 771 | this.sym = sym; |
72 | 771 | } |
73 | 2939 | public void accept(JavafxVisitor v) { v.visitObjectLiteralPart(this); } |
74 | |
|
75 | 0 | public javax.lang.model.element.Name getName() { return name; } |
76 | |
public JCExpression getExpression() { |
77 | 4536 | return expr instanceof JFXBindExpression ? |
78 | |
((JFXBindExpression) expr).getExpression() : |
79 | |
expr; } |
80 | 0 | public JCExpression getMaybeBindExpression() { return expr; } |
81 | 0 | public void setTranslationInit(JCExpression tra) { translationInit = tra; } |
82 | 0 | public JCExpression getTranslationInit() { assert false : "currently not being used"; return translationInit; } |
83 | |
public JavafxBindStatus getBindStatus() { |
84 | 1501 | return expr instanceof JFXBindExpression ? |
85 | |
((JFXBindExpression) expr).getBindStatus() : |
86 | |
JavafxBindStatus.UNBOUND; } |
87 | 736 | public boolean isBound() { return getBindStatus().isBound(); } |
88 | 0 | public boolean isUnidiBind() { return getBindStatus().isUnidiBind(); } |
89 | 0 | public boolean isBidiBind() { return getBindStatus().isBidiBind(); } |
90 | 0 | public boolean isLazy() { return getBindStatus().isLazy(); } |
91 | |
|
92 | |
@Override |
93 | |
public int getTag() { |
94 | 4613 | return JavafxTag.OBJECT_LITERAL_PART; |
95 | |
} |
96 | |
|
97 | |
public JavaFXKind getJavaFXKind() { |
98 | 0 | return JavaFXKind.OBJECT_LITERAL_PART; |
99 | |
} |
100 | |
|
101 | |
public <R, D> R accept(JavaFXTreeVisitor<R, D> visitor, D data) { |
102 | 0 | return visitor.visitObjectLiteralPart(this, data); |
103 | |
} |
104 | |
} |