|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.archive.crawler.settings.Constraint
public abstract class Constraint
Superclass for constraints that can be set on attribute definitions.
Constraints will be checked against attribute values. If a constraint check fails, an object of type FailedCheck is returned containing information that can be used to build meaningful information to the user.
A constraint has one of three levels:
Level.SEVEREThe attribute could not be set
whatsoever.
Level.WARNINGThe attribute is illegal i
CrawlJobs, but could be set in profiles. Mostly used as holder value for
settings that should be changed for every entity running a crawl.
Level.INFOThe attribute has a legal value,
but is outside the bounds of what are considered a reasonable value. The user
could be warned that she should investigate if the value actally is what she
wants it be.
| Nested Class Summary | |
|---|---|
class |
Constraint.FailedCheck
Objects of this class represents failed constraint checks. |
| Field Summary | |
|---|---|
(package private) static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
Constraint(java.util.logging.Level level,
java.lang.String msg)
Constructs a new Constraint. |
|
| Method Summary | |
|---|---|
Constraint.FailedCheck |
check(CrawlerSettings settings,
ComplexType owner,
Type definition,
java.lang.Object value)
Run the check. |
int |
compareTo(Constraint o)
Compare this constraints level to another constraint. |
protected java.lang.String |
getDefaultMessage()
Get the default message to return if a check fails. |
abstract Constraint.FailedCheck |
innerCheck(CrawlerSettings settings,
ComplexType owner,
Type definition,
java.lang.Object value)
The method all subclasses should implement to do the actual checking. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final long serialVersionUID
| Constructor Detail |
|---|
public Constraint(java.util.logging.Level level,
java.lang.String msg)
level - the level for this constraint.msg - default message to return if the check fails.| Method Detail |
|---|
public final Constraint.FailedCheck check(CrawlerSettings settings,
ComplexType owner,
Type definition,
java.lang.Object value)
owner - the ComplexType owning the attribute to check.definition - the definition to check the attribute against.value - the value to check.
Constraint.FailedCheckif the check
failed.
public abstract Constraint.FailedCheck innerCheck(CrawlerSettings settings,
ComplexType owner,
Type definition,
java.lang.Object value)
owner - the ComplexType owning the attribute to check.definition - the definition to check the attribute against.value - the value to check.
Constraint.FailedCheckif the check
failed.protected java.lang.String getDefaultMessage()
public int compareTo(Constraint o)
compareTo in interface java.lang.Comparable<Constraint>o - a Constraint to compare to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||