public abstract class AbstractErrorReportBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
categories
The element categories.
|
protected MultiCollection<Tuple,java.lang.String> |
entries
The parse errors (tuple(elements) -> {error messages}).
|
protected java.util.Map<java.lang.String,java.lang.String> |
externals
The external documents for links in html error reports (id -> html text).
|
protected java.lang.String |
filename
The file name with path (optional).
|
protected java.lang.String |
name
The unqualified (model/file) name.
|
Constructor and Description |
---|
AbstractErrorReportBuilder(java.lang.String name,
java.lang.String filename,
java.lang.String[] categories,
MultiCollection<Tuple,java.lang.String> entries,
java.util.Map<java.lang.String,java.lang.String> externals)
Build the error based on the given entries (if any).
|
Modifier and Type | Method and Description |
---|---|
IErrorReport |
buildErrorReport()
Build the error based on the given entries (if any).
|
protected void |
generateDetails(java.lang.StringBuffer buf,
java.lang.String type,
java.util.Set<java.lang.Object> elements)
Generate detail HTML code for the given elements.
|
protected java.lang.String |
generateErrorHTML()
Generate an html representation of the report.
|
protected java.lang.String |
generateErrorText()
Generate a string representation of the report.
|
protected void |
generateOverview(java.lang.StringBuffer buf,
java.lang.String type,
java.util.Set<java.lang.Object> elements)
Generate overview HTML code for the given elements.
|
protected Tuple[] |
getElementErrors(java.lang.Object ancestor)
Get all elements which have errors and are contained in the given element.
|
protected Tuple[] |
getElements()
Get all invalid elements.
|
protected java.lang.String[] |
getMessages(Tuple path)
Get the messages for a given element.
|
protected java.lang.Object |
getObject(Tuple element) |
abstract java.lang.String |
getObjectName(java.lang.Object obj)
Get the name of an object.
|
protected java.util.Set<java.lang.Object> |
getOtherErrors(java.util.Set<java.lang.Object> excludes)
Get other errors, not in the given tags.
|
protected java.util.Set<java.lang.Object> |
getOwnedElementErrors(java.lang.String category)
Get elements of the given owner type, which have errors or contain elements with errors.
|
abstract java.lang.Object |
getPathElementObject(java.lang.Object element)
Get the object of a path element
|
abstract boolean |
isInCategory(java.lang.Object obj,
java.lang.String category)
Test if an object belongs to a category.
|
protected java.lang.String name
protected java.lang.String filename
protected java.lang.String[] categories
protected MultiCollection<Tuple,java.lang.String> entries
protected java.util.Map<java.lang.String,java.lang.String> externals
public AbstractErrorReportBuilder(java.lang.String name, java.lang.String filename, java.lang.String[] categories, MultiCollection<Tuple,java.lang.String> entries, java.util.Map<java.lang.String,java.lang.String> externals)
name
- The unqualified (model/file) name.filename
- The file name with path (optional).categories
- The element categories.entries
- The parse errors (tuple(stack elements) -> {error messages}).externals
- The external documents for links in html error reports, if any (id -> html text).public IErrorReport buildErrorReport()
public abstract java.lang.Object getPathElementObject(java.lang.Object element)
obj
- An item (entry) of a tuple in the multi collection.public abstract boolean isInCategory(java.lang.Object obj, java.lang.String category)
obj
- An item (entry) of a tuple in the multi collection.category
- the category name.public abstract java.lang.String getObjectName(java.lang.Object obj)
obj
- An object having an error.protected Tuple[] getElements()
protected java.lang.String[] getMessages(Tuple path)
protected java.lang.String generateErrorText()
protected java.lang.String generateErrorHTML()
protected java.util.Set<java.lang.Object> getOwnedElementErrors(java.lang.String category)
protected java.util.Set<java.lang.Object> getOtherErrors(java.util.Set<java.lang.Object> excludes)
protected java.lang.Object getObject(Tuple element)
protected Tuple[] getElementErrors(java.lang.Object ancestor)
protected void generateOverview(java.lang.StringBuffer buf, java.lang.String type, java.util.Set<java.lang.Object> elements)
protected void generateDetails(java.lang.StringBuffer buf, java.lang.String type, java.util.Set<java.lang.Object> elements)