/** Constructor for AbstractConformanceDataType * @param hapiPrimitive the underlying primitive that the extending class represents */ public AbstractConformanceDataType(Primitive hapiPrimitive) { this.hapiPrimitive = hapiPrimitive; try { if ( getConstantValue() != null ) setValue( getConstantValue() ); } catch ( ConfDataException e ) { log.error( "Could not enforce constant value.", e ); } }
/** This method validates the <code>String</code> value passed in to be no greater then the * maximum allowable length for the extending class. If the <code>String</code> value is valid, this * method will set the underlying HAPI class's value. If the data passed in is invalid for the given * data type, a ConfDataException is thrown. * @throws ConformaceException * @param value the value of the Data Type */ protected void setValue(java.lang.String value) throws ConfDataException { if ((this.getMaxLength() > 0) && (value.length() > this.getMaxLength())) { throw new ConfDataException("DataType length exceeds the Maximum allowable length"); } try { this.hapiPrimitive.setValue(value); } catch (DataTypeException e) { throw new ConfDataException("Invalid Data Populated"); } }
/** This method validates the <code>String</code> value passed in to be no greater then the * maximum allowable length for the extending class. If the <code>String</code> value is valid, this * method will set the underlying HAPI class's value. If the data passed in is invalid for the given * data type, a ConfDataException is thrown. * @throws ConformaceException * @param value the value of the Data Type */ protected void setValue(java.lang.String value) throws ConfDataException { if ((this.getMaxLength() > 0) && (value.length() > this.getMaxLength())) { throw new ConfDataException("DataType length exceeds the Maximum allowable length"); } try { this.hapiPrimitive.setValue(value); } catch (DataTypeException e) { throw new ConfDataException("Invalid Data Populated"); } }
/** Constructor for AbstractConformanceDataType * @param hapiPrimitive the underlying primitive that the extending class represents */ public AbstractConformanceDataType(Primitive hapiPrimitive) { this.hapiPrimitive = hapiPrimitive; try { if ( getConstantValue() != null ) setValue( getConstantValue() ); } catch ( ConfDataException e ) { log.error( "Could not enforce constant value.", e ); } }