@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.phloc.commons.io.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 |
addForeignAttributes(Map<String,String> aForeignAttrs) |
void |
addForeignElement(com.phloc.commons.microdom.IMicroElement aForeignElement) |
void |
addForeignElements(List<com.phloc.commons.microdom.IMicroElement> aForeignElements) |
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) |
List<PSP> |
getAllEndPs() |
Map<String,String> |
getAllForeignAttributes() |
List<com.phloc.commons.microdom.IMicroElement> |
getAllForeignElements() |
List<PSInclude> |
getAllIncludes() |
List<PSLet> |
getAllLets() |
Map<String,String> |
getAllLetsAsMap() |
List<PSNS> |
getAllNSs() |
List<PSPattern> |
getAllPatterns() |
List<String> |
getAllPhaseIDs() |
List<PSPhase> |
getAllPhases() |
List<PSP> |
getAllStartPs() |
com.phloc.commons.microdom.IMicroElement |
getAsMicroElement() |
com.phloc.commons.xml.namespace.MapBasedNamespaceContext |
getAsNamespaceContext() |
String |
getDefaultPhase() |
PSDiagnostics |
getDiagnostics() |
String |
getID() |
int |
getPatternCount() |
PSPattern |
getPatternOfID(String sID) |
PSPhase |
getPhaseOfID(String sID) |
String |
getQueryBinding() |
com.phloc.commons.io.IReadableResource |
getResource() |
PSRichGroup |
getRich() |
PSRichGroup |
getRichClone() |
String |
getSchemaVersion() |
PSTitle |
getTitle() |
boolean |
hasAnyInclude() |
boolean |
hasAnyLet() |
boolean |
hasAnyNS() |
boolean |
hasDiagnostics() |
boolean |
hasForeignAttributes() |
boolean |
hasForeignElements() |
boolean |
hasID() |
boolean |
hasNoPatterns() |
boolean |
hasPatterns() |
boolean |
hasRich() |
boolean |
hasTitle() |
boolean |
isMinimal() |
boolean |
isPreprocessed()
Check if this schema is already pre-processed or not.
|
boolean |
isValid()
Check if this schema is valid, meaning checking if all required fields are
set, and all mandatory constraints are fulfilled.
|
boolean |
isValid(com.phloc.commons.log.InMemoryLogger aLogger) |
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() |
public PSSchema()
public PSSchema(@Nullable com.phloc.commons.io.IReadableResource aResource)
aResource - The resource to be used. May be null indicating that
this is a newly created schema.@Nullable public com.phloc.commons.io.IReadableResource getResource()
null if the schema is newly created.public boolean isValid()
true if the schema is valid, false if
not.public boolean isValid(@Nonnull com.phloc.commons.log.InMemoryLogger aLogger)
isValid in interface IPSElementaLogger - The logger 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 boolean isPreprocessed()
true if it is pre-processed, false if
not.public boolean isMinimal()
isMinimal in interface IPSElementtrue if this element conforms to the Schematron
minimal syntax, false otherwise.public void addForeignElement(@Nonnull com.phloc.commons.microdom.IMicroElement aForeignElement)
addForeignElement in interface IPSHasForeignElementspublic void addForeignElements(@Nonnull List<com.phloc.commons.microdom.IMicroElement> aForeignElements)
addForeignElements in interface IPSHasForeignElementspublic boolean hasForeignElements()
hasForeignElements in interface IPSHasForeignElements@Nonnull @ReturnsMutableCopy public List<com.phloc.commons.microdom.IMicroElement> getAllForeignElements()
getAllForeignElements in interface IPSHasForeignElementspublic void addForeignAttribute(@Nonnull String sAttrName, @Nonnull String sAttrValue)
addForeignAttribute in interface IPSHasForeignAttributespublic void addForeignAttributes(@Nonnull Map<String,String> aForeignAttrs)
addForeignAttributes in interface IPSHasForeignAttributespublic boolean hasForeignAttributes()
hasForeignAttributes in interface IPSHasForeignAttributes@Nonnull @ReturnsMutableCopy public Map<String,String> getAllForeignAttributes()
getAllForeignAttributes in interface IPSHasForeignAttributespublic void setID(@Nullable String sID)
IPSHasIDpublic boolean hasID()
public void setRich(@Nullable PSRichGroup aRich)
IPSHasRichGroupsetRich in interface IPSHasRichGroupaRich - The new rich group to set. May be null.public boolean hasRich()
hasRich in interface IPSHasRichGrouptrue if a rich group is present, false
otherwise.@Nullable public PSRichGroup getRich()
getRich in interface IPSHasRichGroupnull if none is
present.@Nullable public PSRichGroup getRichClone()
getRichClone in interface IPSHasRichGroupnull if no rich group
is present at this object.public boolean hasTitle()
public void addInclude(@Nonnull PSInclude aInclude)
IPSHasIncludesaddInclude in interface IPSHasIncludesaInclude - The include to be added. May not be null.public boolean hasAnyInclude()
hasAnyInclude in interface IPSHasIncludestrue if at least one include is present in this
object.@Nonnull @ReturnsMutableCopy public List<PSInclude> getAllIncludes()
getAllIncludes in interface IPSHasIncludesnull.public boolean hasAnyNS()
@Nonnull @ReturnsMutableCopy public com.phloc.commons.xml.namespace.MapBasedNamespaceContext getAsNamespaceContext()
public void addLet(@Nonnull PSLet aLet)
IPSHasLetsPSLet element.addLet in interface IPSHasLetsaLet - The let element to be added. May not be null.public boolean hasAnyLet()
hasAnyLet in interface IPSHasLetstrue if this object has at least on contained
PSLet object.@Nonnull @ReturnsMutableCopy public List<PSLet> getAllLets()
getAllLets in interface IPSHasLetsPSLet elements. Never
null.@Nonnull @ReturnsMutableCopy public Map<String,String> getAllLetsAsMap()
getAllLetsAsMap in interface IPSHasLetsPSLet elements as an ordered Map from
name to value. The order must match the declaration order! Never
null.@Nonnull @ReturnsMutableCopy public List<String> getAllPhaseIDs()
public boolean hasPatterns()
public boolean hasNoPatterns()
@Nonnegative public int getPatternCount()
public void setDiagnostics(@Nullable PSDiagnostics aDiagnostics)
public boolean hasDiagnostics()
@Nullable public PSDiagnostics getDiagnostics()
@Nonnull public com.phloc.commons.microdom.IMicroElement getAsMicroElement()
getAsMicroElement in interface IPSElementnull.Copyright © 2006–2014 phloc systems. All rights reserved.