/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getMessage().getParser().doEncode(this, EncodingCharacters.getInstance(getMessage())); }
/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getMessage().getParser().doEncode(this, EncodingCharacters.getInstance(getMessage())); }
/** * {@inheritDoc } */ public void parse(String string) throws HL7Exception { if (data != null) { data.clear(); } getMessage().getParser().parse(this, string, EncodingCharacters.getInstance(getMessage())); }
/** * {@inheritDoc } */ public void parse(String string) throws HL7Exception { if (data != null) { data.clear(); } getMessage().getParser().parse(this, string, EncodingCharacters.getInstance(getMessage())); }
/** * Parses an XML element into a Varies by determining whether the element is primitive or * composite, calling setData() on the Varies with a new generic primitive or composite as * appropriate, and then calling parse again with the new Type object. */ private void parseVaries(Varies datatypeObject, Element datatypeElement) throws HL7Exception { // figure out what data type it holds // short nodeType = datatypeElement.getFirstChild().getNodeType(); if (!hasChildElement(datatypeElement)) { // it's a primitive datatypeObject.setData(new GenericPrimitive(datatypeObject.getMessage())); } else { // it's a composite ... almost know what type, except that we don't have the version // here datatypeObject.setData(new GenericComposite(datatypeObject.getMessage())); } parse(datatypeObject.getData(), datatypeElement); }
/** * Parses an XML element into a Varies by determining whether the element is primitive or * composite, calling setData() on the Varies with a new generic primitive or composite as * appropriate, and then calling parse again with the new Type object. */ private void parseVaries(Varies datatypeObject, Element datatypeElement) throws HL7Exception { // figure out what data type it holds // short nodeType = datatypeElement.getFirstChild().getNodeType(); if (!hasChildElement(datatypeElement)) { // it's a primitive datatypeObject.setData(new GenericPrimitive(datatypeObject.getMessage())); } else { // it's a composite ... almost know what type, except that we don't have the version // here datatypeObject.setData(new GenericComposite(datatypeObject.getMessage())); } parse(datatypeObject.getData(), datatypeElement); }
try { if (comp > 1 && GenericPrimitive.class.isAssignableFrom(v.getData().getClass())) v.setData(new GenericComposite(v.getMessage())); } catch (DataTypeException e) { throw new RuntimeException("Unexpected exception copying data to generic composite: " + e.getMessage(),
try { if (comp > 1 && GenericPrimitive.class.isAssignableFrom(v.getData().getClass())) v.setData(new GenericComposite(v.getMessage())); } catch (DataTypeException e) { throw new RuntimeException("Unexpected exception copying data to generic composite: " + e.getMessage(),
try { Constructor<? extends Type> constr = c.getConstructor(new Class[]{Message.class}); newTypeInstance = constr.newInstance(v.getMessage()); } catch (NoSuchMethodException e) { Constructor<? extends Type> constr = c.getConstructor(new Class[]{Message.class, Integer.class}); newTypeInstance = constr.newInstance(v.getMessage(), 0);
try { Constructor<? extends Type> constr = c.getConstructor(new Class[]{Message.class}); newTypeInstance = constr.newInstance(v.getMessage()); } catch (NoSuchMethodException e) { Constructor<? extends Type> constr = c.getConstructor(new Class[]{Message.class, Integer.class}); newTypeInstance = constr.newInstance(v.getMessage(), 0);