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

COVERAGE SUMMARY FOR SOURCE FILE [BooleanLiteral.java]

nameclass, %method, %block, %line, %
BooleanLiteral.java100% (1/1)100% (6/6)100% (36/36)100% (9/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BooleanLiteral100% (1/1)100% (6/6)100% (36/36)100% (9/9)
BooleanLiteral (FilePosition, Boolean, List): void 100% (1/1)100% (6/6)100% (2/2)
BooleanLiteral (FilePosition, boolean): void 100% (1/1)100% (7/7)100% (3/3)
getValue (): Boolean 100% (1/1)100% (4/4)100% (1/1)
getValueInBooleanContext (): boolean 100% (1/1)100% (3/3)100% (1/1)
toJsonML (): JsonML 100% (1/1)100% (14/14)100% (1/1)
typeOf (): String 100% (1/1)100% (2/2)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.parser.ParseTreeNode;
19import com.google.javascript.jscomp.jsonml.JsonML;
20import com.google.javascript.jscomp.jsonml.TagAttr;
21import com.google.javascript.jscomp.jsonml.TagType;
22 
23import java.util.List;
24 
25/**
26 * A literal boolean value.
27 *
28 * @author mikesamuel@gmail.com
29 */
30public final class BooleanLiteral extends Literal {
31  public final boolean value;
32 
33  /** @param children unused.  This ctor is provided for reflection. */
34  @ReflectiveCtor
35  public BooleanLiteral(
36      FilePosition pos, Boolean value, List<? extends ParseTreeNode> children) {
37    this(pos, value);
38  }
39 
40  public BooleanLiteral(FilePosition pos, boolean value) {
41    super(pos);
42    this.value = value;
43  }
44 
45  @Override
46  public Boolean getValue() {
47    return Boolean.valueOf(value);
48  }
49 
50  @Override
51  public boolean getValueInBooleanContext() {
52    return value;
53  }
54 
55  public String typeOf() { return "boolean"; }
56 
57  public JsonML toJsonML() {
58    return JsonMLBuilder.builder(TagType.LiteralExpr, getFilePosition())
59        .setAttribute(TagAttr.TYPE, "boolean")
60        .setAttribute(TagAttr.VALUE, value)
61        .build();
62  }
63}

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