Package com.helger.schematron.pure.model
Class PSSchema
java.lang.Object
com.helger.schematron.pure.model.PSSchema
- All Implemented Interfaces:
IPSElement,IPSHasForeignAttributes,IPSHasForeignElements,IPSHasID,IPSHasIncludes,IPSHasLets,IPSHasRichGroup
@NotThreadSafe
public class PSSchema
extends Object
implements IPSElement, IPSHasID, IPSHasForeignElements, IPSHasIncludes, IPSHasLets, IPSHasRichGroup
A single Schematron schema-element.
The top-level element of a Schematron schema.
The optional schemaVersion attribute gives the version of the schema. Its allowed values are not defined by this part of ISO/IEC 19757 and its use is implementation-dependent.
The optional queryBinding attribute provides the short name of the query language binding in use. If this attribute is specified, it is an error if it has a value that the current implementation does not support.
The defaultPhase attribute may be used to indicate the phase to use in the absence of explicit user-supplied information.
The title and p elements allow rich documentation.
The icon, see and fpi attributes allow rich interfaces and documentation.
The top-level element of a Schematron schema.
The optional schemaVersion attribute gives the version of the schema. Its allowed values are not defined by this part of ISO/IEC 19757 and its use is implementation-dependent.
The optional queryBinding attribute provides the short name of the query language binding in use. If this attribute is specified, it is an error if it has a value that the current implementation does not support.
The defaultPhase attribute may be used to indicate the phase to use in the absence of explicit user-supplied information.
The title and p elements allow rich documentation.
The icon, see and fpi attributes allow rich interfaces and documentation.
- 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.voidvoidaddPattern(PSPattern aPattern) voidvoidcom.helger.commons.collection.impl.ICommonsList<PSP>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<PSNS>com.helger.commons.collection.impl.ICommonsList<PSPattern>com.helger.commons.collection.impl.ICommonsList<String>com.helger.commons.collection.impl.ICommonsList<PSPhase>com.helger.commons.collection.impl.ICommonsList<PSP>com.helger.xml.microdom.IMicroElementcom.helger.xml.namespace.MapBasedNamespaceContextgetID()intgetPatternOfID(String sID) getPhaseOfID(String sID) com.helger.commons.io.resource.IReadableResourcegetRich()getTitle()booleanbooleanbooleanhasAnyNS()booleanbooleanbooleanbooleanbooleanbooleanhasTitle()booleanbooleanCheck if this schema is already pre-processed or not.booleanisValid(IPSErrorHandler aErrorHandler) Check if this element is specified completely.voidsetDefaultPhase(String sDefaultPhase) voidsetDiagnostics(PSDiagnostics aDiagnostics) voidSet an ID for this object.voidsetQueryBinding(String sQueryBinding) voidsetRich(PSRichGroup aRich) Overwrite any existing rich group.voidsetSchemaVersion(String sSchemaVersion) 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.IPSHasRichGroup
getRichClone, hasRich
-
Constructor Details
-
PSSchema
public PSSchema()Default constructor for a new schema that was not read from a file. -
PSSchema
Constructor for reading a schema from a file.- Parameters:
aResource- The resource to be used. May benullindicating that this is a newly created schema.
-
-
Method Details
-
getResource
- Returns:
- The resource from which the schema was read. May be
nullif the schema is newly created.
-
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.
-
isPreprocessed
public boolean isPreprocessed()Check if this schema is already pre-processed or not. A schema is considered pre-processed if:- no includes are contained recursively and
- no abstract patterns are contained and
- no abstract rules are contained.
- Returns:
trueif it is pre-processed,falseif not.
-
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.
-
setQueryBinding
-
getQueryBinding
-
setSchemaVersion
-
getSchemaVersion
-
setDefaultPhase
-
getDefaultPhase
-
setTitle
-
getTitle
-
hasTitle
public boolean hasTitle() -
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.
-
addNS
-
hasAnyNS
public boolean hasAnyNS() -
getAllNSs
-
getAsNamespaceContext
@Nonnull @ReturnsMutableCopy public com.helger.xml.namespace.MapBasedNamespaceContext getAsNamespaceContext()- Returns:
- All contained namespaces as a single namespace context
-
addStartP
-
getAllStartPs
-
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.
-
addPhase
-
getAllPhases
-
getAllPhaseIDs
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> getAllPhaseIDs()- Returns:
- A list with all phase IDs. Only phases having a valid ID are considered.
-
getPhaseOfID
-
addPattern
-
hasPatterns
public boolean hasPatterns() -
hasNoPatterns
public boolean hasNoPatterns() -
getAllPatterns
-
getPatternCount
-
getPatternOfID
-
addEndP
-
getAllEndPs
-
setDiagnostics
-
hasDiagnostics
public boolean hasDiagnostics() -
getDiagnostics
-
getAsMicroElement
- Specified by:
getAsMicroElementin interfaceIPSElement- Returns:
- The XML representation of this element. Never
null.
-
toString
-