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

COVERAGE SUMMARY FOR SOURCE FILE [ServiceMessageType.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ServiceMessageType100% (1/1)71%  (5/7)93%  (128/137)100% (17.9/18)
<static initializer> 100% (1/1)100% (100/100)100% (9/9)
ServiceMessageType (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): ServiceMessageType 0%   (0/1)0%   (0/5)0%   (0/1)
values (): ServiceMessageType [] 0%   (0/1)0%   (0/4)0%   (0/1)

1// Copyright (C) 2010 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.service;
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 cajoling service
27 *
28 * @author mikesamuel@gmail.com
29 * @author ihab.awad@gmail.com
30 */
31public enum ServiceMessageType implements MessageTypeInt {
32  CANNOT_FETCH_INPUT_URL("Cannot fetch input URL %s", MessageLevel.FATAL_ERROR),
33  EXCEPTION_IN_SERVICE("Service threw exception %s", MessageLevel.FATAL_ERROR),
34  INVALID_ARGUMENT("Invalid value %s for argument %s",
35      MessageLevel.FATAL_ERROR),
36  INVALID_INPUT_URL("Invalid input URL %s", MessageLevel.FATAL_ERROR),
37  IO_ERROR("I/O error: %s", MessageLevel.FATAL_ERROR),
38  MISSING_ARGUMENT("Missing argument %s", MessageLevel.FATAL_ERROR),
39  UNSUPPORTED_CONTENT_TYPES("Requested content types are unsupported",
40      MessageLevel.FATAL_ERROR),
41  UNEXPECTED_INPUT_MIME_TYPE("Expected input MIME type %s but found %s",
42      MessageLevel.FATAL_ERROR),
43  ;
44 
45  private final String formatString;
46  private final MessageLevel level;
47  private final int paramCount;
48 
49  ServiceMessageType(String formatString, MessageLevel level) {
50    this.formatString = formatString;
51    this.level = level;
52    this.paramCount = MessageType.formatStringArity(formatString);
53  }
54 
55  public int getParamCount() {
56    return paramCount;
57  }
58 
59  public void format(MessagePart[] parts, MessageContext context,
60                     Appendable out) throws IOException {
61    MessageType.formatMessage(formatString, parts, context, out);
62  }
63 
64  public MessageLevel getLevel() { return level; }
65}

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