EMMA Coverage Report (generated Mon Nov 01 16:48:29 PDT 2010)
[all classes][com.google.caja.parser.js]

COVERAGE SUMMARY FOR SOURCE FILE [DefaultCaseStmt.java]

nameclass, %method, %block, %line, %
DefaultCaseStmt.java100% (1/1)100% (7/7)100% (45/45)100% (13/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DefaultCaseStmt100% (1/1)100% (7/7)100% (45/45)100% (13/13)
DefaultCaseStmt (FilePosition, Block): void 100% (1/1)100% (7/7)100% (3/3)
DefaultCaseStmt (FilePosition, Void, List): void 100% (1/1)100% (8/8)100% (2/2)
childrenChanged (): void 100% (1/1)100% (10/10)100% (3/3)
getBody (): Block 100% (1/1)100% (3/3)100% (1/1)
getValue (): Object 100% (1/1)100% (2/2)100% (1/1)
renderHead (RenderContext): void 100% (1/1)100% (5/5)100% (2/2)
toJsonML (): JsonML 100% (1/1)100% (10/10)100% (1/1)

1// Copyright (C) 2005 Google Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package com.google.caja.parser.js;
16 
17import com.google.caja.lexer.FilePosition;
18import com.google.caja.reporting.RenderContext;
19import com.google.javascript.jscomp.jsonml.JsonML;
20import com.google.javascript.jscomp.jsonml.TagType;
21 
22import java.util.List;
23 
24/**
25 *
26 * @author mikesamuel@gmail.com
27 */
28public final class DefaultCaseStmt extends SwitchCase {
29  private Block body;
30 
31  /** @param value unused.  This ctor is provided for reflection. */
32  @ReflectiveCtor
33  public DefaultCaseStmt(
34      FilePosition pos, Void value, List<? extends Block> children) {
35    this(pos, children.get(0));
36  }
37 
38  public DefaultCaseStmt(FilePosition pos, Block body) {
39    super(pos);
40    appendChild(body);
41  }
42 
43  @Override
44  protected void childrenChanged() {
45    super.childrenChanged();
46    this.body = (Block) children().get(0);
47  }
48 
49  @Override
50  public Object getValue() { return null; }
51 
52  @Override
53  public Block getBody() { return body; }
54 
55  @Override
56  protected void renderHead(RenderContext rc) {
57    rc.getOut().consume("default");
58  }
59 
60  public JsonML toJsonML() {
61    return JsonMLBuilder.builder(TagType.DefaultCase, getFilePosition())
62        .addChildren(body.children())
63        .build();
64  }
65}

[all classes][com.google.caja.parser.js]
EMMA 2.0.5312 (C) Vladimir Roubtsov