public class CmsXmlContentErrorHandler
extends java.lang.Object
构造器和说明 |
---|
CmsXmlContentErrorHandler()
Create a new instance of the validation handler.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addError(I_CmsXmlContentValue value,
java.lang.String message)
Adds an error message to the internal list of errors,
also raised the "has errors" flag.
|
void |
addWarning(I_CmsXmlContentValue value,
java.lang.String message)
Adds an warning message to the internal list of errors,
also raised the "has warning" flag.
|
java.util.Map<java.util.Locale,java.util.Map<java.lang.String,java.lang.String>> |
getErrors()
Returns the map of validation errors.
|
java.util.Map<java.lang.String,java.lang.String> |
getErrors(java.util.Locale locale)
Returns the Map of errors for the selected locale.
|
java.util.Map<java.util.Locale,java.util.Map<java.lang.String,java.lang.String>> |
getWarnings()
Returns the map of validation warnings.
|
java.util.Map<java.lang.String,java.lang.String> |
getWarnings(java.util.Locale locale)
Returns the Map of warnings for the selected locale.
|
boolean |
hasErrors()
Returns true if the validated content had errors.
|
boolean |
hasErrors(java.util.Locale locale)
Returns
true if there is at last one error in the selected locale. |
boolean |
hasWarnings()
Returns true if the validated content has warnings.
|
boolean |
hasWarnings(java.util.Locale locale)
Returns
true if there is at last one warning in the selected locale. |
public CmsXmlContentErrorHandler()
public void addError(I_CmsXmlContentValue value, java.lang.String message)
value
- the value that contains the errormessage
- the error message to addpublic void addWarning(I_CmsXmlContentValue value, java.lang.String message)
value
- the value that contians the warningmessage
- the warning message to addpublic java.util.Map<java.util.Locale,java.util.Map<java.lang.String,java.lang.String>> getErrors()
The map contains further maps. The key of the "first" map is the
Locale
of the language where issues where found. The key of the "second" map
is a mapping from the element node name obtained with I_CmsXmlContentValue.getPath()
to the error message
which is a String.
public java.util.Map<java.lang.String,java.lang.String> getErrors(java.util.Locale locale)
locale
- the locale to get the errors forpublic java.util.Map<java.util.Locale,java.util.Map<java.lang.String,java.lang.String>> getWarnings()
The map contains further maps. The key of the "first" map is the
Locale
of the language where issues where found. The key of the "second" map
is a mapping from the element node name obtained with I_CmsXmlContentValue.getPath()
to the error message
which is a String.
public java.util.Map<java.lang.String,java.lang.String> getWarnings(java.util.Locale locale)
locale
- the locale to get the warnings forpublic boolean hasErrors()
public boolean hasErrors(java.util.Locale locale)
true
if there is at last one error in the selected locale.locale
- the locale to checktrue
if there is at last one error in the selected localepublic boolean hasWarnings()
public boolean hasWarnings(java.util.Locale locale)
true
if there is at last one warning in the selected locale.locale
- the locale to checktrue
if there is at last one warning in the selected locale