/** * The most applicable max value for the encoded type. * * @return most applicable max value for the encoded type. */ public PrimitiveValue applicableMaxValue() { if (null != maxValue) { return maxValue; } return primitiveType.maxValue(); }
private static void validateGroupMaxValue( final Node node, final PrimitiveType primitiveType, final PrimitiveValue value) { if (null != value) { final long longValue = value.longValue(); final long allowedValue = primitiveType.maxValue().longValue(); if (longValue > allowedValue) { XmlSchemaParser.handleError(node, String.format( "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, allowedValue)); } final long maxInt = INT32.maxValue().longValue(); if (primitiveType == UINT32 && longValue > maxInt) { XmlSchemaParser.handleError(node, String.format( "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, maxInt)); } } else if (primitiveType == UINT32) { final long maxInt = INT32.maxValue().longValue(); XmlSchemaParser.handleError(node, String.format( "maxValue must be set for varData UINT32 type: max value allowed=%d", maxInt)); } }
indent(writer, 2, "if l > %s {\n", this.lengthType.maxValue()); indent(writer, 3).append("return Err(CodecErr::SliceIsLongerThanAllowedBySchema)\n"); indent(writer, 2).append("}\n");
node.blockLengthType.size()); indent(out, 2, "let count = s.len();\n"); indent(out, 2, "if count > %s {\n", node.numInGroupType.maxValue()); indent(out, 3).append("return Err(CodecErr::SliceIsLongerThanAllowedBySchema)\n"); indent(out, 2).append("}\n");
numInGroupMaxValue.longValue() : numInGroupType.primitiveType().maxValue().longValue();
/** * The most applicable max value for the encoded type. * * @return most applicable max value for the encoded type. */ public PrimitiveValue applicableMaxValue() { if (null != maxValue) { return maxValue; } return primitiveType.maxValue(); }
/** * The most applicable max value for the encoded type. * * @return most applicable max value for the encoded type. */ public PrimitiveValue applicableMaxValue() { if (null != maxValue) { return maxValue; } return primitiveType.maxValue(); }
/** * The most applicable max value for the encoded type. * * @return most applicable max value for the encoded type. */ public PrimitiveValue applicableMaxValue() { if (null != maxValue) { return maxValue; } return primitiveType.maxValue(); }
private static void validateGroupMaxValue( final Node node, final PrimitiveType primitiveType, final PrimitiveValue value) { if (null != value) { final long longValue = value.longValue(); final long allowedValue = primitiveType.maxValue().longValue(); if (longValue > allowedValue) { XmlSchemaParser.handleError(node, String.format( "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, allowedValue)); } final long maxInt = INT32.maxValue().longValue(); if (primitiveType == UINT32 && longValue > maxInt) { XmlSchemaParser.handleError(node, String.format( "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, maxInt)); } } else if (primitiveType == UINT32) { final long maxInt = INT32.maxValue().longValue(); XmlSchemaParser.handleError(node, String.format( "maxValue must be set for varData UINT32 type: max value allowed=%d", maxInt)); } }
private static void validateGroupMaxValue( final Node node, final PrimitiveType primitiveType, final PrimitiveValue value) { if (null != value) { final long longValue = value.longValue(); final long allowedValue = primitiveType.maxValue().longValue(); if (longValue > allowedValue) { XmlSchemaParser.handleError(node, String.format( "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, allowedValue)); } final long maxInt = INT32.maxValue().longValue(); if (primitiveType == UINT32 && longValue > maxInt) { XmlSchemaParser.handleError(node, String.format( "maxValue greater than allowed for type: maxValue=%d allowed=%d", longValue, maxInt)); } } else if (primitiveType == UINT32) { final long maxInt = INT32.maxValue().longValue(); XmlSchemaParser.handleError(node, String.format( "maxValue must be set for varData UINT32 type: max value allowed=%d", maxInt)); } }
indent(writer, 2, "if l > %s {\n", this.lengthType.maxValue()); indent(writer, 3).append("return Err(CodecErr::SliceIsLongerThanAllowedBySchema)\n"); indent(writer, 2).append("}\n");
indent(writer, 2, "if l > %s {\n", this.lengthType.maxValue()); indent(writer, 3).append("return Err(CodecErr::SliceIsLongerThanAllowedBySchema)\n"); indent(writer, 2).append("}\n");
node.blockLengthType.size()); indent(out, 2, "let count = s.len();\n"); indent(out, 2, "if count > %s {\n", node.numInGroupType.maxValue()); indent(out, 3).append("return Err(CodecErr::SliceIsLongerThanAllowedBySchema)\n"); indent(out, 2).append("}\n");
node.blockLengthType.size()); indent(out, 2, "let count = s.len();\n"); indent(out, 2, "if count > %s {\n", node.numInGroupType.maxValue()); indent(out, 3).append("return Err(CodecErr::SliceIsLongerThanAllowedBySchema)\n"); indent(out, 2).append("}\n");
numInGroupMaxValue.longValue() : numInGroupType.primitiveType().maxValue().longValue();
numInGroupMaxValue.longValue() : numInGroupType.primitiveType().maxValue().longValue();