/** * Validates the data read from the XML document by checking that when <code>MaxRetries</code> is supplied * <code>RetryInterval</code> contains positive non zero value. * * @throws Exception When the read XML is not valid */ @Validate public void validate() throws Exception { if (maxRetries > -1) if (fixedInterval <= 0) throw new ValueRequiredException( "ReceptionAwareness/RetryInterval must have positive non zero value if MaxRetries is set"); else if (!Utils.isNullOrEmpty(flexibleIntervalsText)) throw new ElementException("Invalid combination of MaxRetries and WaitIntervals settings"); // Create the array of intervals and check also that the specified intervals are valid calculateIntervals(); }
/** * This method checks to see if there are any <code>Label</code> * objects remaining in the provided map that are required. This is * used when validation is performed to ensure the the XML element * validated contains sufficient details to satisfy the XML schema * class annotations. If there is a required label that remains it * is reported within the exception thrown. * * @param node this is the node that contains the composite data * @param map this contains the converters to perform validation */ private void validate(InputNode node, LabelMap map) throws Exception { Position line = node.getPosition(); for(Label label : map) { Class expect = type.getType(); if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Unable to satisfy %s for %s at %s", label, expect, line); } } }
/** * This method checks to see if there are any <code>Label</code> * objects remaining in the provided map that are required. This is * used when validation is performed to ensure the the XML element * validated contains sufficient details to satisfy the XML schema * class annotations. If there is a required label that remains it * is reported within the exception thrown. * * @param node this is the node that contains the composite data * @param map this contains the converters to perform validation */ private void validate(InputNode node, LabelMap map) throws Exception { Position line = node.getPosition(); for(Label label : map) { Class expect = type.getType(); if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Unable to satisfy %s for %s at %s", label, expect, line); } } }
/** * This method checks to see if there are any <code>Label</code> * objects remaining in the provided map that are required. This is * used when validation is performed to ensure the the XML element * validated contains sufficient details to satisfy the XML schema * class annotations. If there is a required label that remains it * is reported within the exception thrown. * * @param node this is the node that contains the composite data * @param map this contains the converters to perform validation */ private void validate(InputNode node, LabelMap map) throws Exception { Position line = node.getPosition(); for(Label label : map) { Class expect = type.getType(); if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Unable to satisfy %s for %s at %s", label, expect, line); } } }
/** * This method checks to see if there are any <code>Label</code> * objects remaining in the provided map that are required. This is * used when deserialization is performed to ensure the the XML * element deserialized contains sufficient details to satisfy the * XML schema class annotations. If there is a required label that * remains it is reported within the exception thrown. * * @param node this is the node that contains the contact value * @param map this is the map to check for remaining labels * @param source this is the object that has been deserialized */ private void validate(InputNode node, LabelMap map, Object source) throws Exception { Class expect = context.getType(type, source); Position line = node.getPosition(); for(Label label : map) { if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Unable to satisfy %s for %s at %s", label, expect, line); } Object value = label.getEmpty(context); if(value != null) { criteria.set(label, value); } } }
/** * This method checks to see if there are any <code>Label</code> * objects remaining in the provided map that are required. This is * used when deserialization is performed to ensure the the XML * element deserialized contains sufficient details to satisfy the * XML schema class annotations. If there is a required label that * remains it is reported within the exception thrown. * * @param node this is the node that contains the contact value * @param map this is the map to check for remaining labels * @param source this is the object that has been deserialized */ private void validate(InputNode node, LabelMap map, Object source) throws Exception { Class expect = context.getType(type, source); Position line = node.getPosition(); for(Label label : map) { if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Unable to satisfy %s for %s at %s", label, expect, line); } Object value = label.getEmpty(context); if(value != null) { criteria.set(label, value); } } }
/** * This method checks to see if there are any <code>Label</code> * objects remaining in the provided map that are required. This is * used when deserialization is performed to ensure the the XML * element deserialized contains sufficient details to satisfy the * XML schema class annotations. If there is a required label that * remains it is reported within the exception thrown. * * @param node this is the node that contains the contact value * @param map this is the map to check for remaining labels * @param source this is the object that has been deserialized */ private void validate(InputNode node, LabelMap map, Object source) throws Exception { Class expect = context.getType(type, source); Position line = node.getPosition(); for(Label label : map) { if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Unable to satisfy %s for %s at %s", label, expect, line); } Object value = label.getEmpty(context); if(value != null) { criteria.set(label, value); } } }
/** * This <code>read</code> method is used to perform deserialization * of the provided node object using a delegate converter. This is * typically another <code>Composite</code> converter, or if the * node is an attribute a <code>Primitive</code> converter. When * the delegate converter has completed the deserialized value is * assigned to the contact. * * @param node this is the node that contains the contact value * @param source the type of the object that is being deserialized * @param label this is the label used to create the converter */ private Object readInstance(InputNode node, Object source, Label label) throws Exception { Object object = readVariable(node, source, label); if(object == null) { Position line = node.getPosition(); Class expect = context.getType(type, source); if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Empty value for %s in %s at %s", label, expect, line); } } else { if(object != label.getEmpty(context)) { criteria.set(label, object); } } return object; }
/** * This <code>read</code> method is used to perform deserialization * of the provided node object using a delegate converter. This is * typically another <code>Composite</code> converter, or if the * node is an attribute a <code>Primitive</code> converter. When * the delegate converter has completed the deserialized value is * assigned to the contact. * * @param node this is the node that contains the contact value * @param source the type of the object that is being deserialized * @param label this is the label used to create the converter */ private Object readInstance(InputNode node, Object source, Label label) throws Exception { Object object = readVariable(node, source, label); if(object == null) { Position line = node.getPosition(); Class expect = context.getType(type, source); if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Empty value for %s in %s at %s", label, expect, line); } } else { if(object != label.getEmpty(context)) { criteria.set(label, object); } } return object; }
/** * This <code>read</code> method is used to perform deserialization * of the provided node object using a delegate converter. This is * typically another <code>Composite</code> converter, or if the * node is an attribute a <code>Primitive</code> converter. When * the delegate converter has completed the deserialized value is * assigned to the contact. * * @param node this is the node that contains the contact value * @param source the type of the object that is being deserialized * @param label this is the label used to create the converter */ private Object readInstance(InputNode node, Object source, Label label) throws Exception { Object object = readVariable(node, source, label); if(object == null) { Position line = node.getPosition(); Class expect = context.getType(type, source); if(label.isRequired() && revision.isEqual()) { throw new ValueRequiredException("Empty value for %s in %s at %s", label, expect, line); } } else { if(object != label.getEmpty(context)) { criteria.set(label, object); } } return object; }