Package com.helger.schematron.pure.model
Class PSAssertReport
java.lang.Object
com.helger.schematron.pure.model.PSAssertReport
- All Implemented Interfaces:
IPSElement,IPSHasFlag,IPSHasForeignAttributes,IPSHasForeignElements,IPSHasID,IPSHasLinkableGroup,IPSHasMixedContent,IPSHasRichGroup,IPSHasTexts
@NotThreadSafe
public class PSAssertReport
extends Object
implements IPSElement, IPSHasFlag, IPSHasForeignElements, IPSHasMixedContent, IPSHasID, IPSHasRichGroup, IPSHasLinkableGroup
A single Schematron assert- or report-element.
An assertion made about the context nodes. The data content is a natural-language assertion. The required test attribute is an assertion test evaluated in the current context. If the test evaluates positive, the assertion succeeds. The optional diagnostics attribute is a reference to further diagnostic information.
The natural-language assertion shall be a positive statement of a constraint. NOTE: The natural-language assertion may contain information about actual values in addition to expected values and may contain diagnostic information. Users should note, however, that the diagnostic element is provided for such information to encourage clear statement of the natural-language assertion.
The icon, see and fpi attributes allow rich interfaces and documentation.
The flag attribute allows more detailed outcomes.
The role and subject attributes allow explicit identification of some part of a pattern.
An assertion made about the context nodes. The data content is a natural-language assertion. The required test attribute is an assertion test evaluated in the current context. If the test evaluates positive, the assertion succeeds. The optional diagnostics attribute is a reference to further diagnostic information.
The natural-language assertion shall be a positive statement of a constraint. NOTE: The natural-language assertion may contain information about actual values in addition to expected values and may contain diagnostic information. Users should note, however, that the diagnostic element is provided for such information to encourage clear statement of the natural-language assertion.
The icon, see and fpi attributes allow rich interfaces and documentation.
The flag attribute allows more detailed outcomes.
The role and subject attributes allow explicit identification of some part of a pattern.
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddForeignAttribute(String sAttrName, String sAttrValue) voidaddForeignElement(com.helger.xml.microdom.IMicroElement aForeignElement) voidvoidvoidAdd a new text element.voidaddValueOf(PSValueOf aValueOf) static PSAssertReportcom.helger.commons.collection.impl.ICommonsList<Object>com.helger.commons.collection.impl.ICommonsList<String>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<PSName>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.IMicroElementgetFlag()The name of a Boolean flag variable.getID()getRich()getTest()booleanbooleanbooleanbooleanisAssert()booleanbooleanisReport()booleanisValid(IPSErrorHandler aErrorHandler) Check if this element is specified completely.static PSAssertReportreport()voidsetDiagnostics(com.helger.commons.collection.impl.ICommonsList<String> aDiagnostics) Set the diagnostics, as an IDREFS value (multiple IDREF values separated by spaces)voidsetDiagnostics(String sDiagnostics) Set the diagnostics, as an IDREFS value (multiple IDREF values separated by spaces)voidvoidSet an ID for this object.voidsetLinkable(PSLinkableGroup aLinkable) Overwrite any existing linkable group.voidsetRich(PSRichGroup aRich) Overwrite any existing rich group.voidtoString()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.IPSHasLinkableGroup
getLinkableClone, hasLinkableMethods inherited from interface com.helger.schematron.pure.model.IPSHasRichGroup
getRichClone, hasRich
-
Constructor Details
-
PSAssertReport
public PSAssertReport(boolean bIsAssert)
-
-
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.
-
getAllForeignElements
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<com.helger.xml.microdom.IMicroElement> getAllForeignElements()- Specified by:
getAllForeignElementsin interfaceIPSHasForeignElements
-
hasForeignElements
public boolean hasForeignElements()- Specified by:
hasForeignElementsin interfaceIPSHasForeignElements
-
addForeignElement
- Specified by:
addForeignElementin interfaceIPSHasForeignElements
-
getAllForeignAttributes
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAllForeignAttributes()- Specified by:
getAllForeignAttributesin interfaceIPSHasForeignAttributes
-
hasForeignAttributes
public boolean hasForeignAttributes()- Specified by:
hasForeignAttributesin interfaceIPSHasForeignAttributes
-
addForeignAttribute
- Specified by:
addForeignAttributein interfaceIPSHasForeignAttributes
-
isAssert
public boolean isAssert() -
isReport
public boolean isReport() -
getTest
-
setTest
-
getFlag
Description copied from interface:IPSHasFlagThe name of a Boolean flag variable. A flag is implicitly declared by an assertion or rule having a flag attribute with that name. The value of a flag becomes true when an assertion with that flag fails or a rule with that flag fires.
The purpose of flags is to convey state or severity information to a subsequent process.
An implementation is not required to make use of this attribute.- Specified by:
getFlagin interfaceIPSHasFlag- Returns:
- The flag value
-
setFlag
-
getID
-
setID
Description copied from interface:IPSHasIDSet an ID for this object. -
getAllDiagnostics
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> getAllDiagnostics()- Returns:
- List of references to
PSDiagnosticelements.
-
setDiagnostics
Set the diagnostics, as an IDREFS value (multiple IDREF values separated by spaces)- Parameters:
sDiagnostics- The value to be set. May benull.
-
setDiagnostics
public void setDiagnostics(@Nullable com.helger.commons.collection.impl.ICommonsList<String> aDiagnostics) Set the diagnostics, as an IDREFS value (multiple IDREF values separated by spaces)- Parameters:
aDiagnostics- The value to be set. May benull.
-
getRich
- Specified by:
getRichin interfaceIPSHasRichGroup- Returns:
- Get the existing rich group or
nullif none is present.
-
setRich
Description copied from interface:IPSHasRichGroupOverwrite any existing rich group.- Specified by:
setRichin interfaceIPSHasRichGroup- Parameters:
aRich- The new rich group to set. May benull.
-
getLinkable
- Specified by:
getLinkablein interfaceIPSHasLinkableGroup- Returns:
- Get the existing linkable group or
nullif none is present.
-
setLinkable
Description copied from interface:IPSHasLinkableGroupOverwrite any existing linkable group.- Specified by:
setLinkablein interfaceIPSHasLinkableGroup- Parameters:
aLinkable- The new linkable group to set. May benull.
-
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.
-
hasAnyText
public boolean hasAnyText()- Specified by:
hasAnyTextin interfaceIPSHasTexts- Returns:
trueif at least one text element is contained,falseif not
-
addText
Description copied from interface:IPSHasTextsAdd a new text element.- Specified by:
addTextin interfaceIPSHasTexts- Parameters:
sText- The text to be added. May not benull.
-
getAllNames
-
addName
-
getAllValueOfs
-
addValueOf
-
getAllEmphs
-
addEmph
-
getAllDirs
-
addDir
-
getAllSpans
-
addSpan
-
getAllContentElements
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<Object> getAllContentElements()- Specified by:
getAllContentElementsin interfaceIPSHasMixedContent- Returns:
- A list of
String,PSName,PSValueOf,PSEmph,PSDirandPSSpanelements.
-
getAsMicroElement
- Specified by:
getAsMicroElementin interfaceIPSElement- Returns:
- The XML representation of this element. Never
null.
-
toString
-
assertion
-
report
-