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

COVERAGE SUMMARY FOR SOURCE FILE [DomParserMessageType.java]

nameclass, %method, %block, %line, %
DomParserMessageType.java100% (1/1)71%  (5/7)93%  (128/137)100% (17.9/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DomParserMessageType100% (1/1)71%  (5/7)93%  (128/137)100% (17.9/18)
<static initializer> 100% (1/1)100% (100/100)100% (9/9)
DomParserMessageType (String, int, String, MessageLevel): void 100% (1/1)100% (15/15)100% (5/5)
format (MessagePart [], MessageContext, Appendable): void 100% (1/1)100% (7/7)100% (2/2)
getLevel (): MessageLevel 100% (1/1)100% (3/3)100% (1/1)
getParamCount (): int 100% (1/1)100% (3/3)100% (1/1)
valueOf (String): DomParserMessageType 0%   (0/1)0%   (0/5)0%   (0/1)
values (): DomParserMessageType [] 0%   (0/1)0%   (0/4)0%   (0/1)

1// Copyright (C) 2007 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.html;
16 
17import com.google.caja.reporting.MessageContext;
18import com.google.caja.reporting.MessageLevel;
19import com.google.caja.reporting.MessagePart;
20import com.google.caja.reporting.MessageType;
21import com.google.caja.reporting.MessageTypeInt;
22 
23import java.io.IOException;
24 
25/**
26 * Messages for the Dom Parser
27 *
28 * @author mikesamuel@gmail.com
29 */
30public enum DomParserMessageType implements MessageTypeInt {
31  UNMATCHED_END("%s: end tag %s does not match open tag %s",
32                MessageLevel.FATAL_ERROR),
33  MISPLACED_CONTENT("%s: markup outside document", MessageLevel.ERROR),
34  UNCLOSED_TAG("%s: tag is not closed", MessageLevel.ERROR),
35  MISSING_END("%s: element %s at %s is not closed", MessageLevel.WARNING),
36  IGNORING_TOKEN("%s: ignoring token %s", MessageLevel.WARNING),
37  MOVING_TO_HEAD("%s: moving element %s to head", MessageLevel.LINT),
38  MISSING_DOCUMENT_ELEMENT("%s: no document element", MessageLevel.ERROR),
39  GENERIC_SAX_ERROR("%s: %s", MessageLevel.FATAL_ERROR),
40  ;
41 
42  private final String formatString;
43  private final MessageLevel level;
44  private final int paramCount;
45 
46  DomParserMessageType(String formatString, MessageLevel level) {
47    this.formatString = formatString;
48    this.level = level;
49    this.paramCount = MessageType.formatStringArity(formatString);
50  }
51 
52  public int getParamCount() {
53    return paramCount;
54  }
55 
56  public void format(MessagePart[] parts, MessageContext context,
57                     Appendable out) throws IOException {
58    MessageType.formatMessage(formatString, parts, context, out);
59  }
60 
61  public MessageLevel getLevel() { return level; }
62}

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