@NotThreadSafe public class PSRule extends Object implements IPSElement, IPSHasID, IPSHasFlag, IPSHasForeignElements, IPSHasIncludes, IPSHasLets, IPSHasRichGroup, IPSHasLinkableGroup
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ABSTRACT |
Constructor and Description |
---|
PSRule() |
Modifier and Type | Method and Description |
---|---|
void |
addAssertReport(PSAssertReport aAssertReport) |
void |
addExtends(PSExtends aExtends) |
void |
addForeignAttribute(String sAttrName,
String sAttrValue) |
void |
addForeignAttributes(Map<String,String> aForeignAttrs) |
void |
addForeignElement(com.helger.commons.microdom.IMicroElement aForeignElement) |
void |
addForeignElements(List<com.helger.commons.microdom.IMicroElement> aForeignElements) |
void |
addInclude(PSInclude aInclude)
Add an include to this object.
|
void |
addLet(PSLet aLet)
Add a
PSLet element. |
List<PSAssertReport> |
getAllAssertReports() |
List<IPSElement> |
getAllContentElements() |
List<PSExtends> |
getAllExtends() |
Map<String,String> |
getAllForeignAttributes() |
List<com.helger.commons.microdom.IMicroElement> |
getAllForeignElements() |
List<PSInclude> |
getAllIncludes() |
List<PSLet> |
getAllLets() |
Map<String,String> |
getAllLetsAsMap() |
com.helger.commons.microdom.IMicroElement |
getAsMicroElement() |
String |
getContext() |
int |
getExtendsCount() |
String |
getFlag()
The name of a Boolean flag variable.
|
String |
getID() |
PSLinkableGroup |
getLinkable() |
PSLinkableGroup |
getLinkableClone() |
PSRichGroup |
getRich() |
PSRichGroup |
getRichClone() |
boolean |
hasAnyExtends() |
boolean |
hasAnyInclude() |
boolean |
hasAnyLet() |
boolean |
hasForeignAttributes() |
boolean |
hasForeignElements() |
boolean |
hasID() |
boolean |
hasLinkable() |
boolean |
hasRich() |
boolean |
isAbstract() |
boolean |
isMinimal() |
boolean |
isValid(IPSErrorHandler aErrorHandler)
Check if this element is specified completely.
|
void |
setAbstract(boolean bAbstract) |
void |
setContext(String sContext) |
void |
setFlag(String sFlag) |
void |
setID(String sID)
Set an ID for this object.
|
void |
setLinkable(PSLinkableGroup aLinkable)
Overwrite any existing linkable group.
|
void |
setRich(PSRichGroup aRich)
Overwrite any existing rich group.
|
String |
toString() |
void |
validateCompletely(IPSErrorHandler aErrorHandler)
Check if this element is specified completely.
|
public static final boolean DEFAULT_ABSTRACT
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 isMinimal()
isMinimal
in interface IPSElement
true
if this element conforms to the Schematron
minimal syntax, false
otherwise.public void addForeignElement(@Nonnull com.helger.commons.microdom.IMicroElement aForeignElement)
addForeignElement
in interface IPSHasForeignElements
public void addForeignElements(@Nonnull List<com.helger.commons.microdom.IMicroElement> aForeignElements)
addForeignElements
in interface IPSHasForeignElements
public boolean hasForeignElements()
hasForeignElements
in interface IPSHasForeignElements
@Nonnull @ReturnsMutableCopy public List<com.helger.commons.microdom.IMicroElement> getAllForeignElements()
getAllForeignElements
in interface IPSHasForeignElements
public void addForeignAttribute(@Nonnull String sAttrName, @Nonnull String sAttrValue)
addForeignAttribute
in interface IPSHasForeignAttributes
public void addForeignAttributes(@Nonnull Map<String,String> aForeignAttrs)
addForeignAttributes
in interface IPSHasForeignAttributes
public boolean hasForeignAttributes()
hasForeignAttributes
in interface IPSHasForeignAttributes
@Nonnull @ReturnsMutableCopy public Map<String,String> getAllForeignAttributes()
getAllForeignAttributes
in interface IPSHasForeignAttributes
@Nullable public String getFlag()
IPSHasFlag
getFlag
in interface IPSHasFlag
public void setRich(@Nullable PSRichGroup aRich)
IPSHasRichGroup
setRich
in interface IPSHasRichGroup
aRich
- The new rich group to set. May be null
.public boolean hasRich()
hasRich
in interface IPSHasRichGroup
true
if a rich group is present, false
otherwise.@Nullable public PSRichGroup getRich()
getRich
in interface IPSHasRichGroup
null
if none is
present.@Nullable public PSRichGroup getRichClone()
getRichClone
in interface IPSHasRichGroup
null
if no rich group
is present at this object.public void setLinkable(@Nullable PSLinkableGroup aLinkable)
IPSHasLinkableGroup
setLinkable
in interface IPSHasLinkableGroup
aLinkable
- The new linkable group to set. May be null
.public boolean hasLinkable()
hasLinkable
in interface IPSHasLinkableGroup
true
if a linkable group is present,
false
otherwise.@Nullable public PSLinkableGroup getLinkable()
getLinkable
in interface IPSHasLinkableGroup
null
if none is
present.@Nullable public PSLinkableGroup getLinkableClone()
getLinkableClone
in interface IPSHasLinkableGroup
null
if no
linkable group is present at this object.public void setAbstract(boolean bAbstract)
bAbstract
- The abstract state of this rule.public boolean isAbstract()
true
if this rule is abstract, false
otherwise. Default is false.public void setID(@Nullable String sID)
IPSHasID
public boolean hasID()
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 List<PSInclude> getAllIncludes()
getAllIncludes
in interface IPSHasIncludes
null
.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 List<PSLet> getAllLets()
getAllLets
in interface IPSHasLets
PSLet
elements. Never
null
.@Nonnull @ReturnsMutableCopy public Map<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
.public void addAssertReport(@Nonnull PSAssertReport aAssertReport)
@Nonnull @ReturnsMutableCopy public List<PSAssertReport> getAllAssertReports()
@Nonnegative public int getExtendsCount()
public boolean hasAnyExtends()
@Nonnull @ReturnsMutableCopy public List<IPSElement> getAllContentElements()
PSAssertReport
and PSExtends
parameters@Nonnull public com.helger.commons.microdom.IMicroElement getAsMicroElement()
getAsMicroElement
in interface IPSElement
null
.Copyright © 2014–2015 Philip Helger. All rights reserved.