Package com._1c.g5.v8.dt.xdto.validation
Class ValueTypeValidatorAtomic
- java.lang.Object
-
- com._1c.g5.v8.dt.xdto.validation.ValueTypeValidatorAtomic
-
- All Implemented Interfaces:
IValueTypeValidator
- Direct Known Subclasses:
ValueTypeValidatorAtomic.AnyURITypeValidator
,ValueTypeValidatorAtomic.Base64BinaryTypeValidator
,ValueTypeValidatorAtomic.BooleanTypeValidator
,ValueTypeValidatorAtomic.DateTimeTypeValidator
,ValueTypeValidatorAtomic.DecimalTypeValidator
,ValueTypeValidatorAtomic.DoubleTypeValidator
,ValueTypeValidatorAtomic.DurationTypeValidator
,ValueTypeValidatorAtomic.FloatTypeValidator
,ValueTypeValidatorAtomic.GDayTypeValidator
,ValueTypeValidatorAtomic.GMonthDayTypeValidator
,ValueTypeValidatorAtomic.GMonthTypeValidator
,ValueTypeValidatorAtomic.GYearMonthTypeValidator
,ValueTypeValidatorAtomic.GYearTypeValidator
,ValueTypeValidatorAtomic.HexBinaryTypeValidator
,ValueTypeValidatorAtomic.NotationTypeValidator
,ValueTypeValidatorAtomic.QNameTypeValidator
,ValueTypeValidatorAtomic.StringTypeValidator
public class ValueTypeValidatorAtomic extends Object implements IValueTypeValidator
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected static char
DATE_SEPARATOR
protected static int
DATE_SIZE
protected static int
MONTH_DAY_SIZE
-
Constructor Summary
Constructors Constructor Description ValueTypeValidatorAtomic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkDefaultValue(String value, ValueType type, org.eclipse.xtext.scoping.IScope scope)
CheckingProperty.getDefault()
valueboolean
checkEnumerations(String value, ValueType type)
Checks value ofXdtoUtil.FacetKind.ENUMERATION
protected boolean
checkNCName(String name)
Checks NCName type (see xml standart for NCName)boolean
checkPatterns(String value, ValueType type)
Checks value ofXdtoUtil.FacetKind.ENUMERATION
protected boolean
checkTimeZone(String value)
Checks string presentation of time zoneboolean
checkValueSpace(String value)
Checks string representation of facet value forValueType
int
compare(String value, String otherValue)
Comparing facet valuesprotected int
hexToBin(char ch)
Convert char to binaryprotected boolean
isDigitOrPeriodOrSign(char ch)
Checks that char is digit or '-', '.', '+'protected int
maxDayInMonthFor(int mm)
Gets number of days in month
-
-
-
Field Detail
-
DATE_SEPARATOR
protected static final char DATE_SEPARATOR
- See Also:
- Constant Field Values
-
DATE_SIZE
protected static final int DATE_SIZE
- See Also:
- Constant Field Values
-
MONTH_DAY_SIZE
protected static final int MONTH_DAY_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
checkDefaultValue
public boolean checkDefaultValue(String value, ValueType type, org.eclipse.xtext.scoping.IScope scope)
Description copied from interface:IValueTypeValidator
CheckingProperty.getDefault()
value- Specified by:
checkDefaultValue
in interfaceIValueTypeValidator
- Parameters:
value
- actual default value, can't benull
type
-ValueType
ofProperty
, can't benull
scope
-IScope
ofType
, can't benull
- Returns:
true
if default value is valid fortype
,false
otherwise
-
checkEnumerations
public boolean checkEnumerations(String value, ValueType type)
Description copied from interface:IValueTypeValidator
Checks value ofXdtoUtil.FacetKind.ENUMERATION
- Specified by:
checkEnumerations
in interfaceIValueTypeValidator
- Parameters:
value
- checking value, can't benull
type
-ValueType
which value is checked, can't benull
- Returns:
true
if value is valid,false
otherwise
-
checkPatterns
public boolean checkPatterns(String value, ValueType type)
Description copied from interface:IValueTypeValidator
Checks value ofXdtoUtil.FacetKind.ENUMERATION
- Specified by:
checkPatterns
in interfaceIValueTypeValidator
- Parameters:
value
- checking value, can't benull
type
-ValueType
which value is checked, can't benull
- Returns:
true
if value is valid,false
otherwise
-
checkValueSpace
public boolean checkValueSpace(String value)
Description copied from interface:IValueTypeValidator
Checks string representation of facet value forValueType
- Specified by:
checkValueSpace
in interfaceIValueTypeValidator
- Parameters:
value
- checking value, can't benull
- Returns:
true
ifvalue
is valid,false
otherwise
-
compare
public int compare(String value, String otherValue)
Description copied from interface:IValueTypeValidator
Comparing facet values- Specified by:
compare
in interfaceIValueTypeValidator
- Parameters:
value
- the first value for comparing, can't benull
otherValue
- the second value for comparing, can't benull
- Returns:
- the value 0 if arguments are equal ; a value less than 0 if the first value less that the second; and a value greater than 0 if the first value greater that the second.
-
isDigitOrPeriodOrSign
protected boolean isDigitOrPeriodOrSign(char ch)
Checks that char is digit or '-', '.', '+'- Parameters:
ch
- checking char- Returns:
true
if char is digit or '-', '.', '+',false
otherwise
-
checkTimeZone
protected boolean checkTimeZone(String value)
Checks string presentation of time zone- Parameters:
value
- string presentation of time zone- Returns:
true
if string presentation corresponding to time zone format '[-,+]hh:mm' or 'Z'
-
maxDayInMonthFor
protected int maxDayInMonthFor(int mm)
Gets number of days in month- Parameters:
mm
- month number- Returns:
- number of days in month
-
hexToBin
protected int hexToBin(char ch)
Convert char to binary- Parameters:
ch
- hex char- Returns:
- binary presentation of the char
-
checkNCName
protected boolean checkNCName(String name)
Checks NCName type (see xml standart for NCName)- Parameters:
name
- checking value, can't benull
- Returns:
true
if value is valid for NCName,false
otherwise
-
-