< prev index next >

src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java

Print this page




 137      * @param e {@inheritDoc}
 138      * @param p {@inheritDoc}
 139      * @return  the result of the kind-specific visit method
 140      */
 141     @Override
 142     public R visitType(TypeElement e, P p) {
 143         ElementKind k = e.getKind();
 144         switch(k) {
 145         case ANNOTATION_TYPE:
 146             return visitTypeAsAnnotationType(e, p);
 147 
 148         case CLASS:
 149             return visitTypeAsClass(e, p);
 150 
 151         case ENUM:
 152             return visitTypeAsEnum(e, p);
 153 
 154         case INTERFACE:
 155             return visitTypeAsInterface(e, p);
 156 



 157         default:
 158             throw new AssertionError("Bad kind " + k + " for TypeElement" + e);
 159         }
 160     }
 161 
 162     /**
 163      * Visits an {@code ANNOTATION_TYPE} type element.
 164      *
 165      * @implSpec This implementation calls {@code defaultAction}.
 166      *
 167      * @param e the element to visit
 168      * @param p a visitor-specified parameter
 169      * @return  the result of {@code defaultAction}
 170      */
 171     public R visitTypeAsAnnotationType(TypeElement e, P p) {
 172         return defaultAction(e, p);
 173     }
 174 
 175     /**
 176      * Visits a {@code CLASS} type element.


 195      * @return  the result of {@code defaultAction}
 196      */
 197     public R visitTypeAsEnum(TypeElement e, P p) {
 198         return defaultAction(e, p);
 199     }
 200 
 201     /**
 202      * Visits an {@code INTERFACE} type element.
 203      *
 204      * @implSpec This implementation calls {@code defaultAction}.
 205      *.
 206      * @param e the element to visit
 207      * @param p a visitor-specified parameter
 208      * @return  the result of {@code defaultAction}
 209      */
 210     public R visitTypeAsInterface(TypeElement e, P p) {
 211         return defaultAction(e, p);
 212     }
 213 
 214     /**















 215      * Visits a variable element
 216      *
 217      * @implSpec This implementation dispatches to the visit method for
 218      * the specific {@linkplain ElementKind kind} of variable, {@code
 219      * ENUM_CONSTANT}, {@code EXCEPTION_PARAMETER}, {@code FIELD},
 220      * {@code LOCAL_VARIABLE}, {@code PARAMETER}, or {@code RESOURCE_VARIABLE}.

 221      *
 222      * @param e {@inheritDoc}
 223      * @param p {@inheritDoc}
 224      * @return  the result of the kind-specific visit method
 225      */
 226     @Override
 227     public R visitVariable(VariableElement e, P p) {
 228         ElementKind k = e.getKind();
 229         switch(k) {
 230         case ENUM_CONSTANT:
 231             return visitVariableAsEnumConstant(e, p);
 232 
 233         case EXCEPTION_PARAMETER:
 234             return visitVariableAsExceptionParameter(e, p);
 235 
 236         case FIELD:
 237             return visitVariableAsField(e, p);
 238 
 239         case LOCAL_VARIABLE:
 240             return visitVariableAsLocalVariable(e, p);
 241 
 242         case PARAMETER:
 243             return visitVariableAsParameter(e, p);
 244 
 245         case RESOURCE_VARIABLE:
 246             return visitVariableAsResourceVariable(e, p);
 247 



 248         default:
 249             throw new AssertionError("Bad kind " + k + " for VariableElement" + e);
 250         }
 251     }
 252 
 253     /**
 254      * Visits an {@code ENUM_CONSTANT} variable element.
 255      *
 256      * @implSpec This implementation calls {@code defaultAction}.
 257      *.
 258      * @param e the element to visit
 259      * @param p a visitor-specified parameter
 260      * @return  the result of {@code defaultAction}
 261      */
 262     public R visitVariableAsEnumConstant(VariableElement e, P p) {
 263         return defaultAction(e, p);
 264     }
 265 
 266     /**
 267      * Visits an {@code EXCEPTION_PARAMETER} variable element.


 310      * @param e the element to visit
 311      * @param p a visitor-specified parameter
 312      * @return  the result of {@code defaultAction}
 313      */
 314     public R visitVariableAsParameter(VariableElement e, P p) {
 315         return defaultAction(e, p);
 316     }
 317 
 318     /**
 319      * Visits a {@code RESOURCE_VARIABLE} variable element.
 320      *
 321      * @implSpec This implementation calls {@code visitUnknown}.
 322      *
 323      * @param e the element to visit
 324      * @param p a visitor-specified parameter
 325      * @return  the result of {@code visitUnknown}
 326      *
 327      * @since 1.7
 328      */
 329     public R visitVariableAsResourceVariable(VariableElement e, P p) {















 330         return visitUnknown(e, p);
 331     }
 332 
 333     /**
 334      * {@inheritDoc}
 335      *
 336      * @implSpec This implementation dispatches to the visit method
 337      * for the specific {@linkplain ElementKind kind} of executable,
 338      * {@code CONSTRUCTOR}, {@code INSTANCE_INIT}, {@code METHOD}, or
 339      * {@code STATIC_INIT}.
 340      *
 341      * @param e {@inheritDoc}
 342      * @param p {@inheritDoc}
 343      * @return  the result of the kind-specific visit method
 344      */
 345     @Override
 346     public R visitExecutable(ExecutableElement e, P p) {
 347         ElementKind k = e.getKind();
 348         switch(k) {
 349         case CONSTRUCTOR:




 137      * @param e {@inheritDoc}
 138      * @param p {@inheritDoc}
 139      * @return  the result of the kind-specific visit method
 140      */
 141     @Override
 142     public R visitType(TypeElement e, P p) {
 143         ElementKind k = e.getKind();
 144         switch(k) {
 145         case ANNOTATION_TYPE:
 146             return visitTypeAsAnnotationType(e, p);
 147 
 148         case CLASS:
 149             return visitTypeAsClass(e, p);
 150 
 151         case ENUM:
 152             return visitTypeAsEnum(e, p);
 153 
 154         case INTERFACE:
 155             return visitTypeAsInterface(e, p);
 156 
 157         case RECORD:
 158             return visitTypeAsRecord(e, p);
 159 
 160         default:
 161             throw new AssertionError("Bad kind " + k + " for TypeElement" + e);
 162         }
 163     }
 164 
 165     /**
 166      * Visits an {@code ANNOTATION_TYPE} type element.
 167      *
 168      * @implSpec This implementation calls {@code defaultAction}.
 169      *
 170      * @param e the element to visit
 171      * @param p a visitor-specified parameter
 172      * @return  the result of {@code defaultAction}
 173      */
 174     public R visitTypeAsAnnotationType(TypeElement e, P p) {
 175         return defaultAction(e, p);
 176     }
 177 
 178     /**
 179      * Visits a {@code CLASS} type element.


 198      * @return  the result of {@code defaultAction}
 199      */
 200     public R visitTypeAsEnum(TypeElement e, P p) {
 201         return defaultAction(e, p);
 202     }
 203 
 204     /**
 205      * Visits an {@code INTERFACE} type element.
 206      *
 207      * @implSpec This implementation calls {@code defaultAction}.
 208      *.
 209      * @param e the element to visit
 210      * @param p a visitor-specified parameter
 211      * @return  the result of {@code defaultAction}
 212      */
 213     public R visitTypeAsInterface(TypeElement e, P p) {
 214         return defaultAction(e, p);
 215     }
 216 
 217     /**
 218      * Visits a {@code RECORD} type element.
 219      *
 220      * @implSpec This implementation calls {@code visitUnknown}.
 221      *.
 222      * @param e the element to visit
 223      * @param p a visitor-specified parameter
 224      * @return  the result of {@code visitUnknown}
 225      *
 226      * @since amber
 227      */
 228     public R visitTypeAsRecord(TypeElement e, P p) {
 229         return visitUnknown(e, p);
 230     }
 231 
 232     /**
 233      * Visits a variable element
 234      *
 235      * @implSpec This implementation dispatches to the visit method for
 236      * the specific {@linkplain ElementKind kind} of variable, {@code
 237      * ENUM_CONSTANT}, {@code EXCEPTION_PARAMETER}, {@code FIELD},
 238      * {@code LOCAL_VARIABLE}, {@code PARAMETER}, {@code RESOURCE_VARIABLE},
 239      * or {@code STATE_COMPONENT}.
 240      *
 241      * @param e {@inheritDoc}
 242      * @param p {@inheritDoc}
 243      * @return  the result of the kind-specific visit method
 244      */
 245     @Override
 246     public R visitVariable(VariableElement e, P p) {
 247         ElementKind k = e.getKind();
 248         switch(k) {
 249         case ENUM_CONSTANT:
 250             return visitVariableAsEnumConstant(e, p);
 251 
 252         case EXCEPTION_PARAMETER:
 253             return visitVariableAsExceptionParameter(e, p);
 254 
 255         case FIELD:
 256             return visitVariableAsField(e, p);
 257 
 258         case LOCAL_VARIABLE:
 259             return visitVariableAsLocalVariable(e, p);
 260 
 261         case PARAMETER:
 262             return visitVariableAsParameter(e, p);
 263 
 264         case RESOURCE_VARIABLE:
 265             return visitVariableAsResourceVariable(e, p);
 266 
 267         case STATE_COMPONENT:
 268             return visitVariableAsStateComponent(e, p);
 269 
 270         default:
 271             throw new AssertionError("Bad kind " + k + " for VariableElement" + e);
 272         }
 273     }
 274 
 275     /**
 276      * Visits an {@code ENUM_CONSTANT} variable element.
 277      *
 278      * @implSpec This implementation calls {@code defaultAction}.
 279      *.
 280      * @param e the element to visit
 281      * @param p a visitor-specified parameter
 282      * @return  the result of {@code defaultAction}
 283      */
 284     public R visitVariableAsEnumConstant(VariableElement e, P p) {
 285         return defaultAction(e, p);
 286     }
 287 
 288     /**
 289      * Visits an {@code EXCEPTION_PARAMETER} variable element.


 332      * @param e the element to visit
 333      * @param p a visitor-specified parameter
 334      * @return  the result of {@code defaultAction}
 335      */
 336     public R visitVariableAsParameter(VariableElement e, P p) {
 337         return defaultAction(e, p);
 338     }
 339 
 340     /**
 341      * Visits a {@code RESOURCE_VARIABLE} variable element.
 342      *
 343      * @implSpec This implementation calls {@code visitUnknown}.
 344      *
 345      * @param e the element to visit
 346      * @param p a visitor-specified parameter
 347      * @return  the result of {@code visitUnknown}
 348      *
 349      * @since 1.7
 350      */
 351     public R visitVariableAsResourceVariable(VariableElement e, P p) {
 352         return visitUnknown(e, p);
 353     }
 354 
 355     /**
 356      * Visits a {@code STATE_COMPONENT} variable element.
 357      *
 358      * @implSpec This implementation calls {@code visitUnknown}.
 359      *
 360      * @param e the element to visit
 361      * @param p a visitor-specified parameter
 362      * @return  the result of {@code visitUnknown}
 363      *
 364      * @since amber
 365      */
 366     public R visitVariableAsStateComponent(VariableElement e, P p) {
 367         return visitUnknown(e, p);
 368     }
 369 
 370     /**
 371      * {@inheritDoc}
 372      *
 373      * @implSpec This implementation dispatches to the visit method
 374      * for the specific {@linkplain ElementKind kind} of executable,
 375      * {@code CONSTRUCTOR}, {@code INSTANCE_INIT}, {@code METHOD}, or
 376      * {@code STATIC_INIT}.
 377      *
 378      * @param e {@inheritDoc}
 379      * @param p {@inheritDoc}
 380      * @return  the result of the kind-specific visit method
 381      */
 382     @Override
 383     public R visitExecutable(ExecutableElement e, P p) {
 384         ElementKind k = e.getKind();
 385         switch(k) {
 386         case CONSTRUCTOR:


< prev index next >