public void invalid(String message) { throw new XmlValueOutOfRangeException( message ); }
public void invalid(String code, Object[] args) { throw new XmlValueOutOfRangeException( code, args ); } }
public int getIntValue() { long l = getLongValue(); if (l > Integer.MAX_VALUE) throw new XmlValueOutOfRangeException(); if (l < Integer.MIN_VALUE) throw new XmlValueOutOfRangeException(); return (int)l; } private static final BigInteger _max = BigInteger.valueOf(Long.MAX_VALUE);
public byte getByteValue() { long l = getIntValue(); if (l > Byte.MAX_VALUE) throw new XmlValueOutOfRangeException(); if (l < Byte.MIN_VALUE) throw new XmlValueOutOfRangeException(); return (byte)l; }
public short getShortValue() { long l = getIntValue(); if (l > Short.MAX_VALUE) throw new XmlValueOutOfRangeException(); if (l < Short.MIN_VALUE) throw new XmlValueOutOfRangeException(); return (short)l; }
protected void set_BigInteger(BigInteger v) { if (v.compareTo(_max) > 0 || v.compareTo(_min) < 0) throw new XmlValueOutOfRangeException(); _value = v.longValue(); } protected void set_long(long l) { _value = l; }
public long getLongValue() { BigInteger b = getBigIntegerValue(); if (b == null) return 0L; if (b.compareTo(_max) >= 0) throw new XmlValueOutOfRangeException(); if (b.compareTo(_min) <= 0) throw new XmlValueOutOfRangeException(); return b.longValue(); }
protected void set_BigInteger(BigInteger v) { if (v.compareTo(_max) > 0 || v.compareTo(_min) < 0) throw new XmlValueOutOfRangeException(); set_int(v.intValue()); } protected void set_long(long l)
protected void set_long(long l) { if (l > Integer.MAX_VALUE || l < Integer.MIN_VALUE) throw new XmlValueOutOfRangeException(); set_int((int)l); } protected void set_int(int i)
protected void set_text(String s) { try { set_int(XsTypeConverter.lexInt(s)); } catch (Exception e) { throw new XmlValueOutOfRangeException(XmlErrorCodes.INT, new Object[] { s }); } } protected void set_nil()
protected void set_text(String s) { if (_validateOnSet()) { if (!check(s, _schemaType)) throw new XmlValueOutOfRangeException(); if (!_schemaType.matchPatternFacet(s)) throw new XmlValueOutOfRangeException(); } super.set_text(s); }
protected void set_GDate(GDateSpecification d) { int btc = d.getBuiltinTypeCode(); if (btc <= 0) throw new XmlValueOutOfRangeException(); set_primitive(btc, d); }
protected void set_text(String s) { if (_validateOnSet()) { if (!check(s, _schemaType)) throw new XmlValueOutOfRangeException(); if (!_schemaType.matchPatternFacet(s)) throw new XmlValueOutOfRangeException(); } super.set_text(s); }
protected void set_text(String s) { try { set_long(XsTypeConverter.lexLong(s)); } catch (Exception e) { throw new XmlValueOutOfRangeException(XmlErrorCodes.LONG, new Object[] { s }); } } protected void set_nil()
protected void set_enum(StringEnumAbstractBase se) { Class ejc = schemaType().getEnumJavaClass(); if (ejc != null && !se.getClass().equals(ejc)) throw new XmlValueOutOfRangeException(); super.set_text(se.toString()); _val = se; } }
protected void set_text(String s) { long v; try { v = XsTypeConverter.lexLong(s); } catch (Exception e) { throw new XmlValueOutOfRangeException(); } if (_validateOnSet()) { validateValue(v, _schemaType, _voorVc); validateLexical(s, _schemaType, _voorVc); } super.set_long(v); }
protected void set_text(String s) { int v; try { v = XsTypeConverter.lexInt(s); } catch (Exception e) { throw new XmlValueOutOfRangeException(); } if (_validateOnSet()) { validateValue(v, _schemaType, _voorVc); validateLexical(s, _schemaType, _voorVc); } super.set_int(v); }
protected void set_text(String s) { StringEnumAbstractBase se = schemaType().enumForString(s); if (se == null) throw new XmlValueOutOfRangeException(XmlErrorCodes.DATATYPE_ENUM_VALID, new Object[] { "string", s, QNameHelper.readable(schemaType()) }); super.set_text(s); _val = se; }
protected void set_Date(Date v) { int code = schemaType().getPrimitiveType().getBuiltinTypeCode(); if (code != SchemaType.BTC_DATE && code != SchemaType.BTC_DATE_TIME || v == null) throw new XmlValueOutOfRangeException(); GDateBuilder gDateBuilder = new GDateBuilder(v); gDateBuilder.setBuiltinTypeCode(code); GDate value = gDateBuilder.toGDate(); if (_validateOnSet()) validateValue(value, _schemaType, _voorVc); _value = value; }
protected void set_text(String s) { // first check against any patterns... if (_validateOnSet() && !_schemaType.matchPatternFacet(s)) throw new XmlValueOutOfRangeException(XmlErrorCodes.DATATYPE_VALID$PATTERN_VALID, new Object[] { "list", s, QNameHelper.readable(_schemaType) }); SchemaType itemType = _schemaType.getListItemType(); XmlSimpleList newval = lex(s, itemType, _voorVc, has_store() ? get_store() : null); // check enumeration if (_validateOnSet()) validateValue(newval, _schemaType, _voorVc); // we made it all the way through; so we're OK. _value = newval; _jvalue = null; }