Lines 84-89
Link Here
|
84 |
*/ |
84 |
*/ |
85 |
public final class TreeUtilities { |
85 |
public final class TreeUtilities { |
86 |
|
86 |
|
|
|
87 |
/**{@link Kind}s that are represented by {@link ClassTree}. |
88 |
* |
89 |
* @since 0.67 |
90 |
*/ |
91 |
public static final Set<Kind> CLASS_TREE_KINDS = EnumSet.of(Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE); |
92 |
|
87 |
private final CompilationInfo info; |
93 |
private final CompilationInfo info; |
88 |
private final CommentHandlerService handler; |
94 |
private final CommentHandlerService handler; |
89 |
|
95 |
|
Lines 95-114
Link Here
|
95 |
} |
101 |
} |
96 |
|
102 |
|
97 |
/**Checks whether the given tree represents a class. |
103 |
/**Checks whether the given tree represents a class. |
|
|
104 |
* @deprecated since 0.67, <code>Tree.getKind() == Kind.CLASS</code> should be used instead. |
98 |
*/ |
105 |
*/ |
|
|
106 |
@Deprecated |
99 |
public boolean isClass(ClassTree tree) { |
107 |
public boolean isClass(ClassTree tree) { |
100 |
return (((JCTree.JCModifiers)tree.getModifiers()).flags & (Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION)) == 0; |
108 |
return (((JCTree.JCModifiers)tree.getModifiers()).flags & (Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION)) == 0; |
101 |
} |
109 |
} |
102 |
|
110 |
|
103 |
/**Checks whether the given tree represents an interface. |
111 |
/**Checks whether the given tree represents an interface. |
|
|
112 |
* @deprecated since 0.67, <code>Tree.getKind() == Kind.INTERFACE</code> should be used instead. |
104 |
*/ |
113 |
*/ |
|
|
114 |
@Deprecated |
105 |
public boolean isInterface(ClassTree tree) { |
115 |
public boolean isInterface(ClassTree tree) { |
106 |
final long flags = ((JCTree.JCModifiers) tree.getModifiers()).flags; |
116 |
final long flags = ((JCTree.JCModifiers) tree.getModifiers()).flags; |
107 |
return (flags & Flags.INTERFACE) != 0 && (flags & Flags.ANNOTATION) == 0; |
117 |
return (flags & Flags.INTERFACE) != 0 && (flags & Flags.ANNOTATION) == 0; |
108 |
} |
118 |
} |
109 |
|
119 |
|
110 |
/**Checks whether the given tree represents an enum. |
120 |
/**Checks whether the given tree represents an enum. |
|
|
121 |
* @deprecated since 0.67, <code>Tree.getKind() == Kind.ENUM</code> should be used instead. |
111 |
*/ |
122 |
*/ |
|
|
123 |
@Deprecated |
112 |
public boolean isEnum(ClassTree tree) { |
124 |
public boolean isEnum(ClassTree tree) { |
113 |
return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ENUM) != 0; |
125 |
return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ENUM) != 0; |
114 |
} |
126 |
} |
Lines 121-127
Link Here
|
121 |
} |
133 |
} |
122 |
|
134 |
|
123 |
/**Checks whether the given tree represents an annotation. |
135 |
/**Checks whether the given tree represents an annotation. |
|
|
136 |
* @deprecated since 0.67, <code>Tree.getKind() == Kind.ANNOTATION_TYPE</code> should be used instead. |
124 |
*/ |
137 |
*/ |
|
|
138 |
@Deprecated |
125 |
public boolean isAnnotation(ClassTree tree) { |
139 |
public boolean isAnnotation(ClassTree tree) { |
126 |
return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ANNOTATION) != 0; |
140 |
return (((JCTree.JCModifiers)tree.getModifiers()).flags & Flags.ANNOTATION) != 0; |
127 |
} |
141 |
} |