@NotThreadSafe public class PSSchema extends Object implements IPSElement, IPSHasID, IPSHasForeignElements, IPSHasIncludes, IPSHasLets, IPSHasRichGroup
Constructor and Description |
---|
PSSchema()
Default constructor for a new schema that was not read from a file.
|
PSSchema(com.helger.commons.io.resource.IReadableResource aResource)
Constructor for reading a schema from a file.
|
Modifier and Type | Method and Description |
---|---|
void |
addEndP(PSP aP) |
void |
addForeignAttribute(String sAttrName,
String sAttrValue) |
void |
addForeignElement(com.helger.xml.microdom.IMicroElement aForeignElement) |
void |
addInclude(PSInclude aInclude)
Add an include to this object.
|
void |
addLet(PSLet aLet)
Add a
PSLet element. |
void |
addNS(PSNS aNS) |
void |
addPattern(PSPattern aPattern) |
void |
addPhase(PSPhase aPhase) |
void |
addStartP(PSP aP) |
com.helger.commons.collection.ext.ICommonsList<PSP> |
getAllEndPs() |
com.helger.commons.collection.ext.ICommonsOrderedMap<String,String> |
getAllForeignAttributes() |
com.helger.commons.collection.ext.ICommonsList<com.helger.xml.microdom.IMicroElement> |
getAllForeignElements() |
com.helger.commons.collection.ext.ICommonsList<PSInclude> |
getAllIncludes() |
com.helger.commons.collection.ext.ICommonsList<PSLet> |
getAllLets() |
com.helger.commons.collection.ext.ICommonsOrderedMap<String,String> |
getAllLetsAsMap() |
com.helger.commons.collection.ext.ICommonsList<PSNS> |
getAllNSs() |
com.helger.commons.collection.ext.ICommonsList<PSPattern> |
getAllPatterns() |
com.helger.commons.collection.ext.ICommonsList<String> |
getAllPhaseIDs() |
com.helger.commons.collection.ext.ICommonsList<PSPhase> |
getAllPhases() |
com.helger.commons.collection.ext.ICommonsList<PSP> |
getAllStartPs() |
com.helger.xml.microdom.IMicroElement |
getAsMicroElement() |
com.helger.xml.namespace.MapBasedNamespaceContext |
getAsNamespaceContext() |
String |
getDefaultPhase() |
PSDiagnostics |
getDiagnostics() |
String |
getID() |
int |
getPatternCount() |
PSPattern |
getPatternOfID(String sID) |
PSPhase |
getPhaseOfID(String sID) |
String |
getQueryBinding() |
com.helger.commons.io.resource.IReadableResource |
getResource() |
PSRichGroup |
getRich() |
String |
getSchemaVersion() |
PSTitle |
getTitle() |
boolean |
hasAnyInclude() |
boolean |
hasAnyLet() |
boolean |
hasAnyNS() |
boolean |
hasDiagnostics() |
boolean |
hasForeignAttributes() |
boolean |
hasForeignElements() |
boolean |
hasNoPatterns() |
boolean |
hasPatterns() |
boolean |
hasTitle() |
boolean |
isMinimal() |
boolean |
isPreprocessed()
Check if this schema is already pre-processed or not.
|
boolean |
isValid(IPSErrorHandler aErrorHandler)
Check if this element is specified completely.
|
void |
setDefaultPhase(String sDefaultPhase) |
void |
setDiagnostics(PSDiagnostics aDiagnostics) |
void |
setID(String sID)
Set an ID for this object.
|
void |
setQueryBinding(String sQueryBinding) |
void |
setRich(PSRichGroup aRich)
Overwrite any existing rich group.
|
void |
setSchemaVersion(String sSchemaVersion) |
void |
setTitle(PSTitle aTitle) |
String |
toString() |
void |
validateCompletely(IPSErrorHandler aErrorHandler)
Check if this element is specified completely.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addForeignElements
addForeignAttributes
getRichClone, hasRich
public PSSchema()
public PSSchema(@Nullable com.helger.commons.io.resource.IReadableResource aResource)
aResource
- The resource to be used. May be null
indicating that
this is a newly created schema.@Nullable public com.helger.commons.io.resource.IReadableResource getResource()
null
if the schema is newly created.public boolean isValid(@Nonnull IPSErrorHandler aErrorHandler)
IPSElement
isValid
in interface IPSElement
aErrorHandler
- The error handler where the error details are stored. May not be
null
.true
if all mandatory fields are set and the element
is valid, false
otherwise.public void validateCompletely(@Nonnull IPSErrorHandler aErrorHandler)
IPSElement
validateCompletely
in interface IPSElement
aErrorHandler
- The error handler where the error details are stored. May not be
null
.public boolean isPreprocessed()
true
if it is pre-processed, false
if
not.public boolean isMinimal()
isMinimal
in interface IPSElement
true
if this element conforms to the Schematron
minimal syntax, false
otherwise.public void addForeignElement(@Nonnull com.helger.xml.microdom.IMicroElement aForeignElement)
addForeignElement
in interface IPSHasForeignElements
public boolean hasForeignElements()
hasForeignElements
in interface IPSHasForeignElements
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<com.helger.xml.microdom.IMicroElement> getAllForeignElements()
getAllForeignElements
in interface IPSHasForeignElements
public void addForeignAttribute(@Nonnull String sAttrName, @Nonnull String sAttrValue)
addForeignAttribute
in interface IPSHasForeignAttributes
public boolean hasForeignAttributes()
hasForeignAttributes
in interface IPSHasForeignAttributes
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsOrderedMap<String,String> getAllForeignAttributes()
getAllForeignAttributes
in interface IPSHasForeignAttributes
public void setID(@Nullable String sID)
IPSHasID
public void setRich(@Nullable PSRichGroup aRich)
IPSHasRichGroup
setRich
in interface IPSHasRichGroup
aRich
- The new rich group to set. May be null
.@Nullable public PSRichGroup getRich()
getRich
in interface IPSHasRichGroup
null
if none is
present.public boolean hasTitle()
public void addInclude(@Nonnull PSInclude aInclude)
IPSHasIncludes
addInclude
in interface IPSHasIncludes
aInclude
- The include to be added. May not be null
.public boolean hasAnyInclude()
hasAnyInclude
in interface IPSHasIncludes
true
if at least one include is present in this
object.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<PSInclude> getAllIncludes()
getAllIncludes
in interface IPSHasIncludes
null
.public boolean hasAnyNS()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<PSNS> getAllNSs()
@Nonnull @ReturnsMutableCopy public com.helger.xml.namespace.MapBasedNamespaceContext getAsNamespaceContext()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<PSP> getAllStartPs()
public void addLet(@Nonnull PSLet aLet)
IPSHasLets
PSLet
element.addLet
in interface IPSHasLets
aLet
- The let element to be added. May not be null
.public boolean hasAnyLet()
hasAnyLet
in interface IPSHasLets
true
if this object has at least on contained
PSLet
object.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<PSLet> getAllLets()
getAllLets
in interface IPSHasLets
PSLet
elements. Never
null
.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsOrderedMap<String,String> getAllLetsAsMap()
getAllLetsAsMap
in interface IPSHasLets
PSLet
elements as an ordered Map from
name to value. The order must match the declaration order! Never
null
.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<PSPhase> getAllPhases()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<String> getAllPhaseIDs()
public boolean hasPatterns()
public boolean hasNoPatterns()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<PSPattern> getAllPatterns()
@Nonnegative public int getPatternCount()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<PSP> getAllEndPs()
public void setDiagnostics(@Nullable PSDiagnostics aDiagnostics)
public boolean hasDiagnostics()
@Nullable public PSDiagnostics getDiagnostics()
@Nonnull public com.helger.xml.microdom.IMicroElement getAsMicroElement()
getAsMicroElement
in interface IPSElement
null
.Copyright © 2014–2017 Philip Helger. All rights reserved.