private void handleRangeEnumeration( final Object lwm2mObject, final Property property, final Item item ) { if (property.getConstraintRule() != null) { final EList<Constraint> constraints = property.getConstraintRule().getConstraints(); final StringBuilder rangeSb = new StringBuilder(); for( final Constraint constraint : constraints ) { final ConstraintIntervalType type = constraint.getType(); final String constraintValues = constraint.getConstraintValues(); if( type == ConstraintIntervalType.MIN ) { rangeSb.append( constraintValues ).append( '-' ); } else if( type == ConstraintIntervalType.MAX ) { rangeSb.append( constraintValues ); } else if( type == ConstraintIntervalType.STRLEN ) { rangeSb.append( "0-" ).append( constraintValues ).append( " bytes" ); } else { final String errMsg = unsupportedValueForPropertyMsg( "ConstraintIntervalType <" + type + ">", property, lwm2mObject ); throw new IllegalArgumentException( errMsg ); } } item.setRangeEnumeration( rangeSb.toString() ); } }
public static String getMinConstraint(final Property property) { boolean _and = false; ConstraintRule _constraintRule = property.getConstraintRule(); EList<Constraint> _constraints = null; if (_constraintRule!=null) { _and = false; } else { ConstraintRule _constraintRule_1 = property.getConstraintRule(); EList<Constraint> _constraints_1 = null; if (_constraintRule_1!=null) { ConstraintRule _constraintRule_2 = property.getConstraintRule(); EList<Constraint> _constraints_2 = null; if (_constraintRule_2!=null) {
public static String getMaxConstraint(final Property property) { boolean _and = false; ConstraintRule _constraintRule = property.getConstraintRule(); EList<Constraint> _constraints = null; if (_constraintRule!=null) { _and = false; } else { ConstraintRule _constraintRule_1 = property.getConstraintRule(); EList<Constraint> _constraints_1 = null; if (_constraintRule_1!=null) { ConstraintRule _constraintRule_2 = property.getConstraintRule(); EList<Constraint> _constraints_2 = null; if (_constraintRule_2!=null) {
@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); } } } }
@Check public void checkConstraint(final Property prop) { ConstraintRule _constraintRule = prop.getConstraintRule(); EList<Constraint> constraints = _constraintRule.getConstraints(); final EList<Constraint> _converted_constraints = (EList<Constraint>)constraints; int _length = ((Object[])Conversions.unwrapArray(_converted_constraints, Object.class)).length; boolean _equals = (_length == 0); if (_equals) { return; } PropertyType _type = prop.getType(); PrimitivePropertyType primi = ((PrimitivePropertyType) _type); boolean isMultiplcity = prop.isMultiplicity(); for (final Constraint constraint : constraints) { this.verifyConstraintForType(primi, constraint, isMultiplcity); } }
public static InformationModel convertToFlatHierarchy(InformationModel infomodel) { for (FunctionblockProperty fbProperty : infomodel.getProperties()) { FunctionblockModel fbm = fbProperty.getType(); fbProperty.setType(convertToFlatHierarchy(fbm)); // merge any extended properties from information model to the FB properties if (fbProperty.getExtendedFunctionBlock() != null && fbProperty.getExtendedFunctionBlock().getStatus() != null) { for (Property extendedProperty : fbProperty.getExtendedFunctionBlock().getStatus() .getProperties()) { Optional<Property> baseProperty = fbm.getFunctionblock().getStatus().getProperties() .stream().filter(p -> p.getName().equals(extendedProperty.getName())).findFirst(); if (baseProperty.isPresent()) { baseProperty.get().setConstraintRule(extendedProperty.getConstraintRule()); } } } } return infomodel; }
String _trim = _string.trim(); _builder.append(_trim, "\t\t"); ConstraintRule _constraintRule = property.getConstraintRule(); CharSequence _constraintsContent = Utils.getConstraintsContent(_constraintRule, invocationContext); _builder.append(_constraintsContent, "\t\t"); String _trim_1 = _string_1.trim(); _builder.append(_trim_1, "\t"); ConstraintRule _constraintRule_1 = property.getConstraintRule(); CharSequence _constraintsContent_1 = Utils.getConstraintsContent(_constraintRule_1, invocationContext); _builder.append(_constraintsContent_1, "\t");