public interface Rule
KomodoObject
's.Modifier and Type | Interface and Description |
---|---|
static class |
Rule.MessageKey
The allowed keys for localized messages.
|
static class |
Rule.PropertyRestriction
Indicates property restriction type
|
static class |
Rule.RuleType
The type of rule.
|
static class |
Rule.ValidationType
Indicates if the rule is validating a node, the children of a node, or a node property.
|
Modifier and Type | Field and Description |
---|---|
static Rule[] |
NO_RULES
An empty array of rules.
|
static final Rule[] NO_RULES
Result evaluate(Repository.UnitOfWork transaction, KomodoObject kobject) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)kobject
- the object being evaluated (cannot be null
)null
)KException
- if the object is not of the right type to be evaluated or if an error occursString getDescription(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)KException
- if an error occursString getJcrName(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)KException
- if an error occursString getMessage(Repository.UnitOfWork transaction, String key) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)key
- the message key (cannot be empty)KException
- if an error occursString getName(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)KException
- if an error occursString getNodeType(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)KException
- if an error occursMap<String,String> getPropRestrictions(Repository.UnitOfWork transaction, Rule.PropertyRestriction restrictionType) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)restrictionType
- the restriction type (NODE or CHILD).KException
- if an error occursRule.RuleType getRuleType(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)null
)KException
- if an error occursOutcome.Level getSeverity(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)null
)KException
- if an error occursRule.ValidationType getValidationType(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)null
)KException
- if an error occursboolean isRequired(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)true
if the property or child that this rule pertains to is required.KException
- if an error occursboolean isApplicable(Repository.UnitOfWork transaction, KomodoObject kObject) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)kObject
- the KomodoObject to testtrue
if the rule applies to the supplied object.KException
- if an error occursvoid setRequired(Repository.UnitOfWork transaction, boolean newRequired) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)newRequired
- the new required indicatorKException
- if an error occursboolean isEnabled(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)true
if rule is enabled and should be runKException
- if an error occursvoid setEnabled(Repository.UnitOfWork transaction, boolean newEnabled) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)newEnabled
- the new enabled indicatorKException
- if an error occursvoid setSeverity(Repository.UnitOfWork transaction, Outcome.Level newLevel) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)newLevel
- the new severity (cannot be null
)KException
- if an error occursCopyright © 2013–2019. All rights reserved.