|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.validator.Rule
public abstract class Rule
This class models a validation rule.
| Constructor Summary | |
|---|---|
Rule()
Constructor for Rule. |
|
| Method Summary | |
|---|---|
ErrorMessage |
createMessage()
Adds an error message to this instance and returns it. |
String |
getErrorMessageFor(Locale loc)
Returns the error message corresponding to the given Locale. |
ErrorMessages |
getErrorMessages()
|
String |
getId()
Returns this instance's unique identifier. |
void |
initName(String prefix,
String localName)
Inits rule with the specified information. |
protected String |
localName()
Returns the local name of this rule. |
Object |
onCreate()
|
protected String |
prefix()
Returns the prefix of the namespace to which this rule belongs. |
protected String |
qualifiedName()
Returns this rule's qualified name (prefix() + ':' + localName()). |
void |
setErrorMessages(ErrorMessages msgs)
Sets this instance's error messages. |
void |
setId(String id)
|
abstract void |
validate(ValidationContext context)
Validates this instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Rule()
| Method Detail |
|---|
public void initName(String prefix,
String localName)
this - rule's namespace prefix.this - rule's local name.public void setId(String id)
getId()public String getId()
Validatable
getId in interface ValidatableValidatable.getId()public ErrorMessage createMessage()
ErrorMessage.public void setErrorMessages(ErrorMessages msgs)
msgs - some ErrorMessages.public ErrorMessages getErrorMessages()
ErrorMessages.public String getErrorMessageFor(Locale loc)
Locale.
a - Locale.
null if no error message could
be found for the given Locale.public abstract void validate(ValidationContext context)
Validatable
validate in interface ValidatableValidatable.validate(ValidationContext)protected String localName()
protected String prefix()
protected String qualifiedName()
prefix(),
localName()
public Object onCreate()
throws org.sapia.util.xml.confix.ConfigurationException
onCreate in interface org.sapia.util.xml.confix.ObjectCreationCallbackorg.sapia.util.xml.confix.ConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||