OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 package com.google.dart.compiler.ast; |
| 6 |
| 7 import java.util.List; |
| 8 |
| 9 /** |
| 10 * The abstract class {@code DartNodeWithMetadata} defines the behavior of nodes
that can have |
| 11 * metadata associated with them. |
| 12 */ |
| 13 public abstract class DartNodeWithMetadata extends DartNode { |
| 14 private NodeList<DartAnnotation> metadata = NodeList.create(this); |
| 15 |
| 16 protected DartNodeWithMetadata() { |
| 17 super(); |
| 18 } |
| 19 |
| 20 public NodeList<DartAnnotation> getMetadata() { |
| 21 return metadata; |
| 22 } |
| 23 |
| 24 public void setMetadata(List<DartAnnotation> metadata) { |
| 25 this.metadata.addAll(metadata); |
| 26 } |
| 27 |
| 28 @Override |
| 29 public void visitChildren(ASTVisitor<?> visitor) { |
| 30 metadata.accept(visitor); |
| 31 } |
| 32 } |
OLD | NEW |