/** * This <code>read</code> method will extract the text value from * the node and replace any template variables before converting * it to a primitive value. This uses the <code>Context</code> * object used for this instance of serialization to replace all * template variables with values from the context filter. * * @param node this is the node to be converted to a primitive * * @return this returns the primitive that has been deserialized */ public Object read(InputNode node) throws Exception{ if(node.isElement()) { return readElement(node); } return read(node, expect); }
/** * This <code>validate</code> method will validate the primitive * by checking the node text. If the value is a reference then * this will not extract any value from the node. Transformation * of the extracted value is not done as it can not account for * template variables. Thus any text extracted is valid. * * @param node this is the node to be validated as a primitive * * @return this returns the primitive that has been validated */ public boolean validate(InputNode node) throws Exception { if(node.isElement()) { validateElement(node); } else { node.getValue(); } return true; }
/** * This <code>read</code> method will extract the text value from * the node and replace any template variables before converting * it to a primitive value. This uses the <code>Context</code> * object used for this instance of serialization to replace all * template variables with values from the context filter. * * @param node this is the node to be converted to a primitive * * @return this returns the primitive that has been deserialized */ public Object read(InputNode node) throws Exception{ if(node.isElement()) { return readElement(node); } return read(node, expect); }
/** * This <code>read</code> method will extract the text value from * the node and replace any template variables before converting * it to a primitive value. This uses the <code>Context</code> * object used for this instance of serialization to replace all * template variables with values from the context filter. * * @param node this is the node to be converted to a primitive * * @return this returns the primitive that has been deserialized */ public Object read(InputNode node) throws Exception{ if(node.isElement()) { return readElement(node); } return read(node, expect); }
/** * This <code>validate</code> method will validate the primitive * by checking the node text. If the value is a reference then * this will not extract any value from the node. Transformation * of the extracted value is not done as it can not account for * template variables. Thus any text extracted is valid. * * @param node this is the node to be validated as a primitive * * @return this returns the primitive that has been validated */ public boolean validate(InputNode node) throws Exception { if(node.isElement()) { validateElement(node); } else { node.getValue(); } return true; }
/** * This <code>validate</code> method will validate the primitive * by checking the node text. If the value is a reference then * this will not extract any value from the node. Transformation * of the extracted value is not done as it can not account for * template variables. Thus any text extracted is valid. * * @param node this is the node to be validated as a primitive * * @return this returns the primitive that has been validated */ public boolean validate(InputNode node) throws Exception { if(node.isElement()) { validateElement(node); } else { node.getValue(); } return true; }
/** * This <code>validate</code> method performs validation of the XML * schema class type by traversing the contacts and validating them * using details from the provided XML element. Because this will * validate a non-primitive value it delegates to other converters * to perform validation of lists, maps, and primitives. * <p> * If any of the required contacts are not present within the given * XML element this will terminate validation and throw an exception * The annotation missing is reported in the exception. * * @param node the XML element contact values are validated from * @param type this is the type to validate against the input node */ private boolean validate(InputNode node, Class type) throws Exception { Schema schema = context.getSchema(type); Section section = schema.getSection(); validateText(node, schema); validateSection(node, section); return node.isElement(); }
/** * This <code>validate</code> method performs validation of the XML * schema class type by traversing the contacts and validating them * using details from the provided XML element. Because this will * validate a non-primitive value it delegates to other converters * to perform validation of lists, maps, and primitives. * <p> * If any of the required contacts are not present within the given * XML element this will terminate validation and throw an exception * The annotation missing is reported in the exception. * * @param node the XML element contact values are validated from * @param type this is the type to validate against the input node */ private boolean validate(InputNode node, Class type) throws Exception { Schema schema = context.getSchema(type); Section section = schema.getSection(); validateText(node, schema); validateSection(node, section); return node.isElement(); }
/** * This <code>validate</code> method performs validation of the XML * schema class type by traversing the contacts and validating them * using details from the provided XML element. Because this will * validate a non-primitive value it delegates to other converters * to perform validation of lists, maps, and primitives. * <p> * If any of the required contacts are not present within the given * XML element this will terminate validation and throw an exception * The annotation missing is reported in the exception. * * @param node the XML element contact values are validated from * @param type this is the type to validate against the input node */ private boolean validate(InputNode node, Class type) throws Exception { Schema schema = context.getSchema(type); Section section = schema.getSection(); validateText(node, schema); validateSection(node, section); return node.isElement(); }