Package com.helger.schematron.pure.model
Class PSDiagnostic
java.lang.Object
com.helger.schematron.pure.model.PSDiagnostic
- All Implemented Interfaces:
com.helger.commons.lang.ICloneable<PSDiagnostic>,IPSClonableElement<PSDiagnostic>,IPSElement,IPSHasForeignAttributes,IPSHasForeignElements,IPSHasID,IPSHasMixedContent,IPSHasRichGroup,IPSHasTexts,IPSOptionalElement
@NotThreadSafe
public class PSDiagnostic
extends Object
implements IPSClonableElement<PSDiagnostic>, IPSOptionalElement, IPSHasID, IPSHasForeignElements, IPSHasMixedContent, IPSHasRichGroup
A single Schematron diagnostic-element.
A natural-language message giving more specific details concerning a failed assertion, such as found versus expected values and repair hints.
NOTE: Diagnostics in multiple languages may be supported by using a different diagnostic element for each language, with the appropriate xml:lang language attribute, and referencing all the unique identifiers of the diagnostic elements in the diagnostics attribute of the assertion. Annex G gives a simple example of a multi-lingual schema.
An implementation is not required to make use of this element.
A natural-language message giving more specific details concerning a failed assertion, such as found versus expected values and repair hints.
NOTE: Diagnostics in multiple languages may be supported by using a different diagnostic element for each language, with the appropriate xml:lang language attribute, and referencing all the unique identifiers of the diagnostic elements in the diagnostics attribute of the assertion. Annex G gives a simple example of a multi-lingual schema.
An implementation is not required to make use of this element.
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddForeignAttribute(String sAttrName, String sAttrValue) voidaddForeignElement(com.helger.xml.microdom.IMicroElement aForeignElement) voidvoidAdd a new text element.voidaddValueOf(PSValueOf aValueOf) com.helger.commons.collection.impl.ICommonsList<Object>com.helger.commons.collection.impl.ICommonsList<PSDir>com.helger.commons.collection.impl.ICommonsList<PSEmph>com.helger.commons.collection.impl.ICommonsList<com.helger.xml.microdom.IMicroElement>com.helger.commons.collection.impl.ICommonsList<PSSpan>com.helger.commons.collection.impl.ICommonsList<String>com.helger.commons.collection.impl.ICommonsList<PSValueOf>com.helger.xml.microdom.IMicroElementgetClone()getID()getRich()booleanbooleanbooleanbooleanbooleanisValid(IPSErrorHandler aErrorHandler) Check if this element is specified completely.voidSet an ID for this object.voidsetRich(PSRichGroup aRich) Overwrite any existing rich group.toString()voidvalidateCompletely(IPSErrorHandler aErrorHandler) Check if this element is specified completely.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.schematron.pure.model.IPSHasForeignAttributes
addForeignAttributesMethods inherited from interface com.helger.schematron.pure.model.IPSHasForeignElements
addForeignElementsMethods inherited from interface com.helger.schematron.pure.model.IPSHasRichGroup
getRichClone, hasRich
-
Constructor Details
-
PSDiagnostic
public PSDiagnostic()
-
-
Method Details
-
isValid
Description copied from interface:IPSElementCheck if this element is specified completely. This method stops at the first encountered error.- Specified by:
isValidin interfaceIPSElement- Parameters:
aErrorHandler- The error handler where the error details are stored. May not benull.- Returns:
trueif all mandatory fields are set and the element is valid,falseotherwise.
-
validateCompletely
Description copied from interface:IPSElementCheck if this element is specified completely. This method performs all validations independent of the number of encountered error.- Specified by:
validateCompletelyin interfaceIPSElement- Parameters:
aErrorHandler- The error handler where the error details are stored. May not benull.
-
isMinimal
public boolean isMinimal()- Specified by:
isMinimalin interfaceIPSElement- Returns:
trueif this element conforms to the Schematron minimal syntax,falseotherwise.
-
addForeignElement
- Specified by:
addForeignElementin interfaceIPSHasForeignElements
-
hasForeignElements
public boolean hasForeignElements()- Specified by:
hasForeignElementsin interfaceIPSHasForeignElements
-
getAllForeignElements
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<com.helger.xml.microdom.IMicroElement> getAllForeignElements()- Specified by:
getAllForeignElementsin interfaceIPSHasForeignElements
-
addForeignAttribute
- Specified by:
addForeignAttributein interfaceIPSHasForeignAttributes
-
hasForeignAttributes
public boolean hasForeignAttributes()- Specified by:
hasForeignAttributesin interfaceIPSHasForeignAttributes
-
getAllForeignAttributes
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAllForeignAttributes()- Specified by:
getAllForeignAttributesin interfaceIPSHasForeignAttributes
-
setID
Description copied from interface:IPSHasIDSet an ID for this object. -
getID
-
setRich
Description copied from interface:IPSHasRichGroupOverwrite any existing rich group.- Specified by:
setRichin interfaceIPSHasRichGroup- Parameters:
aRich- The new rich group to set. May benull.
-
getRich
- Specified by:
getRichin interfaceIPSHasRichGroup- Returns:
- Get the existing rich group or
nullif none is present.
-
addText
Description copied from interface:IPSHasTextsAdd a new text element.- Specified by:
addTextin interfaceIPSHasTexts- Parameters:
sText- The text to be added. May not benull.
-
hasAnyText
public boolean hasAnyText()- Specified by:
hasAnyTextin interfaceIPSHasTexts- Returns:
trueif at least one text element is contained,falseif not
-
getAllTexts
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> getAllTexts()- Specified by:
getAllTextsin interfaceIPSHasTexts- Returns:
- A copy of all contained text elements. Never
null.
-
addValueOf
-
getAllValueOfs
-
addEmph
-
getAllEmphs
-
addDir
-
getAllDirs
-
addSpan
-
getAllSpans
-
getAllContentElements
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<Object> getAllContentElements()- Specified by:
getAllContentElementsin interfaceIPSHasMixedContent- Returns:
- A list of
String,PSValueOf,PSEmph,PSDirandPSSpanelements.
-
getAsMicroElement
- Specified by:
getAsMicroElementin interfaceIPSElement- Returns:
- The XML representation of this element. Never
null.
-
getClone
- Specified by:
getClonein interfacecom.helger.commons.lang.ICloneable<PSDiagnostic>
-
toString
-