public String getEncoding() { if (encoding == null) { this.encoding = getEncoding(this); } return encoding; }
public String getEncoding() { if (encoding == null) { this.encoding = getEncoding(this); } return encoding; }
public void writeExternal(ObjectOutput out, byte version) throws IOException { super.writeExternal(out); if (this.encoding == null) { this.encoding = getEncoding(this); } out.writeObject(this.encoding); if (version > 0) { ExternalizeUtil.writeEnum(out, this.type); } else { out.writeObject(this.type); } }
public void writeExternal(ObjectOutput out, byte version) throws IOException { super.writeExternal(out); if (this.encoding == null) { this.encoding = getEncoding(this); } out.writeObject(this.encoding); if (version > 0) { ExternalizeUtil.writeEnum(out, this.type); } else { out.writeObject(this.type); } }
/** * Returns the encoding or null if it cannot be determined * @param xml * @return */ public static String getEncoding(SQLXML xml) { try { if (xml instanceof XMLType) { XMLType type = (XMLType)xml; if (type.encoding != null) { return type.encoding; } xml = type.reference; } if (xml instanceof SQLXMLImpl) { Charset cs = ((SQLXMLImpl)xml).getCharset(); if (cs != null) { return cs.name(); } } return getEncoding(xml.getBinaryStream()); } catch (SQLException e) { return null; } }
/** * Returns the encoding or null if it cannot be determined * @param xml * @return */ public static String getEncoding(SQLXML xml) { try { if (xml instanceof XMLType) { XMLType type = (XMLType)xml; if (type.encoding != null) { return type.encoding; } xml = type.reference; } if (xml instanceof SQLXMLImpl) { Charset cs = ((SQLXMLImpl)xml).getCharset(); if (cs != null) { return cs.name(); } } return getEncoding(xml.getBinaryStream()); } catch (SQLException e) { return null; } }
@Override public Charset getCharset() { Charset cs = super.getCharset(); if (cs != null) { return cs; } String enc = null; try { enc = XMLType.getEncoding(this.getBinaryStream()); } catch (SQLException e) { } if (enc != null) { setEncoding(enc); } else { super.setCharset(Streamable.CHARSET); } return super.getCharset(); }
@Override public Charset getCharset() { Charset cs = super.getCharset(); if (cs != null) { return cs; } String enc = null; try { enc = XMLType.getEncoding(this.getBinaryStream()); } catch (SQLException e) { } if (enc != null) { setEncoding(enc); } else { super.setCharset(Streamable.CHARSET); } return super.getCharset(); }
XMLType val = (XMLType)currentValue; SQLXMLImpl impl = new SQLXMLImpl(createInputStreamFactory(val)); impl.setEncoding(val.getEncoding()); return impl;
XMLType val = (XMLType)currentValue; SQLXMLImpl impl = new SQLXMLImpl(createInputStreamFactory(val)); impl.setEncoding(val.getEncoding()); return impl;
try { InputStream is = null; if (!Charset.forName(value.getEncoding()).equals(encoding)) { is = new ReaderInputStream(value.getCharacterStream(), encoding); } else { if (!Charset.forName(value.getEncoding()).equals(encoding)) {
try { InputStream is = null; if (!Charset.forName(value.getEncoding()).equals(encoding)) { is = new ReaderInputStream(value.getCharacterStream(), encoding); } else { if (!Charset.forName(value.getEncoding()).equals(encoding)) {
try { InputStream is = null; if (!Charset.forName(value.getEncoding()).equals(encoding)) { is = new ReaderInputStream(value.getCharacterStream(), encoding); } else { if (!Charset.forName(value.getEncoding()).equals(encoding)) {