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

COVERAGE SUMMARY FOR SOURCE FILE [PluginMessageType.java]

nameclass, %method, %block, %line, %
PluginMessageType.java100% (1/1)71%  (5/7)98%  (536/545)100% (52/52)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PluginMessageType100% (1/1)71%  (5/7)98%  (536/545)100% (52/52)
<static initializer> 100% (1/1)100% (508/508)100% (43/43)
PluginMessageType (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): PluginMessageType 0%   (0/1)0%   (0/5)0%   (0/1)
values (): PluginMessageType [] 0%   (0/1)0%   (0/4)0%   (0/1)

1// Copyright (C) 2006 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.plugin;
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 PluginCompiler
27 *
28 * @author mikesamuel@gmail.com
29 */
30public enum PluginMessageType implements MessageTypeInt {
31  ILLEGAL_GLOBAL_ACCESS(
32      "%s: access not allowed to global %s", MessageLevel.FATAL_ERROR),
33  UNSAFE_ACCESS(
34      "%s: unsafe access to protected namespace: %s", MessageLevel.FATAL_ERROR),
35  UNKNOWN_TAG("%s: unknown tag %s", MessageLevel.WARNING),
36  UNSAFE_TAG("%s: removing disallowed tag %s", MessageLevel.WARNING),
37  MISSING_ATTRIBUTE("%s: expected param %s on %s", MessageLevel.ERROR),
38  UNKNOWN_ATTRIBUTE("%s: removing unknown attribute %s on %s",
39      MessageLevel.WARNING),
40  UNSAFE_ATTRIBUTE("%s: removing disallowed attribute %s on tag %s",
41                   MessageLevel.WARNING),
42  FOLDING_ELEMENT("%s: folding element %s into parent", MessageLevel.WARNING),
43  CANNOT_FOLD_ATTRIBUTE("%s: removing attribute %s when folding %s into parent",
44                        MessageLevel.WARNING),
45  DISALLOWED_ATTRIBUTE_VALUE("%s: attribute %s cannot have value %s",
46                             MessageLevel.WARNING),
47  BAD_IDENTIFIER("%s: bad identifier %s", MessageLevel.FATAL_ERROR),
48  ATTRIBUTE_CANNOT_BE_DYNAMIC(
49      "%s: tag %s cannot have dynamic attribute %s", MessageLevel.ERROR),
50  DISALLOWED_URI("%s: url %s cannot be linked to", MessageLevel.FATAL_ERROR),
51  MALFORMED_URL("%s: malformed url %s", MessageLevel.FATAL_ERROR),
52  MALFORMED_CSS_PROPERTY_VALUE(
53      "%s: css property %s has bad value: %s", MessageLevel.WARNING),
54  DISALLOWED_CSS_PROPERTY_IN_SELECTOR(
55      "%s: css property %s not allowed in :visited selector at %s",
56      MessageLevel.ERROR),
57  UNKNOWN_CSS_PROPERTY("%s: unknown css property %s", MessageLevel.ERROR),
58  CSS_VALUE_OUT_OF_RANGE(
59      "%s: css property %s with value %s not in range [%s, %s]",
60      MessageLevel.WARNING),
61  UNSAFE_CSS_IDENTIFIER(
62      "%s: css identifier '%s' contains characters that may not work"
63      + " on all browsers", MessageLevel.FATAL_ERROR),
64  UNSAFE_CSS_PROPERTY("%s: unsafe css property %s", MessageLevel.ERROR),
65  UNSAFE_CSS_PSEUDO_SELECTOR(
66      "%s: unsafe css pseudo-selector %s", MessageLevel.ERROR),
67  CSS_DASHMATCH_ATTRIBUTE_OPERATOR_NOT_ALLOWED(
68      "%s: css dash match attribute operation not allowed", MessageLevel.ERROR),
69  CSS_URI_VALUED_ATTRIBUTE_SELECTOR_NOT_ALLOWED(
70      "%s: css URI-valued attribute selector not allowed", MessageLevel.ERROR),
71  CSS_ATTRIBUTE_NAME_NOT_ALLOWED_IN_SELECTOR(
72      "%s: css attribute name %s not allowed in selector", MessageLevel.ERROR),
73  CSS_ATTRIBUTE_TYPE_NOT_ALLOWED_IN_SELECTOR(
74      "%s: css attribute type %s not allowed in selector", MessageLevel.ERROR),
75  CSS_LINK_PSEUDO_SELECTOR_NOT_ALLOWED_ON_NONANCHOR(
76      "%s: css :link and :visited pseudo selectors only allowed on A elements",
77      MessageLevel.ERROR),
78  SKIPPING_CSS_PROPERTY(
79      "%s: skipping invalid css property %s", MessageLevel.WARNING),
80  IMPORTS_NOT_ALLOWED_HERE("%s: @import not allowed here", MessageLevel.ERROR),
81  CYCLIC_INCLUDE("%s: cyclic include of %s", MessageLevel.ERROR),
82  FONT_FACE_NOT_ALLOWED("%s: @font-face not allowed", MessageLevel.ERROR),
83  FAILED_TO_LOAD_EXTERNAL_URL(
84      "%s: failed to load external url %s", MessageLevel.WARNING),
85  NO_CONTENT("%s: no content", MessageLevel.FATAL_ERROR),
86  UNRECOGNIZED_CONTENT_TYPE(
87      "%s: unrecognized content type %s for %s tag", MessageLevel.WARNING),
88  UNRECOGNIZED_MEDIA_TYPE(
89      "%s: unrecognized media type %s", MessageLevel.WARNING),
90  UNRECOGNIZED_ATTRIBUTE_VALUE(
91      "%s: unrecognized attribute value %s for %s attribute of %s tag",
92      MessageLevel.WARNING),
93  QUOTED_CSS_VALUE("%s: quoted unquoted css value %s", MessageLevel.LINT),
94  ASSUMING_PIXELS_FOR_LENGTH(
95      "%s: assuming pixels for length %s", MessageLevel.WARNING),
96  NON_STANDARD_COLOR(
97      "%s: replacing non-standard color %s with hex %s", MessageLevel.LINT),
98  MALFORMED_ENVELOPE(
99      "%s: malformed envelope around cajoled code", MessageLevel.ERROR),
100  SPECIALIZING_CSS_PROPERTY(
101      "%s: specialized CSS property %s to %s", MessageLevel.WARNING),
102  MISSING_XML_NAMESPACE(
103      "%s: XML %s has prefix but no namespace", MessageLevel.ERROR),
104  INVALID_PIPELINE("Cannot find plan from %s to %s", MessageLevel.FATAL_ERROR),
105  ;
106 
107  private final String formatString;
108  private final MessageLevel level;
109  private final int paramCount;
110 
111  PluginMessageType(String formatString, MessageLevel level) {
112    this.formatString = formatString;
113    this.level = level;
114    this.paramCount = MessageType.formatStringArity(formatString);
115  }
116 
117  public int getParamCount() {
118    return paramCount;
119  }
120 
121  public void format(MessagePart[] parts, MessageContext context,
122                     Appendable out) throws IOException {
123    MessageType.formatMessage(formatString, parts, context, out);
124  }
125 
126  public MessageLevel getLevel() { return level; }
127}

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