public boolean isMimeConstraint(final String primitiveTypeName, final Constraint constraint) { boolean _and = false; ConstraintIntervalType _type = constraint.getType(); String _literal = _type.getLiteral(); boolean _equals = Objects.equal("MIMETYPE", _literal); if (!_equals) { _and = false; } else { boolean _equals_1 = Objects.equal("byte", primitiveTypeName); _and = _equals_1; } return _and; }
public final boolean checkPropertyConstraints(final PrimitiveType type, final Constraint cons) { boolean _xblockexpression = false; { String _literal = type.getLiteral(); String[] arr = this.valueTypeMap.get(_literal); boolean _or = false; boolean _equals = Objects.equal(arr, null); if (_equals) { _or = true; } else { final String[] _converted_arr = (String[])arr; ConstraintIntervalType _type = cons.getType(); String _literal_1 = _type.getLiteral(); boolean _contains = ((List<String>)Conversions.doWrapArray(_converted_arr)).contains(_literal_1); boolean _not = (!_contains); _or = _not; } if (_or) { this.setErrorMessage(DatatypeSystemMessage.ERROR_CONSTRAINTTYPE_INVALID); return false; } _xblockexpression = true; } return _xblockexpression; }
@Check public void checkDuplicatedConstraint(final Property feature) { HashSet<String> set = new HashSet<String>(); ConstraintRule _constraintRule = feature.getConstraintRule(); EList<Constraint> list = _constraintRule.getConstraints(); for (int i = 0; (i < ((Object[])Conversions.unwrapArray(list, Object.class)).length); i++) { { Constraint con = list.get(i); ConstraintIntervalType _type = con.getType(); String _literal = _type.getLiteral(); boolean _add = set.add(_literal); boolean _not = (!_add); if (_not) { this.error(DatatypeSystemMessage.ERROR_DUPLICATED_CONSTRAINT, con, DatatypePackage.Literals.CONSTRAINT__TYPE); } } } }
public static ConstraintValueValidator getValueValidator(final ConstraintIntervalType type) { ConstraintValueValidator _xblockexpression = null; String _literal = type.getLiteral(); String typeStr = _literal.toString(); ConstraintValueValidator _switchResult = null;