com.springsource.util.osgi.manifest.parse.standard
Class HeaderProblem

java.lang.Object
  extended by com.springsource.util.osgi.manifest.parse.standard.HeaderProblem

public class HeaderProblem
extends java.lang.Object

Encapsulates a single problem found during header parsing. The problem includes a kind HeaderProblemKind, together with the start and end offset for the problem in the data and some inserts that would be included in the formatted form of this message. The toString() methods like to have the context passed in so that they can produce nice results - the source context encapsulates the source data that was being processed together with useful information from that (eg. where the line breaks are - but that is less useful in this situation where all problems are on the same line). Concurrent Semantics
Threadsafe.

Author:
Andy Clement

Field Summary
private  int endoffset
           
private  java.lang.String[] inserts
           
private  HeaderProblemKind problemKind
           
private  int startoffset
           
 
Constructor Summary
HeaderProblem(HeaderProblemKind problem, int startoffset, int endoffset, java.lang.String... inserts)
           
 
Method Summary
 int getEndOffset()
           
 java.lang.String[] getInserts()
           
 HeaderProblemKind getKind()
           
 int getStartOffset()
           
 boolean isSeverity(Severity severity)
           
 java.lang.String toString()
           
 java.lang.String toString(SourceContext context)
           
 java.lang.String toStringWithContext(SourceContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

problemKind

private HeaderProblemKind problemKind

startoffset

private int startoffset

endoffset

private int endoffset

inserts

private java.lang.String[] inserts
Constructor Detail

HeaderProblem

public HeaderProblem(HeaderProblemKind problem,
                     int startoffset,
                     int endoffset,
                     java.lang.String... inserts)
Method Detail

toString

public java.lang.String toString(SourceContext context)

toStringWithContext

public java.lang.String toStringWithContext(SourceContext context)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getKind

public HeaderProblemKind getKind()

getInserts

public java.lang.String[] getInserts()

getStartOffset

public int getStartOffset()

getEndOffset

public int getEndOffset()

isSeverity

public boolean isSeverity(Severity severity)