View Javadoc

    1   /**
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd.lang.ecmascript.ast;
    5
    6   import org.mozilla.javascript.ast.ObjectLiteral;
    7
    8   public class ASTObjectLiteral extends AbstractEcmascriptNode<ObjectLiteral> implements DestructuringNode, TrailingCommaNode {
    9       private boolean trailingComma;
    10
    11      public ASTObjectLiteral(ObjectLiteral objectLiteral) {
    12  	super(objectLiteral);
    13      }
    14
    15      /**
    16       * Accept the visitor.
    17       */
    18      public Object jjtAccept(EcmascriptParserVisitor visitor, Object data) {
    19  	return visitor.visit(this, data);
    20      }
    21
    22      public ASTObjectProperty getObjectProperty(int index) {
    23  	return (ASTObjectProperty) jjtGetChild(index);
    24      }
    25
    26      public boolean isDestructuring() {
    27  	return node.isDestructuring();
    28      }
    29
    30      public boolean isTrailingComma() {
    31  	return trailingComma;
    32      }
    33
    34      public void setTrailingComma(boolean trailingComma) {
    35  	this.trailingComma = trailingComma;
    36      }
    37  }