Package gov.nasa.pds.tools.dict.type
Interface TypeChecker
-
- All Known Subinterfaces:
NumericTypeChecker
- All Known Implementing Classes:
AlphabetChecker
,AlphaNumericChecker
,CharacterChecker
,ContextDependentChecker
,DataSetChecker
,DateChecker
,DoubleChecker
,IdentifierChecker
,IntegerChecker
,NonDecimalChecker
,RealChecker
,TimeChecker
public interface TypeChecker
- Version:
- $Revision$
- Author:
- pramirez, jagander
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
cast(String value, AttributeStatement attribute)
Tries to cast the value to the appropriate type and return the valuevoid
checkMaxLength(String value, ElementDefinition def, AttributeStatement attribute)
Checks to make sure that the value does not exceed the maximum lengthvoid
checkMinLength(String value, ElementDefinition def, AttributeStatement attribute)
Checks to make sure that the value does fall below the minimum length length
-
-
-
Method Detail
-
cast
Object cast(String value, AttributeStatement attribute) throws InvalidTypeException
Tries to cast the value to the appropriate type and return the value- Parameters:
value
- which must be cast- Returns:
- value after it has been cast
- Throws:
InvalidTypeException
- thrown when value can not be cast
-
checkMinLength
void checkMinLength(String value, ElementDefinition def, AttributeStatement attribute) throws InvalidLengthException
Checks to make sure that the value does fall below the minimum length length- Parameters:
value
- to be checkeddef
- contains the bound- Throws:
InvalidLengthException
- thrown when value falls below minimum
-
checkMaxLength
void checkMaxLength(String value, ElementDefinition def, AttributeStatement attribute) throws InvalidLengthException
Checks to make sure that the value does not exceed the maximum length- Parameters:
value
- to be checkeddef
- contains the bound- Throws:
InvalidLengthException
- thrown when value exceeds maximum
-
-