com.springsource.util.osgi.manifest.parse.standard
Enum HeaderProblemKind

java.lang.Object
  extended by java.lang.Enum<HeaderProblemKind>
      extended by com.springsource.util.osgi.manifest.parse.standard.HeaderProblemKind
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<HeaderProblemKind>

public enum HeaderProblemKind
extends java.lang.Enum<HeaderProblemKind>

Enumerated type that captures all the errors that can occur during parsing. By using enumerated types it is easier to test for errors without creating a dependency on the actual text in the message. Messages can be formatted by specifying the necessary missing pieces: a position and optionally some inserts. Messages have a severity so that the programmer may choose to ignore info/warning problems if they wish. The funky '//' chars are there to stop the formatter messing the whole file up on save ! Concurrent Semantics
Threadsafe.

Author:
Andy Clement

Enum Constant Summary
ATTRIBUTES_NOT_ALLOWED_FOR_THIS_HEADER
           
EXPECTED_ATTRIBUTE_OR_DIRECTIVE
           
EXPECTED_COMMA
           
EXPECTED_IDENTIFIER
           
EXPECTED_SEMICOLON
           
EXPECTED_SEMICOLON_OR_COMMA
           
EXPECTED_TOKEN
           
EXTRANEOUS_DATA_AFTER_PARAMETER
           
ILLEGAL_DOUBLE_SLASH
           
ILLEGAL_SPACE
           
INVALID_ARGUMENT_VALUE
           
NON_TERMINATING_QUOTED_STRING
           
TOKEN_CANNOT_END_WITH_DOT
           
UNCONSUMED_DATA
           
UNEXPECTED_CHARACTER
           
UNEXPECTED_SPACE_WARNING
           
UNEXPECTEDLY_OOD
           
UNEXPECTEDLY_OOD_AT_ARGUMENT_VALUE
           
 
Field Summary
private  java.lang.String code
           
private  java.lang.String message
           
private  Severity severity
           
 
Method Summary
 java.lang.String format(int line, int scol, java.lang.String... inserts)
           
 java.lang.String getCode()
           
 boolean isSeverity(Severity severity)
           
static HeaderProblemKind valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static HeaderProblemKind[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EXPECTED_TOKEN

public static final HeaderProblemKind EXPECTED_TOKEN

EXPECTED_IDENTIFIER

public static final HeaderProblemKind EXPECTED_IDENTIFIER

UNEXPECTED_CHARACTER

public static final HeaderProblemKind UNEXPECTED_CHARACTER

NON_TERMINATING_QUOTED_STRING

public static final HeaderProblemKind NON_TERMINATING_QUOTED_STRING

UNEXPECTED_SPACE_WARNING

public static final HeaderProblemKind UNEXPECTED_SPACE_WARNING

ILLEGAL_SPACE

public static final HeaderProblemKind ILLEGAL_SPACE

EXPECTED_ATTRIBUTE_OR_DIRECTIVE

public static final HeaderProblemKind EXPECTED_ATTRIBUTE_OR_DIRECTIVE

UNEXPECTEDLY_OOD_AT_ARGUMENT_VALUE

public static final HeaderProblemKind UNEXPECTEDLY_OOD_AT_ARGUMENT_VALUE

UNEXPECTEDLY_OOD

public static final HeaderProblemKind UNEXPECTEDLY_OOD

INVALID_ARGUMENT_VALUE

public static final HeaderProblemKind INVALID_ARGUMENT_VALUE

UNCONSUMED_DATA

public static final HeaderProblemKind UNCONSUMED_DATA

EXTRANEOUS_DATA_AFTER_PARAMETER

public static final HeaderProblemKind EXTRANEOUS_DATA_AFTER_PARAMETER

EXPECTED_SEMICOLON

public static final HeaderProblemKind EXPECTED_SEMICOLON

EXPECTED_SEMICOLON_OR_COMMA

public static final HeaderProblemKind EXPECTED_SEMICOLON_OR_COMMA

TOKEN_CANNOT_END_WITH_DOT

public static final HeaderProblemKind TOKEN_CANNOT_END_WITH_DOT

ATTRIBUTES_NOT_ALLOWED_FOR_THIS_HEADER

public static final HeaderProblemKind ATTRIBUTES_NOT_ALLOWED_FOR_THIS_HEADER

EXPECTED_COMMA

public static final HeaderProblemKind EXPECTED_COMMA

ILLEGAL_DOUBLE_SLASH

public static final HeaderProblemKind ILLEGAL_DOUBLE_SLASH
Field Detail

severity

private Severity severity

code

private java.lang.String code

message

private java.lang.String message
Method Detail

values

public static HeaderProblemKind[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HeaderProblemKind c : HeaderProblemKind.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HeaderProblemKind valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

isSeverity

public boolean isSeverity(Severity severity)

getCode

public java.lang.String getCode()

format

public java.lang.String format(int line,
                               int scol,
                               java.lang.String... inserts)
Parameters:
line - unused
scol - column offset
inserts - into format
Returns:
formatted problem string