sk.uniba.euromath.document.schema.plug
Interface IValueRule

All Known Subinterfaces:
IAttributeRuleP
All Known Implementing Classes:
AttributeRuleImpl

public interface IValueRule

Represents rule for textual value.

Author:
Martin Vysny

Method Summary
 boolean acceptsSomething()
          Checks, whether this value rule accepts any non-empty string.
 boolean acceptsValue(String value)
          Checks whether this textual rule can contain given value.
 String getDatatypeName()
          Returns human-readable name for the datatype, that is represented by this instance.
 String getErrorMessage(String value)
          Compose and return an error message, why given value was not accepted.
 

Method Detail

acceptsValue

boolean acceptsValue(String value)
Checks whether this textual rule can contain given value.

Parameters:
value - value to check.
Returns:
true if the value is valid.

getDatatypeName

String getDatatypeName()
Returns human-readable name for the datatype, that is represented by this instance.

Returns:
Short displayable name (and description, if necessary) of datatype.

acceptsSomething

boolean acceptsSomething()
Checks, whether this value rule accepts any non-empty string.

Returns:
true if this value rule accepts any non-empty string.

getErrorMessage

String getErrorMessage(String value)
Compose and return an error message, why given value was not accepted.

Parameters:
value - the value
Returns:
error message, possibly suggesting correct value whenever possible. If no error message is available then return empty string. If the value is acceptable return null.


Copyright © 2003-2006 null. All Rights Reserved.