| java.lang.Object org.archive.crawler.settings.Constraint
All known Subclasses: org.archive.crawler.settings.RegularExpressionConstraint, org.archive.crawler.settings.LegalValueTypeConstraint, org.archive.crawler.settings.LegalValueListConstraint,
Constraint | abstract public class Constraint implements Comparable<Constraint>,Serializable(Code) | | 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:
-
java.util.logging.Level.SEVERE The attribute could not be set
whatsoever.
-
java.util.logging.Level.WARNING The 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.
-
java.util.logging.Level.INFO The 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.
author: John Erik Halse |
Inner Class :public class FailedCheck | |
Method Summary | |
final public FailedCheck | check(CrawlerSettings settings, ComplexType owner, Type definition, Object value) Run the check.
Parameters: owner - the ComplexType owning the attribute to check. Parameters: definition - the definition to check the attribute against. Parameters: value - the value to check. | public int | compareTo(Constraint o) Compare this constraints level to another constraint. | protected String | getDefaultMessage() Get the default message to return if a check fails. | abstract public FailedCheck | innerCheck(CrawlerSettings settings, ComplexType owner, Type definition, Object value) The method all subclasses should implement to do the actual checking.
Parameters: owner - the ComplexType owning the attribute to check. Parameters: definition - the definition to check the attribute against. Parameters: value - the value to check. |
Constraint | public Constraint(Level level, String msg)(Code) | | Constructs a new Constraint.
Parameters: level - the level for this constraint. Parameters: msg - default message to return if the check fails. |
check | final public FailedCheck check(CrawlerSettings settings, ComplexType owner, Type definition, Object value)(Code) | | Run the check.
Parameters: owner - the ComplexType owning the attribute to check. Parameters: definition - the definition to check the attribute against. Parameters: value - the value to check. null if ok, or an instance of FailedCheckif the checkfailed. |
compareTo | public int compareTo(Constraint o)(Code) | | Compare this constraints level to another constraint.
This method is implemented to let constraints be sorted with the highest
level first.
Parameters: o - a Constraint to compare to. |
getDefaultMessage | protected String getDefaultMessage()(Code) | | Get the default message to return if a check fails.
the default message to return if a check fails. |
innerCheck | abstract public FailedCheck innerCheck(CrawlerSettings settings, ComplexType owner, Type definition, Object value)(Code) | | The method all subclasses should implement to do the actual checking.
Parameters: owner - the ComplexType owning the attribute to check. Parameters: definition - the definition to check the attribute against. Parameters: value - the value to check. null if ok, or an instance of FailedCheckif the checkfailed. |
|
|