Package com.helger.schematron.pure.model
Class PSPhase
java.lang.Object
com.helger.schematron.pure.model.PSPhase
- All Implemented Interfaces:
IPSElement,IPSHasForeignAttributes,IPSHasForeignElements,IPSHasID,IPSHasIncludes,IPSHasLets,IPSHasRichGroup
@NotThreadSafe
public class PSPhase
extends Object
implements IPSElement, IPSHasForeignElements, IPSHasIncludes, IPSHasLets, IPSHasID, IPSHasRichGroup
A single Schematron phase-element.
A grouping of patterns, to name and declare variations in schemas, for example, to support progressive validation. The required id attribute is the name of the phase. The implementation determines which phase to use for validating documents, for example by user command.
Two names, #ALL and #DEFAULT, have special meanings. The name #ALL is reserved and available for use by implementations to denote that all patterns are active. The name #DEFAULT is reserved and available for use by implementations to denote that the name given in the defaultPhase attribute on the schema element should be used. If no defaultPhase is specified, then all patterns are active.
NOTE: The names #ALL and #DEFAULT shall not be used in a Schematron schema. They are for use when invoking or configuring schema validation, for example as a command-line parameter.
The icon, see and fpi attributes allow rich interfaces and documentation.
A grouping of patterns, to name and declare variations in schemas, for example, to support progressive validation. The required id attribute is the name of the phase. The implementation determines which phase to use for validating documents, for example by user command.
Two names, #ALL and #DEFAULT, have special meanings. The name #ALL is reserved and available for use by implementations to denote that all patterns are active. The name #DEFAULT is reserved and available for use by implementations to denote that the name given in the defaultPhase attribute on the schema element should be used. If no defaultPhase is specified, then all patterns are active.
NOTE: The names #ALL and #DEFAULT shall not be used in a Schematron schema. They are for use when invoking or configuring schema validation, for example as a command-line parameter.
The icon, see and fpi attributes allow rich interfaces and documentation.
PSPhase elements are only referenced from PSSchema elements.- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddForeignAttribute(String sAttrName, String sAttrValue) voidaddForeignElement(com.helger.xml.microdom.IMicroElement aForeignElement) voidaddInclude(PSInclude aInclude) Add an include to this object.voidAdd aPSLetelement.voidcom.helger.commons.collection.impl.ICommonsList<PSActive>com.helger.commons.collection.impl.ICommonsList<IPSElement>com.helger.commons.collection.impl.ICommonsList<com.helger.xml.microdom.IMicroElement>com.helger.commons.collection.impl.ICommonsList<PSInclude>com.helger.commons.collection.impl.ICommonsList<PSLet>com.helger.commons.collection.impl.ICommonsList<PSP>getAllPs()com.helger.xml.microdom.IMicroElementgetID()getRich()booleanbooleanbooleanbooleanbooleanbooleanisValid(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
-
PSPhase
public PSPhase()
-
-
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.
-
addInclude
Description copied from interface:IPSHasIncludesAdd an include to this object.- Specified by:
addIncludein interfaceIPSHasIncludes- Parameters:
aInclude- The include to be added. May not benull.
-
hasAnyInclude
public boolean hasAnyInclude()- Specified by:
hasAnyIncludein interfaceIPSHasIncludes- Returns:
trueif at least one include is present in this object.
-
getAllIncludes
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSInclude> getAllIncludes()- Specified by:
getAllIncludesin interfaceIPSHasIncludes- Returns:
- A list of all contained includes. Never
null.
-
addP
-
getAllPs
-
addLet
Description copied from interface:IPSHasLetsAdd aPSLetelement.- Specified by:
addLetin interfaceIPSHasLets- Parameters:
aLet- The let element to be added. May not benull.
-
hasAnyLet
public boolean hasAnyLet()- Specified by:
hasAnyLetin interfaceIPSHasLets- Returns:
trueif this object has at least on containedPSLetobject.
-
getAllLets
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSLet> getAllLets()- Specified by:
getAllLetsin interfaceIPSHasLets- Returns:
- A list of all contained
PSLetelements. Nevernull.
-
getAllLetsAsMap
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAllLetsAsMap()- Specified by:
getAllLetsAsMapin interfaceIPSHasLets- Returns:
- The content of all
PSLetelements as an ordered Map from name to value. The order must match the declaration order! Nevernull.
-
addActive
-
getAllActives
-
getAllContentElements
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IPSElement> getAllContentElements() -
getAsMicroElement
- Specified by:
getAsMicroElementin interfaceIPSElement- Returns:
- The XML representation of this element. Never
null.
-
toString
-